yes, the verbose output show as bellow:
[0]: (Unnamed Layer* 0) [Convolution] set to DLA
0: (Unnamed Layer* 0) [Convolution], 1
[1]: (Unnamed Layer* 1) [Convolution] set to DLA
1: (Unnamed Layer* 1) [Convolution], 1
[2]: (Unnamed Layer* 2) [Convolution] set to DLA
2: (Unnamed Layer* 2) [Convolution], 1
[3]: (Unnamed Layer* 3) [Convolution] set to DLA
3: (Unnamed Layer* 3) [Convolution], 1
[TRT Info]
[TRT Info] --------------- Layers running on DLA:
[TRT Info]
[TRT Info] --------------- Layers running on GPU:
[TRT Info] (Unnamed Layer* 0) [Convolution], (Unnamed Layer* 1) [Convolution], (Unnamed Layer* 2) [Convolution], (Unnamed Layer* 3) [Convolution],
[TRT Info] Detected 1 inputs and 1 output network tensors.
and the code is:
config_->setFlag(nvinfer1::BuilderFlag::kFP16);
for (int i = 0; i < network->getNbLayers(); ++i) {
auto layer = network->getLayer(i);
auto layer_name = layer->getName();
if (builder_->canRunOnDLA(layer)) {
printf("[%d]: %s set to DLA\n", i, layer_name);
layer->setPrecision(nvinfer1::DataType::kHALF);
builder_->setDeviceType(layer, nvinfer1::DeviceType::kDLA);
builder_->setDLACore(0);
}
int device_type = int(builder_->getDeviceType(layer));
printf("%4d: %s, %d\n", i, layer_name, device_type);
}
Thanks