File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,11 +380,12 @@ cdef class _HelperCUpointer_attribute:
380380 if self ._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,):
381381 return self ._ctx
382382 elif self ._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMORY_TYPE,
383- cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,
384383 cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES,
385384 cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE,
386385 cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_ACCESS_FLAGS,):
387386 return self ._uint
387+ elif self ._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL,):
388+ return self ._int
388389 elif self ._attr in (cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER,
389390 cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,):
390391 return self ._devptr
Original file line number Diff line number Diff line change @@ -456,12 +456,10 @@ def test_pointer_get_attributes_device_ordinal():
456456 cuda .CUpointer_attribute .CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL ,
457457 ]
458458
459- attrs = cuda .cuPointerGetAttributes (len (attributes ), attributes , 0 )
459+ err , attrs = cuda .cuPointerGetAttributes (len (attributes ), attributes , 0 )
460460
461- # device ordinals are always small numbers. A large number would indicate
462- # an overflow error.
463-
464- assert abs (attrs [1 ][0 ]) < 256
461+ assert err == cuda .CUresult .CUDA_SUCCESS
462+ assert attrs == [cuda .CU_DEVICE_INVALID ]
465463
466464
467465@pytest .mark .skipif (not supportsManagedMemory (), reason = "When new attributes were introduced" )
You can’t perform that action at this time.
0 commit comments