From ee5d2f9fc170f074d1c695d27184e31e23e6c768 Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 19 Sep 2024 14:34:16 +0200 Subject: [PATCH 1/2] Resolve compilation failure in debug build --- .gitignore | 1 + dpnp/backend/kernels/dpnp_krnl_random.cpp | 3 ++- dpnp/backend/src/queue_sycl.cpp | 25 ++++++++++++++++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8beb38f1efd6..c263dae47818 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # CMake build and local install directory _skbuild build_cython +cython_debug dpnp.egg-info # Byte-compiled / optimized / DLL files diff --git a/dpnp/backend/kernels/dpnp_krnl_random.cpp b/dpnp/backend/kernels/dpnp_krnl_random.cpp index e7e05323ac8d..c0607279d0ce 100644 --- a/dpnp/backend/kernels/dpnp_krnl_random.cpp +++ b/dpnp/backend/kernels/dpnp_krnl_random.cpp @@ -2553,7 +2553,8 @@ DPCTLSyclEventRef const _DataType d_zero = 0.0, d_one = 1.0; - assert(0. < kappa <= 1.0); + assert(0. < kappa); + assert(kappa <= 1.0); r = 1 + sqrt(1 + 4 * kappa * kappa); rho_over_kappa = (2) / (r + sqrt(2 * r)); diff --git a/dpnp/backend/src/queue_sycl.cpp b/dpnp/backend/src/queue_sycl.cpp index 786752facd60..27b545c814f3 100644 --- a/dpnp/backend/src/queue_sycl.cpp +++ b/dpnp/backend/src/queue_sycl.cpp @@ -56,6 +56,29 @@ } #if (not defined(NDEBUG)) +[[maybe_unused]] static std::string + device_type_to_str(sycl::info::device_type devTy) +{ + std::stringstream ss; + switch (devTy) { + case sycl::info::device_type::cpu: + ss << "cpu"; + break; + case sycl::info::device_type::gpu: + ss << "gpu"; + break; + case sycl::info::device_type::accelerator: + ss << "accelerator"; + break; + case sycl::info::device_type::custom: + ss << "custom"; + break; + default: + ss << "unknown"; + } + return ss.str(); +} + [[maybe_unused]] static void show_available_sycl_devices() { const std::vector devices = sycl::device::get_devices(); @@ -69,7 +92,7 @@ // it->has(sycl::aspect::usm_shared_allocations) << " " << " - id=" << it->get_info() << ", type=" - << static_cast( + << device_type_to_str( it->get_info()) << ", gws=" << it->get_info() From dd83ebb7e76789ba8d8395ec1ef135d51f729dab Mon Sep 17 00:00:00 2001 From: Anton Volkov Date: Thu, 19 Sep 2024 14:37:31 +0200 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eab13988e8f..d3b15c087a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,6 +122,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds * Resolved an issue with failing tests for `dpnp.append` when running on a device without fp64 support [#2034](https://github.com/IntelPython/dpnp/pull/2034) * Resolved an issue with input array of `usm_ndarray` passed into `dpnp.ix_` [#2047](https://github.com/IntelPython/dpnp/pull/2047) * Added a workaround to prevent crash in tests on Windows in internal CI/CD (when running on either Lunar Lake or Arrow Lake) [#2062](https://github.com/IntelPython/dpnp/pull/2062) +* Resolve compilation warning and error while building in debug mode [#2066](https://github.com/IntelPython/dpnp/pull/2066) ## [0.15.0] - 05/25/2024