| 437 | } |
| 438 | |
| 439 | TaskInferenceEnvironment::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 | } |
| 459 | namespace |
| 460 | { |
| 461 |
nothing calls this directly
no test coverage detected