We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0e6f927 commit 0e28aa1Copy full SHA for 0e28aa1
cuda_core/cuda/core/experimental/_device.pyx
@@ -2,6 +2,7 @@
2
#
3
# SPDX-License-Identifier: Apache-2.0
4
5
+cimport cpython
6
from libc.stdint cimport uintptr_t
7
8
from cuda.bindings cimport cydriver
@@ -1083,8 +1084,7 @@ class Device:
1083
1084
HANDLE_RETURN(cydriver.cuDeviceGetUuid_v2(&uuid, self._id))
1085
ELSE: # 13.0+
1086
HANDLE_RETURN(cydriver.cuDeviceGetUuid(&uuid, self._id))
- cdef bytearray uuid_b = bytearray(sizeof(uuid.bytes))
1087
- uuid_b[:] = uuid.bytes
+ cdef bytes uuid_b = cpython.PyBytes_FromStringAndSize(uuid.bytes, sizeof(uuid.bytes))
1088
cdef str uuid_hex = uuid_b.hex()
1089
# 8-4-4-4-12
1090
return f"{uuid_hex[:8]}-{uuid_hex[8:12]}-{uuid_hex[12:16]}-{uuid_hex[16:20]}-{uuid_hex[20:]}"
0 commit comments