From 96b27bd3d400608aa1e7fc67c941cc196cb4ccc0 Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Fri, 20 Dec 2019 16:40:08 +0100 Subject: [PATCH] ROCm 3.0 support --- CMakeLists.txt | 6 +++++- src/core/actor/Mmm1dgpuForce_cuda.cu | 1 + src/core/curand_wrapper.hpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6958d0ce6f0..fa307801c7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -184,7 +184,11 @@ if(WITH_CUDA) message(STATUS "Found HIP compiler: ${HIP_HIPCC_EXECUTABLE}") set(CUDA 1) set(HIP 1) - list(APPEND HIP_HCC_FLAGS "-Wno-macro-redefined -Wno-duplicate-decl-specifier -std=c++14") + list(APPEND HIP_HCC_FLAGS "-I${HIP_ROOT_DIR}/include -Wno-c99-designator -Wno-macro-redefined -Wno-duplicate-decl-specifier -std=c++14") + list(APPEND HIP_HCC_FLAGS "-pedantic -Wall -Wextra -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-parameter -Wno-missing-braces -Wno-gnu-anonymous-struct -Wno-nested-anon-types -Wno-gnu-zero-variadic-macro-arguments") + if(WARNINGS_ARE_ERRORS) + list(APPEND HIP_HCC_FLAGS "-Werror") + endif() find_library(ROCFFT_LIB name "rocfft" PATHS "${HIP_ROOT_DIR}/lib") diff --git a/src/core/actor/Mmm1dgpuForce_cuda.cu b/src/core/actor/Mmm1dgpuForce_cuda.cu index b4ce6b99f6c..456129f12de 100644 --- a/src/core/actor/Mmm1dgpuForce_cuda.cu +++ b/src/core/actor/Mmm1dgpuForce_cuda.cu @@ -31,6 +31,7 @@ // the code is mostly multi-GPU capable, but ESPResSo is not yet const int deviceCount = 1; float multigpu_factors[] = {1.0}; +#undef cudaSetDevice #define cudaSetDevice(d) #include "EspressoSystemInterface.hpp" diff --git a/src/core/curand_wrapper.hpp b/src/core/curand_wrapper.hpp index 8e4eca1bbdc..522a9a9a9d4 100644 --- a/src/core/curand_wrapper.hpp +++ b/src/core/curand_wrapper.hpp @@ -42,7 +42,7 @@ class philox4x32_10_stateless : private rocrand_device::philox4x32_10_engine { __forceinline__ __device__ uint4 curand_Philox4x32_10(uint4 counter, uint2 key) { - philox4x32_10_stateless *e; + philox4x32_10_stateless *e = nullptr; return (*e)(counter, key); }