55# this software. Any use, reproduction, disclosure, or distribution of
66# this software and related documentation outside the terms of the EULA
77# is strictly prohibited.
8+ import os
89import platform
910import shutil
1011import textwrap
@@ -83,6 +84,10 @@ def test_cuda_memcpy():
8384 assert err == cuda .CUresult .CUDA_SUCCESS
8485
8586
87+ @pytest .mark .skipif (
88+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
89+ reason = "The compute-sanitzer is running, and this test intentionally causes an API error." ,
90+ )
8691def test_cuda_array ():
8792 (err ,) = cuda .cuInit (0 )
8893 assert err == cuda .CUresult .CUDA_SUCCESS
@@ -236,6 +241,10 @@ def test_cuda_uuid_list_access():
236241 assert err == cuda .CUresult .CUDA_SUCCESS
237242
238243
244+ @pytest .mark .skipif (
245+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
246+ reason = "FIXME: This test causes an API error." ,
247+ )
239248def test_cuda_cuModuleLoadDataEx ():
240249 (err ,) = cuda .cuInit (0 )
241250 assert err == cuda .CUresult .CUDA_SUCCESS
@@ -251,6 +260,7 @@ def test_cuda_cuModuleLoadDataEx():
251260 cuda .CUjit_option .CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES ,
252261 cuda .CUjit_option .CU_JIT_LOG_VERBOSE ,
253262 ]
263+ # FIXME: This function call raises CUDA_ERROR_INVALID_VALUE
254264 err , mod = cuda .cuModuleLoadDataEx (0 , 0 , option_keys , [])
255265
256266 (err ,) = cuda .cuCtxDestroy (ctx )
@@ -622,6 +632,10 @@ def test_cuda_coredump_attr():
622632 assert err == cuda .CUresult .CUDA_SUCCESS
623633
624634
635+ @pytest .mark .skipif (
636+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
637+ reason = "The compute-sanitzer is running, and this test intentionally causes an API error." ,
638+ )
625639def test_get_error_name_and_string ():
626640 (err ,) = cuda .cuInit (0 )
627641 assert err == cuda .CUresult .CUDA_SUCCESS
@@ -950,6 +964,10 @@ def test_CUmemDecompressParams_st():
950964 assert int (desc .dstActBytes ) == 0
951965
952966
967+ @pytest .mark .skipif (
968+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
969+ reason = "The compute-sanitzer is running, and this test intentionally causes an API error." ,
970+ )
953971def test_all_CUresult_codes ():
954972 max_code = int (max (cuda .CUresult ))
955973 # Smoke test. CUDA_ERROR_UNKNOWN = 999, but intentionally using literal value.
@@ -982,12 +1000,20 @@ def test_all_CUresult_codes():
9821000 assert num_good >= 76 # CTK 11.0.3_450.51.06
9831001
9841002
1003+ @pytest .mark .skipif (
1004+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
1005+ reason = "The compute-sanitzer is running, and this test intentionally causes an API error." ,
1006+ )
9851007def test_cuKernelGetName_failure ():
9861008 err , name = cuda .cuKernelGetName (0 )
9871009 assert err == cuda .CUresult .CUDA_ERROR_INVALID_VALUE
9881010 assert name is None
9891011
9901012
1013+ @pytest .mark .skipif (
1014+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
1015+ reason = "The compute-sanitzer is running, and this test intentionally causes an API error." ,
1016+ )
9911017def test_cuFuncGetName_failure ():
9921018 err , name = cuda .cuFuncGetName (0 )
9931019 assert err == cuda .CUresult .CUDA_ERROR_INVALID_VALUE
0 commit comments