Browse Source

CUDA: Update CUDA tests to handle CUDA 13 deprecations

Robert Maynard 10 months ago
parent
commit
3ff777de12

+ 7 - 0
Tests/CudaOnly/CUBIN/main.cu

@@ -36,7 +36,14 @@ int main()
   cuDeviceGet(&device, 0);
 
   CUcontext context;
+#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 13
+  CUctxCreateParams params;
+  params.execAffinityParams = nullptr;
+  params.numExecAffinityParams = 0;
+  cuCtxCreate(&context, &params, 0, device);
+#else
   cuCtxCreate(&context, 0, device);
+#endif
 
   CUmodule module;
   for (auto p : actual_paths) {

+ 7 - 1
Tests/CudaOnly/Fatbin/main.cu

@@ -36,8 +36,14 @@ int main()
   cuDeviceGet(&device, 0);
 
   CUcontext context;
+#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 13
+  CUctxCreateParams params;
+  params.execAffinityParams = nullptr;
+  params.numExecAffinityParams = 0;
+  cuCtxCreate(&context, &params, 0, device);
+#else
   cuCtxCreate(&context, 0, device);
-
+#endif
   CUmodule module;
   for (auto p : actual_paths) {
     if (p.find(".fatbin") == std::string::npos) {

+ 7 - 0
Tests/CudaOnly/SeparateCompilationPTX/main.cu

@@ -18,7 +18,14 @@ int main()
   cuDeviceGet(&device, 0);
 
   CUcontext context;
+#if defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ >= 13
+  CUctxCreateParams params;
+  params.execAffinityParams = nullptr;
+  params.numExecAffinityParams = 0;
+  cuCtxCreate(&context, &params, 0, device);
+#else
   cuCtxCreate(&context, 0, device);
+#endif
 
   CUmodule module;
   CUresult result = cuModuleLoadData(&module, kernels);