MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / TaskInferenceEnvironment

Method TaskInferenceEnvironment

samples/common/sampleInference.cpp:439–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439TaskInferenceEnvironment::TaskInferenceEnvironment(
440 std::string engineFile, InferenceOptions inference, int32_t deviceId, int32_t DLACore, int32_t bs)
441 : iOptions(inference)
442 , device(deviceId)
443 , batch(bs)
444{
445 BuildEnvironment bEnv(/* isSafe */ false, /* versionCompatible */ false, DLACore, "", getTempfileControlDefaults());
446 loadEngineToBuildEnv(engineFile, false, bEnv, sample::gLogError);
447 std::unique_ptr<InferenceEnvironment> tmp(new InferenceEnvironment(bEnv));
448 iEnv = std::move(tmp);
449
450 cudaCheck(cudaSetDevice(device));
451 SystemOptions system{};
452 system.device = device;
453 system.DLACore = DLACore;
454 if (!setUpInference(*iEnv, iOptions, system))
455 {
456 sample::gLogError << "Inference set up failed" << std::endl;
457 }
458}
459namespace
460{
461

Callers

nothing calls this directly

Calls 4

loadEngineToBuildEnvFunction · 0.85
cudaCheckFunction · 0.85
setUpInferenceFunction · 0.85

Tested by

no test coverage detected