mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 17:17:14 +08:00
[Backend] TRT cast GPU input from int64 to int32, output from int32 to int64, and Windows support building CUDA files (#426)
* TRT cast int64 to int32 * windows cmake build cuda src * fix windows cmake error when build cuda src * add a notice in windows gpu build doc * cmake add cuda std=11 * TRT cast output from int32 to int64 * nits * trt get original input output dtype
This commit is contained in:
@@ -104,6 +104,26 @@ nvinfer1::DataType ReaderDtypeToTrtDtype(int reader_dtype) {
|
||||
return nvinfer1::DataType::kFLOAT;
|
||||
}
|
||||
|
||||
FDDataType ReaderDtypeToFDDtype(int reader_dtype) {
|
||||
if (reader_dtype == 0) {
|
||||
return FDDataType::FP32;
|
||||
} else if (reader_dtype == 1) {
|
||||
return FDDataType::FP64;
|
||||
} else if (reader_dtype == 2) {
|
||||
return FDDataType::UINT8;
|
||||
} else if (reader_dtype == 3) {
|
||||
return FDDataType::INT8;
|
||||
} else if (reader_dtype == 4) {
|
||||
return FDDataType::INT32;
|
||||
} else if (reader_dtype == 5) {
|
||||
return FDDataType::INT64;
|
||||
} else if (reader_dtype == 6) {
|
||||
return FDDataType::FP16;
|
||||
}
|
||||
FDASSERT(false, "Received unexpected data type of %d", reader_dtype);
|
||||
return FDDataType::FP32;
|
||||
}
|
||||
|
||||
std::vector<int> ToVec(const nvinfer1::Dims& dim) {
|
||||
std::vector<int> out(dim.d, dim.d + dim.nbDims);
|
||||
return out;
|
||||
|
Reference in New Issue
Block a user