@@ -397,15 +397,16 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied):
397
397
if pDRef is not NULL :
398
398
DPCTLDevice_Delete(pDRef)
399
399
raise DLPackCreationError(
400
- " to_dlpack_capsule : DLPack can only export arrays allocated "
401
- " on non-partitioned SYCL devices on platforms where "
402
- " default_context oneAPI extension is not supported."
400
+ " to_dlpack_versioned_capsule : DLPack can only export arrays "
401
+ " allocated on non-partitioned SYCL devices on platforms "
402
+ " where default_context oneAPI extension is not supported."
403
403
)
404
404
else :
405
405
if not usm_ary.sycl_context == default_context:
406
406
raise DLPackCreationError(
407
- " to_dlpack_capsule: DLPack can only export arrays based on USM "
408
- " allocations bound to a default platform SYCL context"
407
+ " to_dlpack_versioned_capsule: DLPack can only export arrays "
408
+ " based on USM allocations bound to a default platform SYCL "
409
+ " context"
409
410
)
410
411
# Find the unpartitioned parent of the allocation device
411
412
pDRef = DPCTLDevice_GetParentDevice(ary_sycl_device.get_device_ref())
@@ -421,20 +422,22 @@ cpdef to_dlpack_versioned_capsule(usm_ndarray usm_ary, bint copied):
421
422
device_id = ary_sycl_device.get_overall_ordinal()
422
423
if device_id < 0 :
423
424
raise DLPackCreationError(
424
- " to_dlpack_capsule : failed to determine device_id"
425
+ " to_dlpack_versioned_capsule : failed to determine device_id"
425
426
)
426
427
427
428
dlmv_tensor = < DLManagedTensorVersioned * > stdlib.malloc(
428
429
sizeof(DLManagedTensorVersioned))
429
430
if dlmv_tensor is NULL :
430
431
raise MemoryError (
431
- " to_dlpack_capsule: Could not allocate memory for DLManagedTensorVersioned"
432
+ " to_dlpack_versioned_capsule: Could not allocate memory "
433
+ " for DLManagedTensorVersioned"
432
434
)
433
435
shape_strides_ptr = < int64_t * > stdlib.malloc((sizeof(int64_t) * 2 ) * nd)
434
436
if shape_strides_ptr is NULL :
435
437
stdlib.free(dlmv_tensor)
436
438
raise MemoryError (
437
- " to_dlpack_capsule: Could not allocate memory for shape/strides"
439
+ " to_dlpack_versioned_capsule: Could not allocate memory "
440
+ " for shape/strides"
438
441
)
439
442
# this can be a separate function for handling shapes and strides
440
443
shape_ptr = usm_ary.get_shape()
@@ -530,7 +533,7 @@ cdef class _DLManagedTensorOwner:
530
533
cdef class _DLManagedTensorVersionedOwner:
531
534
"""
532
535
Helper class managing the lifetime of the DLManagedTensorVersioned
533
- struct transferred from a 'dlpack ' capsule.
536
+ struct transferred from a 'dlpack_versioned ' capsule.
534
537
"""
535
538
cdef DLManagedTensorVersioned * dlmv_tensor
536
539
0 commit comments