Skip to content

Commit 0a0afd5

Browse files
Fixed missing variable assignment
The example for multi-device context creation now works as expected: ```python Python 3.7.9 (default, Mar 10 2021, 05:18:00) Type 'copyright', 'credits' or 'license' for more information IPython 7.22.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: import dpctl In [2]: cpu_d = dpctl.SyclDevice("cpu") In [3]: d0, d1, d2 = cpu_d.create_sub_devices(partition=(4,4,4)) In [4]: ctx = dpctl.SyclContext((d0, d1, d2)) In [5]: ctx Out[5]: <dpctl.SyclContext for 3 devices at 0x7ffb7a82c350> In [6]: q = dpctl.SyclQueue(ctx, d0) In [7]: import dpctl.memory as dpmem In [8]: dpmem.MemoryUSMShared(1024, queue=q) Out[8]: <Intel(R) USM allocated memory block of 1024 bytes at 0x55e2e6bf4300> ```
1 parent a8acf7c commit 0a0afd5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dpctl/_sycl_context.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ cdef class SyclContext(_SyclContext):
141141
PyMem_Free(elems)
142142
else:
143143
return -2
144-
DPCTLContext_CreateFromDevices(DVRef, eh_callback, props)
144+
CRef = DPCTLContext_CreateFromDevices(DVRef, eh_callback, props)
145145
DPCTLDeviceVector_Delete(DVRef)
146146
if (CRef is NULL):
147147
return -1

0 commit comments

Comments
 (0)