@@ -93,9 +93,6 @@ def basicStreamOrderedAllocation(dev, nelem, a, b, c):
9393 errorNorm = math .sqrt (errorNorm )
9494 refNorm = math .sqrt (refNorm )
9595
96- if errorNorm / refNorm < 1.0e-6 :
97- print ("basicStreamOrderedAllocation PASSED" )
98-
9996 checkCudaErrors (cudart .cudaStreamDestroy (stream ))
10097
10198 return errorNorm / refNorm < 1.0e-6
@@ -189,25 +186,23 @@ def streamOrderedAllocationPostSync(dev, nelem, a, b, c):
189186 errorNorm = math .sqrt (errorNorm )
190187 refNorm = math .sqrt (refNorm )
191188
192- if errorNorm / refNorm < 1.0e-6 :
193- print ("streamOrderedAllocationPostSync PASSED" )
194-
195189 checkCudaErrors (cudart .cudaStreamDestroy (stream ))
196190
197191 return errorNorm / refNorm < 1.0e-6
198192
199193
200194def main ():
195+ import pytest
196+
201197 if platform .system () == "Darwin" :
202- print ("streamOrderedAllocation is not supported on Mac OSX - waiving sample" )
203- return
198+ pytest .skip ("streamOrderedAllocation is not supported on Mac OSX" )
204199
205200 cuda .cuInit (0 )
206201 if checkCmdLineFlag ("help" ):
207- print ("Usage: streamOrderedAllocation [OPTION]\n " )
208- print ("Options:" )
209- print (" device=[device #] Specify the device to be used" )
210- return
202+ print ("Usage: streamOrderedAllocation [OPTION]\n " , file = sys . stderr )
203+ print ("Options:" , file = sys . stderr )
204+ print (" device=[device #] Specify the device to be used" , file = sys . stderr )
205+ sys . exit ( 1 )
211206
212207 dev = findCudaDevice ()
213208
@@ -219,8 +214,7 @@ def main():
219214 cudart .cudaDeviceGetAttribute (cuda .CUdevice_attribute .CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED , dev )
220215 )
221216 if not isMemPoolSupported :
222- print ("Waiving execution as device does not support Memory Pools" )
223- return
217+ pytest .skip ("Waiving execution as device does not support Memory Pools" )
224218
225219 global _vectorAddGPU
226220 kernelHelper = common .KernelHelper (streamOrderedAllocation , dev )
@@ -242,7 +236,7 @@ def main():
242236 ret2 = streamOrderedAllocationPostSync (dev , nelem , a , b , c )
243237
244238 if not ret1 or not ret2 :
245- sys .exit (- 1 )
239+ sys .exit (1 )
246240
247241
248242if __name__ == "__main__" :
0 commit comments