From 222f6db4313d067ca616a925f772ee9cfd1b4907 Mon Sep 17 00:00:00 2001 From: RubenCGomes Date: Sun, 2 Nov 2025 18:14:06 +0000 Subject: [PATCH] small change for recent CUDA compatibility --- aad_cuda_utilities.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aad_cuda_utilities.h b/aad_cuda_utilities.h index 28a79e3..290894c 100644 --- a/aad_cuda_utilities.h +++ b/aad_cuda_utilities.h @@ -177,7 +177,8 @@ static void initialize_cuda(cuda_data_t *cd) // // create a context // - CU_CALL( cuCtxCreate , (&cd->cu_context,CU_CTX_SCHED_YIELD,cd->cu_device) ); + CU_CALL( cuDevicePrimaryCtxRetain , (&cd->cu_context,cd->cu_device) ); + CU_CALL( cuCtxSetCurrent , (cd->cu_context) ); CU_CALL( cuCtxSetCacheConfig , (CU_FUNC_CACHE_PREFER_L1) ); // // load precompiled modules @@ -223,7 +224,7 @@ static void terminate_cuda(cuda_data_t *cd) CU_CALL( cuMemFree , (cd->device_data[i]) ); } CU_CALL( cuModuleUnload , (cd->cu_module) ); - CU_CALL( cuCtxDestroy , (cd->cu_context) ); + CU_CALL( cuDevicePrimaryCtxRelease, (cd->cu_device) ); }