Change CMAKE_CUDA_STANDARD to C++17 for Windows GPU build (#7883)

This commit is contained in:
Changming Sun 2021-06-01 20:28:34 -07:00 committed by GitHub
parent a9f7eef754
commit 38ca0f4839
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -1385,8 +1385,11 @@ if (onnxruntime_USE_CUDA)
endif()
enable_language(CUDA)
message( STATUS "CMAKE_CUDA_COMPILER_VERSION: ${CMAKE_CUDA_COMPILER_VERSION}")
set(CMAKE_CUDA_STANDARD 14)
if (WIN32)
set(CMAKE_CUDA_STANDARD 17)
else()
set(CMAKE_CUDA_STANDARD 14)
endif()
file(TO_CMAKE_PATH ${onnxruntime_CUDNN_HOME} onnxruntime_CUDNN_HOME)
set(ONNXRUNTIME_CUDA_LIBRARIES ${CUDA_LIBRARIES})

View file

@ -18,8 +18,8 @@ constexpr const char* UpsampleModeCubic = "cubic";
// is a 4x4 matrix
const size_t CubicModeGridLength = 4;
using GetNearestPixelFunc = std::function<int64_t(float, bool)>;
using GetOriginalCoordinateFunc = std::function<float(float, float, float, float, float, float)>;
using GetNearestPixelFunc = int64_t(*)(float, bool);
using GetOriginalCoordinateFunc = float (*)(float, float, float, float, float, float);
enum UpsampleMode {
NN = 0, // nearest neighbour

View file

@ -178,7 +178,7 @@ class CUDAExecutionProvider : public IExecutionProvider {
p.reset();
});
}
std::shared_ptr<PerThreadContextMap> p{std::make_shared<PerThreadContextMap>()};
std::shared_ptr<PerThreadContextMap> p = std::make_shared<PerThreadContextMap>();
};
static const std::shared_ptr<PerThreadContextMap>& PerThreadContextCache() {