Skip to content

Commit 8a1f37b

Browse files
gsitaramalazzaro
authored andcommitted
Avoid Ctx API in HIP backend
1 parent ff978bf commit 8a1f37b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/acc/cuda_hip/acc_init.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ extern "C" int c_dbcsr_acc_init() {
2626
ACC_DRV(device) acc_device;
2727
ACC_API_CALL(GetDevice, (&myDevice));
2828
ACC_DRV_CALL(DeviceGet, (&acc_device, myDevice));
29+
#if defined(__CUDA)
2930
ACC_DRV(context) ctx;
3031
ACC_DRV_CALL(DevicePrimaryCtxRetain, (&ctx, acc_device));
32+
#endif
3133
ACC_API_CALL(RuntimeGetVersion, (&runtimeVersion));
3234

3335
// Initialize libsmm_acc, DBCSR's GPU backend
@@ -41,6 +43,8 @@ extern "C" int c_dbcsr_acc_finalize() {
4143
ACC_DRV(device) acc_device;
4244
ACC_API_CALL(GetDevice, (&myDevice));
4345
ACC_DRV_CALL(DeviceGet, (&acc_device, myDevice));
46+
#if defined(__CUDA)
4447
ACC_DRV_CALL(DevicePrimaryCtxRelease, (acc_device));
48+
#endif
4549
return libsmm_acc_finalize();
4650
}

0 commit comments

Comments
 (0)