small change for recent CUDA compatibility

This commit is contained in:
RubenCGomes 2025-11-02 18:14:06 +00:00
parent d4085f49a5
commit 222f6db431
No known key found for this signature in database
GPG Key ID: 0D213021197E3EE0
1 changed files with 3 additions and 2 deletions

View File

@ -177,7 +177,8 @@ static void initialize_cuda(cuda_data_t *cd)
// //
// create a context // 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) ); CU_CALL( cuCtxSetCacheConfig , (CU_FUNC_CACHE_PREFER_L1) );
// //
// load precompiled modules // load precompiled modules
@ -223,7 +224,7 @@ static void terminate_cuda(cuda_data_t *cd)
CU_CALL( cuMemFree , (cd->device_data[i]) ); CU_CALL( cuMemFree , (cd->device_data[i]) );
} }
CU_CALL( cuModuleUnload , (cd->cu_module) ); CU_CALL( cuModuleUnload , (cd->cu_module) );
CU_CALL( cuCtxDestroy , (cd->cu_context) ); CU_CALL( cuDevicePrimaryCtxRelease, (cd->cu_device) );
} }