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

Function getLayerDeviceTypes

samples/common/sampleOptions.cpp:353–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void getLayerDeviceTypes(Arguments& arguments, char const* argument, LayerDeviceTypes& layerDeviceTypes)
354{
355 std::string list;
356 if (!getAndDelOption(arguments, argument, list))
357 {
358 return;
359 }
360
361 // The layerDeviceTypes flag contains comma-separated layerName:deviceType pairs.
362 std::vector<std::string> deviceList{splitToStringVec(list, ',')};
363 for (auto const& s : deviceList)
364 {
365 auto nameDevicePair = splitNameAndValue<std::string>(s);
366 auto const layerName = removeSingleQuotationMarks(nameDevicePair.first);
367 layerDeviceTypes[layerName] = stringToValue<nvinfer1::DeviceType>(nameDevicePair.second);
368 }
369}
370
371bool getShapesBuild(Arguments& arguments, BuildOptions::ShapeProfile& shapes, char const* argument,
372 nvinfer1::OptProfileSelector selector)

Callers 1

parseMethod · 0.85

Calls 3

getAndDelOptionFunction · 0.85
splitToStringVecFunction · 0.85

Tested by

no test coverage detected