Skip to content

Commit

Permalink
fix for TRT5 RC
Browse files Browse the repository at this point in the history
  • Loading branch information
dusty-nv committed Nov 15, 2018
1 parent fb1208c commit c5928d8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tensorNet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,13 @@ static inline nvinfer1::DeviceType deviceTypeToTRT( deviceType type )
{
case DEVICE_GPU: return nvinfer1::DeviceType::kGPU;
//case DEVICE_DLA: return nvinfer1::DeviceType::kDLA;
case DEVICE_DLA_0: return nvinfer1::DeviceType::kDLA/*0*/;
case DEVICE_DLA_1: return nvinfer1::DeviceType::kDLA/*1*/;
#if NV_TENSORRT_MAJOR == 5 && NV_TENSORRT_MINOR == 0 && NV_TENSORRT_PATCH == 0
case DEVICE_DLA_0: return nvinfer1::DeviceType::kDLA0;
case DEVICE_DLA_1: return nvinfer1::DeviceType::kDLA1;
#else
case DEVICE_DLA_0: return nvinfer1::DeviceType::kDLA;
case DEVICE_DLA_1: return nvinfer1::DeviceType::kDLA;
#endif
}
}
#endif
Expand Down Expand Up @@ -371,10 +376,12 @@ bool tensorNet::ProfileModel(const std::string& deployFile, // name for caf
if( allowGPUFallback )
builder->allowGPUFallback(true);

#if !(NV_TENSORRT_MAJOR == 5 && NV_TENSORRT_MINOR == 0 && NV_TENSORRT_PATCH == 0)
if( device == DEVICE_DLA_0 )
builder->setDLACore(0);
else if( device == DEVICE_DLA_1 )
builder->setDLACore(1);
#endif
#endif

// build CUDA engine
Expand Down Expand Up @@ -545,7 +552,7 @@ bool tensorNet::LoadNetwork( const char* prototxt_path, const char* model_path,
return 0;
}

#if NV_TENSORRT_MAJOR >= 5
#if NV_TENSORRT_MAJOR >= 5 && !(NV_TENSORRT_MAJOR == 5 && NV_TENSORRT_MINOR == 0 && NV_TENSORRT_PATCH == 0)
// if using DLA, set the desired core before deserialization occurs
if( device == DEVICE_DLA_0 )
{
Expand Down

0 comments on commit c5928d8

Please sign in to comment.