diff --git a/README.md b/README.md index 8a7333056e..00a5dd60b9 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Distribution for Python](https://www.intel.com/content/www/us/en/developer/tools/oneapi/distribution-for-python.html) (IDP). -## Inte(R) oneAPI +## Intel(R) oneAPI You can find the most recent release of `dpctl` every quarter as part of the Intel(R) oneAPI releases. diff --git a/dpctl/apis/include/dpctl_capi.h b/dpctl/apis/include/dpctl_capi.h index 39211564a0..8eb3fba281 100644 --- a/dpctl/apis/include/dpctl_capi.h +++ b/dpctl/apis/include/dpctl_capi.h @@ -28,7 +28,11 @@ // Ordering of includes is important here. dpctl_sycl_types defines types // used by dpctl's Python C-API headers. #include "syclinterface/dpctl_sycl_types.h" +#ifdef __cplusplus #define CYTHON_EXTERN_C extern "C" +#else +#define CYTHON_EXTERN_C +#endif #include "../_sycl_device.h" #include "../_sycl_device_api.h" #include "../_sycl_context.h" diff --git a/dpctl/tests/test_usm_ndarray_dlpack.py b/dpctl/tests/test_usm_ndarray_dlpack.py index c82a27807c..a6d7eab975 100644 --- a/dpctl/tests/test_usm_ndarray_dlpack.py +++ b/dpctl/tests/test_usm_ndarray_dlpack.py @@ -127,9 +127,11 @@ def test_from_dlpack(shape, typestr, usm_type): Y = dpt.from_dlpack(X) assert X.shape == Y.shape assert X.dtype == Y.dtype - assert X.sycl_device == Y.sycl_device assert X.usm_type == Y.usm_type assert X._pointer == Y._pointer + # we can only expect device to round-trip for USM-device and + # USM-shared allocations, which are made for specific device + assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device) if Y.ndim: V = Y[::-1] W = dpt.from_dlpack(V) @@ -149,9 +151,11 @@ def test_from_dlpack_strides(mod, typestr, usm_type): Y = dpt.from_dlpack(X) assert X.shape == Y.shape assert X.dtype == Y.dtype - assert X.sycl_device == Y.sycl_device assert X.usm_type == Y.usm_type assert X._pointer == Y._pointer + # we can only expect device to round-trip for USM-device and + # USM-shared allocations, which are made for specific device + assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device) if Y.ndim: V = Y[::-1] W = dpt.from_dlpack(V)