!46726 gpu module adapt for gcc11

Merge pull request !46726 from qiuzhongya/gcc11_cuda
This commit is contained in:
i-robot 2022-12-13 06:36:48 +00:00 committed by Gitee
commit fde88b4f4d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 7 additions and 6 deletions

View File

@ -114,7 +114,7 @@ int ScaleAndTranslateGpuKernelMod::Resize(const BaseOperatorPtr &base_operator,
const std::vector<KernelTensorPtr> &inputs,
const std::vector<KernelTensorPtr> &outputs,
const std::map<uint32_t, tensor::TensorPtr> &inputsOnHost) {
for (const auto inputtest : inputs) {
for (const auto &inputtest : inputs) {
auto inshape = inputtest->GetShapeVector();
if (!IsValidShape(inshape)) {
return KRET_UNKNOWN_SHAPE;

View File

@ -78,7 +78,7 @@ int ScaleAndTranslateGradGpuKernelMod::Resize(const BaseOperatorPtr &base_operat
std::vector<int64_t> inp_shape_scale = inputs[kIndex2]->GetShapeVector();
std::vector<int64_t> inp_shape_translation = inputs[kIndex3]->GetShapeVector();
std::vector<int64_t> out_shape = outputs[0]->GetShapeVector();
for (const auto inputtest : inputs) {
for (const auto &inputtest : inputs) {
auto inshape = inputtest->GetShapeVector();
if (!IsValidShape(inshape)) {
return KRET_UNKNOWN_SHAPE;

View File

@ -11,11 +11,12 @@ endif()
if(${CUDA_VERSION} VERSION_LESS 11.0)
if(NOT MSVC)
string(REPLACE "-std=c++17" "-std=c++11" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-std=c++17" "-std=c++11" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endif()
else()
if(NOT MSVC)
string(REPLACE "-std=c++17" "-std=c++14" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REPLACE "-std=c++17" "-std=c++14" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++14")
endif()
endif()

View File

@ -84,7 +84,7 @@ int ResizeBicubicGpuKernelMod::Resize(const BaseOperatorPtr &base_operator, cons
std::vector<int64_t> inp_shape = inputs[0]->GetShapeVector();
std::vector<int64_t> inptosize_shape = inputs[1]->GetShapeVector();
std::vector<int64_t> out_shape = outputs[0]->GetShapeVector();
for (const auto inputtest : inputs) {
for (const auto &inputtest : inputs) {
auto inshape = inputtest->GetShapeVector();
if (!IsValidShape(inshape)) {
return KRET_UNKNOWN_SHAPE;

View File

@ -78,7 +78,7 @@ int ResizeBicubicGradGpuKernelMod::Resize(const BaseOperatorPtr &base_operator,
std::vector<int64_t> inp_shape = inputs[0]->GetShapeVector();
std::vector<int64_t> inptosize_shape = inputs[1]->GetShapeVector();
std::vector<int64_t> out_shape = outputs[0]->GetShapeVector();
for (const auto inputtest : inputs) {
for (const auto &inputtest : inputs) {
auto inshape = inputtest->GetShapeVector();
if (!IsValidShape(inshape)) {
return KRET_UNKNOWN_SHAPE;