@@ -468,13 +468,20 @@ static int test_alloc_prim_send_user(const test_params_t *params)
468468 alloc_mem_t alloc_mem_send , alloc_mem_recv ;
469469 CUcontext primary_ctx , user_ctx ;
470470 int res ;
471+ #if CUDA_VERSION >= 12050
472+ CUctxCreateParams ctx_create_params = {};
473+ #endif
471474
472475 retain_and_push_primary_context (params -> cu_dev );
473476
474477 alloc_mem (params , & alloc_mem_send , & alloc_mem_recv );
475478
476479 CUDA_CHECK (cuCtxPopCurrent (& primary_ctx ));
480+ #if CUDA_VERSION >= 12050
481+ CUDA_CHECK (cuCtxCreate_v4 (& user_ctx , & ctx_create_params , 0 , params -> cu_dev ));
482+ #else
477483 CUDA_CHECK (cuCtxCreate (& user_ctx , 0 , params -> cu_dev ));
484+ #endif
478485
479486 mpi_pingpong (params -> rank , alloc_mem_send .ptr , alloc_mem_recv .ptr ,
480487 params -> size );
@@ -495,7 +502,12 @@ static int test_alloc_user_send_prim(const test_params_t *params)
495502 alloc_mem_t alloc_mem_send , alloc_mem_recv ;
496503 int res ;
497504
505+ #if CUDA_VERSION >= 12050
506+ CUctxCreateParams ctx_create_params = {};
507+ CUDA_CHECK (cuCtxCreate_v4 (& user_ctx , & ctx_create_params , 0 , params -> cu_dev ));
508+ #else
498509 CUDA_CHECK (cuCtxCreate (& user_ctx , 0 , params -> cu_dev ));
510+ #endif
499511
500512 alloc_mem (params , & alloc_mem_send , & alloc_mem_recv );
501513
0 commit comments