From e292fb9d291cc113ed19a5c11f5df7cc554e7c95 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 16 Apr 2026 05:02:42 -0700 Subject: [PATCH 1/2] Use dpctl_capi.h header in dpnp4pybind11.hpp --- dpnp/backend/include/dpnp4pybind11.hpp | 36 ++++---------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/dpnp/backend/include/dpnp4pybind11.hpp b/dpnp/backend/include/dpnp4pybind11.hpp index 896ff20873a..8bc931a3ca1 100644 --- a/dpnp/backend/include/dpnp4pybind11.hpp +++ b/dpnp/backend/include/dpnp4pybind11.hpp @@ -28,29 +28,8 @@ #pragma once -// Include dpctl SYCL interface from external dpctl package -#include "syclinterface/dpctl_sycl_extension_interface.h" -#include "syclinterface/dpctl_sycl_types.h" - -#ifdef __cplusplus -#define CYTHON_EXTERN_C extern "C" -#else -#define CYTHON_EXTERN_C -#endif - -// Include dpctl C-API headers (both declarations and import functions) -#include "dpctl/_sycl_context.h" -#include "dpctl/_sycl_context_api.h" -#include "dpctl/_sycl_device.h" -#include "dpctl/_sycl_device_api.h" -#include "dpctl/_sycl_event.h" -#include "dpctl/_sycl_event_api.h" -#include "dpctl/_sycl_queue.h" -#include "dpctl/_sycl_queue_api.h" -#include "dpctl/memory/_memory.h" -#include "dpctl/memory/_memory_api.h" -#include "dpctl/program/_program.h" -#include "dpctl/program/_program_api.h" +// Include dpctl C-API headers +#include "dpctl_capi.h" // Include generated Cython headers for usm_ndarray // (struct definition and constants only) @@ -253,14 +232,9 @@ class dpctl_capi default_usm_memory_{}, default_usm_ndarray_{}, as_usm_memory_{} { - // Import dpctl SYCL interface modules - // This imports python modules and initializes pointers to Python types - import_dpctl___sycl_device(); - import_dpctl___sycl_context(); - import_dpctl___sycl_event(); - import_dpctl___sycl_queue(); - import_dpctl__memory___memory(); - import_dpctl__program___program(); + // Import dpctl C-API + // (device, context, event, queue, memory, program) + import_dpctl(); // Import dpnp tensor module for PyUSMArrayType import_dpnp__tensor___usmarray(); From f44023d832d30ffb7b04430797e05ba2ff7f9e82 Mon Sep 17 00:00:00 2001 From: Vladislav Perevezentsev Date: Thu, 16 Apr 2026 05:23:02 -0700 Subject: [PATCH 2/2] Fix RuntimeWarning filter in test_exp_complex_contig --- dpnp/tests/tensor/elementwise/test_exp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpnp/tests/tensor/elementwise/test_exp.py b/dpnp/tests/tensor/elementwise/test_exp.py index 5ff2d05fbd8..ca204128317 100644 --- a/dpnp/tests/tensor/elementwise/test_exp.py +++ b/dpnp/tests/tensor/elementwise/test_exp.py @@ -78,7 +78,7 @@ def test_exp_real_contig(dtype): assert_allclose(dpt.asnumpy(Z), np.repeat(Ynp, n_rep), atol=tol, rtol=tol) -@pytest.mark.filterwarnings("ignore:overflow encountered:RuntimeWarning") +@pytest.mark.filterwarnings("ignore::RuntimeWarning") @pytest.mark.parametrize("dtype", ["c8", "c16"]) def test_exp_complex_contig(dtype): q = get_queue_or_skip()