Skip to content

Commit

Permalink
ROCm 3.3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuron committed Apr 2, 2020
1 parent 8813c4c commit 8086600
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/FindCUDACompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions src/core/cuda_init_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8086600

Please sign in to comment.