|
2 | 2 |
|
3 | 3 | cdef bint _valid_usm_ptr_and_context(DPCTLSyclUSMRef ptr, SyclContext ctx):
|
4 | 4 | usm_type = _Memory.get_pointer_type(ptr, ctx)
|
5 |
| - return usm_type in (b'shared', b'device', b'host') |
| 5 | + return usm_type in (b"shared", b"device", b"host") |
6 | 6 |
|
7 | 7 |
|
8 | 8 | cdef DPCTLSyclQueueRef _queue_ref_copy_from_SyclQueue(
|
@@ -49,7 +49,7 @@ cdef DPCTLSyclQueueRef get_queue_ref_from_ptr_and_syclobj(
|
49 | 49 | elif pycapsule.PyCapsule_IsValid(syclobj, "SyclContextRef"):
|
50 | 50 | ctx = <SyclContext>SyclContext(syclobj)
|
51 | 51 | return _queue_ref_copy_from_USMRef_and_SyclContext(ptr, ctx)
|
52 |
| - elif hasattr(syclobj, '_get_capsule'): |
| 52 | + elif hasattr(syclobj, "_get_capsule"): |
53 | 53 | cap = syclobj._get_capsule()
|
54 | 54 | if pycapsule.PyCapsule_IsValid(cap, "SyclQueueRef"):
|
55 | 55 | q = SyclQueue(cap)
|
@@ -166,8 +166,8 @@ cdef class _USMBufferData:
|
166 | 166 | nd = len(ary_shape)
|
167 | 167 | try:
|
168 | 168 | dt = np.dtype(ary_typestr)
|
169 |
| - if (dt.hasobject or not (np.issubdtype(dt.type, np.integer) or |
170 |
| - np.issubdtype(dt.type, np.inexact))): |
| 169 | + if (dt.hasobject or not (np.issubdtype(dt.type, np.number) or |
| 170 | + dt.type is np.bool_)): |
171 | 171 | DPCTLQueue_Delete(QRef)
|
172 | 172 | raise TypeError("Only integer types, floating and complex "
|
173 | 173 | "floating types are supported.")
|
|
0 commit comments