Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cuda_core/cuda/core/_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ cdef class DeviceProperties:
cdef inline _get_attribute(self, cydriver.CUdevice_attribute attr):
"""Retrieve the attribute value directly from the driver."""
cdef int val
cdef cydriver.CUresult err
with nogil:
HANDLE_RETURN(cydriver.cuDeviceGetAttribute(&val, attr, self._handle))
err = cydriver.cuDeviceGetAttribute(&val, attr, self._handle)
if err == cydriver.CUresult.CUDA_ERROR_INVALID_VALUE:
return 0
HANDLE_RETURN(err)
return val

cdef _get_cached_attribute(self, attr):
Expand Down
Loading