Skip to content

Commit 45ba570

Browse files
vtavanaantonwolfy
andauthored
Resolve compilation failure in debug build (#2066) (#2069)
* Resolve compilation failure in debug build * Update changelog --------- Co-authored-by: Anton <[email protected]>
1 parent e43b050 commit 45ba570

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CMake build and local install directory
22
_skbuild
33
build_cython
4+
cython_debug
45
dpnp.egg-info
56

67
# Byte-compiled / optimized / DLL files

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
114114
* Resolved an issue with input array of `usm_ndarray` passed into `dpnp.ix_` [#2047](https://github.com/IntelPython/dpnp/pull/2047)
115115
* 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)
116116
* Fixed a crash in `dpnp.choose` caused by missing control of releasing temporary allocated device memory [#2063](https://github.com/IntelPython/dpnp/pull/2063)
117+
* Resolve compilation warning and error while building in debug mode [#2066](https://github.com/IntelPython/dpnp/pull/2066)
117118

118119

119120
## [0.15.0] - 05/25/2024

dpnp/backend/kernels/dpnp_krnl_random.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,8 @@ DPCTLSyclEventRef
25532553

25542554
const _DataType d_zero = 0.0, d_one = 1.0;
25552555

2556-
assert(0. < kappa <= 1.0);
2556+
assert(0. < kappa);
2557+
assert(kappa <= 1.0);
25572558

25582559
r = 1 + sqrt(1 + 4 * kappa * kappa);
25592560
rho_over_kappa = (2) / (r + sqrt(2 * r));

dpnp/backend/src/queue_sycl.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,29 @@
5656
}
5757

5858
#if (not defined(NDEBUG))
59+
[[maybe_unused]] static std::string
60+
device_type_to_str(sycl::info::device_type devTy)
61+
{
62+
std::stringstream ss;
63+
switch (devTy) {
64+
case sycl::info::device_type::cpu:
65+
ss << "cpu";
66+
break;
67+
case sycl::info::device_type::gpu:
68+
ss << "gpu";
69+
break;
70+
case sycl::info::device_type::accelerator:
71+
ss << "accelerator";
72+
break;
73+
case sycl::info::device_type::custom:
74+
ss << "custom";
75+
break;
76+
default:
77+
ss << "unknown";
78+
}
79+
return ss.str();
80+
}
81+
5982
[[maybe_unused]] static void show_available_sycl_devices()
6083
{
6184
const std::vector<sycl::device> devices = sycl::device::get_devices();
@@ -69,7 +92,7 @@
6992
// it->has(sycl::aspect::usm_shared_allocations) << " "
7093
<< " - id=" << it->get_info<sycl::info::device::vendor_id>()
7194
<< ", type="
72-
<< static_cast<pi_uint64>(
95+
<< device_type_to_str(
7396
it->get_info<sycl::info::device::device_type>())
7497
<< ", gws="
7598
<< it->get_info<sycl::info::device::max_work_group_size>()

0 commit comments

Comments
 (0)