File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments