From 80866001307923767882ae506ffb2640cfb16605 Mon Sep 17 00:00:00 2001 From: Michael Kuron Date: Thu, 2 Apr 2020 13:28:01 +0200 Subject: [PATCH] ROCm 3.3 support --- cmake/FindCUDACompiler.cmake | 9 +++++++-- src/core/cuda_init_cuda.cu | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/FindCUDACompiler.cmake b/cmake/FindCUDACompiler.cmake index a8a6f25a346..789da56fb17 100644 --- a/cmake/FindCUDACompiler.cmake +++ b/cmake/FindCUDACompiler.cmake @@ -64,14 +64,19 @@ else() list(APPEND CMAKE_MODULE_PATH "${ROCM_HOME}/hip/cmake") find_package(HIP 1.5.18494 QUIET MODULE) if(HIP_FOUND) - set(HCC_PATH "${HIP_ROOT_DIR}") + if(HIP_VERSION VERSION_LESS "3.1") + set(HCC_PATH "${HIP_ROOT_DIR}") + else() + set(HCC_PATH "${ROCM_HOME}/hcc") + endif() + find_package(HIP MODULE) message(STATUS "Found HIP compiler: ${HIP_HIPCC_EXECUTABLE}") set(CUDA 1) set(HIP 1) set(CUDA_COMPILER_EXE ${HIP_HIPCC_EXECUTABLE}) list(APPEND HIP_HCC_FLAGS "-I${HIP_ROOT_DIR}/include -I${ROCM_HOME}/include -Wno-c99-designator -Wno-macro-redefined -Wno-duplicate-decl-specifier -std=c++${CMAKE_CXX_STANDARD}") - 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") + 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 -Wno-deprecated-copy") if(WARNINGS_ARE_ERRORS) list(APPEND HIP_HCC_FLAGS "-Werror") endif() diff --git a/src/core/cuda_init_cuda.cu b/src/core/cuda_init_cuda.cu index a7a1f2ea7d9..f49ed81fe2a 100644 --- a/src/core/cuda_init_cuda.cu +++ b/src/core/cuda_init_cuda.cu @@ -40,6 +40,9 @@ static const int computeCapabilityMinMinor = 0; const char *cuda_error; void cuda_init() { +#if defined(__HIPCC__) and not defined(__CUDACC__) + setenv("HSA_ENABLE_INTERRUPT", "0", 1); +#endif #if defined(__HIPCC__) and not defined(__CUDACC__) and \ HIP_VERSION_PATCH <= 19171 /* i.e. <= v2.4.0 */ // Catch an exception that causes `import espressomd` to crash in