Skip to content

Commit a53a7c1

Browse files
Merge pull request #1347 from IntelPython/master
Merging 0.14.6dev2.post0
2 parents 9e81f89 + aea6f7f commit a53a7c1

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Distribution for
4949
Python](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html)
5050
(IDP).
5151

52-
## Inte(R) oneAPI
52+
## Intel(R) oneAPI
5353

5454
You can find the most recent release of `dpctl` every quarter as part of the Intel(R) oneAPI releases.
5555

dpctl/apis/include/dpctl_capi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
// Ordering of includes is important here. dpctl_sycl_types defines types
2929
// used by dpctl's Python C-API headers.
3030
#include "syclinterface/dpctl_sycl_types.h"
31+
#ifdef __cplusplus
3132
#define CYTHON_EXTERN_C extern "C"
33+
#else
34+
#define CYTHON_EXTERN_C
35+
#endif
3236
#include "../_sycl_device.h"
3337
#include "../_sycl_device_api.h"
3438
#include "../_sycl_context.h"

dpctl/tests/test_usm_ndarray_dlpack.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ def test_from_dlpack(shape, typestr, usm_type):
127127
Y = dpt.from_dlpack(X)
128128
assert X.shape == Y.shape
129129
assert X.dtype == Y.dtype
130-
assert X.sycl_device == Y.sycl_device
131130
assert X.usm_type == Y.usm_type
132131
assert X._pointer == Y._pointer
132+
# we can only expect device to round-trip for USM-device and
133+
# USM-shared allocations, which are made for specific device
134+
assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device)
133135
if Y.ndim:
134136
V = Y[::-1]
135137
W = dpt.from_dlpack(V)
@@ -149,9 +151,11 @@ def test_from_dlpack_strides(mod, typestr, usm_type):
149151
Y = dpt.from_dlpack(X)
150152
assert X.shape == Y.shape
151153
assert X.dtype == Y.dtype
152-
assert X.sycl_device == Y.sycl_device
153154
assert X.usm_type == Y.usm_type
154155
assert X._pointer == Y._pointer
156+
# we can only expect device to round-trip for USM-device and
157+
# USM-shared allocations, which are made for specific device
158+
assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device)
155159
if Y.ndim:
156160
V = Y[::-1]
157161
W = dpt.from_dlpack(V)

0 commit comments

Comments
 (0)