Skip to content

Commit 0e28aa1

Browse files
committed
fix uuid handling, again
1 parent 0e6f927 commit 0e28aa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cuda_core/cuda/core/experimental/_device.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
cimport cpython
56
from libc.stdint cimport uintptr_t
67

78
from cuda.bindings cimport cydriver
@@ -1083,8 +1084,7 @@ class Device:
10831084
HANDLE_RETURN(cydriver.cuDeviceGetUuid_v2(&uuid, self._id))
10841085
ELSE: # 13.0+
10851086
HANDLE_RETURN(cydriver.cuDeviceGetUuid(&uuid, self._id))
1086-
cdef bytearray uuid_b = bytearray(sizeof(uuid.bytes))
1087-
uuid_b[:] = uuid.bytes
1087+
cdef bytes uuid_b = cpython.PyBytes_FromStringAndSize(uuid.bytes, sizeof(uuid.bytes))
10881088
cdef str uuid_hex = uuid_b.hex()
10891089
# 8-4-4-4-12
10901090
return f"{uuid_hex[:8]}-{uuid_hex[8:12]}-{uuid_hex[12:16]}-{uuid_hex[16:20]}-{uuid_hex[20:]}"

0 commit comments

Comments
 (0)