Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid Ctx API in HIP backend #840

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmake/CompilerConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if ((NOT (USE_MPI)) OR (NOT ("${MPI_Fortran_LIBRARY_VERSION_STRING}" MATCHES "Open MPI")))
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=leak")
endif ()
if (USE_ACCEL MATCHES "hip" AND hip_VERSION GREATER_EQUAL 6.0.0) # Remove deprecated function error with ROCm v6+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-declarations")
endif ()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -funroll-loops")
set(CMAKE_CXX_FLAGS_COVERAGE "-O0 -g --coverage")
Expand Down
4 changes: 4 additions & 0 deletions src/acc/cuda_hip/acc_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ extern "C" int c_dbcsr_acc_init() {
ACC_DRV(device) acc_device;
ACC_API_CALL(GetDevice, (&myDevice));
ACC_DRV_CALL(DeviceGet, (&acc_device, myDevice));
#if defined(__CUDA)
ACC_DRV(context) ctx;
ACC_DRV_CALL(DevicePrimaryCtxRetain, (&ctx, acc_device));
#endif
ACC_API_CALL(RuntimeGetVersion, (&runtimeVersion));

// Initialize libsmm_acc, DBCSR's GPU backend
Expand All @@ -41,6 +43,8 @@ extern "C" int c_dbcsr_acc_finalize() {
ACC_DRV(device) acc_device;
ACC_API_CALL(GetDevice, (&myDevice));
ACC_DRV_CALL(DeviceGet, (&acc_device, myDevice));
#if defined(__CUDA)
ACC_DRV_CALL(DevicePrimaryCtxRelease, (acc_device));
#endif
return libsmm_acc_finalize();
}