@@ -405,15 +405,16 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied):
405
405
if pDRef is not NULL :
406
406
DPCTLDevice_Delete(pDRef)
407
407
raise DLPackCreationError(
408
- " to_dlpack_capsule : DLPack can only export arrays allocated "
409
- " on non-partitioned SYCL devices on platforms where "
410
- " default_context oneAPI extension is not supported."
408
+ " to_dlpack_versioned_capsule : DLPack can only export arrays "
409
+ " allocated on non-partitioned SYCL devices on platforms "
410
+ " where default_context oneAPI extension is not supported."
411
411
)
412
412
else :
413
413
if not usm_ary.sycl_context == default_context:
414
414
raise DLPackCreationError(
415
- " to_dlpack_capsule: DLPack can only export arrays based on USM "
416
- " allocations bound to a default platform SYCL context"
415
+ " to_dlpack_versioned_capsule: DLPack can only export arrays "
416
+ " based on USM allocations bound to a default platform SYCL "
417
+ " context"
417
418
)
418
419
# Find the unpartitioned parent of the allocation device
419
420
pDRef = DPCTLDevice_GetParentDevice(ary_sycl_device.get_device_ref())
@@ -429,20 +430,22 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied):
429
430
device_id = ary_sycl_device.get_overall_ordinal()
430
431
if device_id < 0 :
431
432
raise DLPackCreationError(
432
- " to_dlpack_capsule : failed to determine device_id"
433
+ " to_dlpack_versioned_capsule : failed to determine device_id"
433
434
)
434
435
435
436
dlmv_tensor = < DLManagedTensorVersioned * > stdlib.malloc(
436
437
sizeof(DLManagedTensorVersioned))
437
438
if dlmv_tensor is NULL :
438
439
raise MemoryError (
439
- " to_dlpack_capsule: Could not allocate memory for DLManagedTensorVersioned"
440
+ " to_dlpack_versioned_capsule: Could not allocate memory "
441
+ " for DLManagedTensorVersioned"
440
442
)
441
443
shape_strides_ptr = < int64_t * > stdlib.malloc((sizeof(int64_t) * 2 ) * nd)
442
444
if shape_strides_ptr is NULL :
443
445
stdlib.free(dlmv_tensor)
444
446
raise MemoryError (
445
- " to_dlpack_capsule: Could not allocate memory for shape/strides"
447
+ " to_dlpack_versioned_capsule: Could not allocate memory "
448
+ " for shape/strides"
446
449
)
447
450
# this can be a separate function for handling shapes and strides
448
451
shape_ptr = usm_ary.get_shape()
@@ -538,7 +541,7 @@ cdef class _DLManagedTensorOwner:
538
541
cdef class _DLManagedTensorVersionedOwner:
539
542
"""
540
543
Helper class managing the lifetime of the DLManagedTensorVersioned
541
- struct transferred from a 'dlpack ' capsule.
544
+ struct transferred from a 'dlpack_versioned ' capsule.
542
545
"""
543
546
cdef DLManagedTensorVersioned * dlmv_tensor
544
547
0 commit comments