5
5
# this software. Any use, reproduction, disclosure, or distribution of
6
6
# this software and related documentation outside the terms of the EULA
7
7
# is strictly prohibited.
8
+ import os
8
9
import platform
9
10
import shutil
10
11
import textwrap
@@ -83,6 +84,10 @@ def test_cuda_memcpy():
83
84
assert err == cuda .CUresult .CUDA_SUCCESS
84
85
85
86
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
+ )
86
91
def test_cuda_array ():
87
92
(err ,) = cuda .cuInit (0 )
88
93
assert err == cuda .CUresult .CUDA_SUCCESS
@@ -236,6 +241,10 @@ def test_cuda_uuid_list_access():
236
241
assert err == cuda .CUresult .CUDA_SUCCESS
237
242
238
243
244
+ @pytest .mark .skipif (
245
+ os .environ .get ("CUDA_PYTHON_SANITIZER_RUNNING" , "0" ) == "1" ,
246
+ reason = "FIXME: This test causes an API error." ,
247
+ )
239
248
def test_cuda_cuModuleLoadDataEx ():
240
249
(err ,) = cuda .cuInit (0 )
241
250
assert err == cuda .CUresult .CUDA_SUCCESS
@@ -251,6 +260,7 @@ def test_cuda_cuModuleLoadDataEx():
251
260
cuda .CUjit_option .CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES ,
252
261
cuda .CUjit_option .CU_JIT_LOG_VERBOSE ,
253
262
]
263
+ # FIXME: This function call raises CUDA_ERROR_INVALID_VALUE
254
264
err , mod = cuda .cuModuleLoadDataEx (0 , 0 , option_keys , [])
255
265
256
266
(err ,) = cuda .cuCtxDestroy (ctx )
@@ -622,6 +632,10 @@ def test_cuda_coredump_attr():
622
632
assert err == cuda .CUresult .CUDA_SUCCESS
623
633
624
634
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
+ )
625
639
def test_get_error_name_and_string ():
626
640
(err ,) = cuda .cuInit (0 )
627
641
assert err == cuda .CUresult .CUDA_SUCCESS
@@ -950,6 +964,10 @@ def test_CUmemDecompressParams_st():
950
964
assert int (desc .dstActBytes ) == 0
951
965
952
966
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
+ )
953
971
def test_all_CUresult_codes ():
954
972
max_code = int (max (cuda .CUresult ))
955
973
# Smoke test. CUDA_ERROR_UNKNOWN = 999, but intentionally using literal value.
@@ -982,12 +1000,20 @@ def test_all_CUresult_codes():
982
1000
assert num_good >= 76 # CTK 11.0.3_450.51.06
983
1001
984
1002
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
+ )
985
1007
def test_cuKernelGetName_failure ():
986
1008
err , name = cuda .cuKernelGetName (0 )
987
1009
assert err == cuda .CUresult .CUDA_ERROR_INVALID_VALUE
988
1010
assert name is None
989
1011
990
1012
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
+ )
991
1017
def test_cuFuncGetName_failure ():
992
1018
err , name = cuda .cuFuncGetName (0 )
993
1019
assert err == cuda .CUresult .CUDA_ERROR_INVALID_VALUE
0 commit comments