Skip to content

Backport gh-2066 #2069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# CMake build and local install directory
_skbuild
build_cython
cython_debug
dpnp.egg-info

# Byte-compiled / optimized / DLL files
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ In addition, this release completes implementation of `dpnp.fft` module and adds
* 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)
* Fixed a crash in `dpnp.choose` caused by missing control of releasing temporary allocated device memory [#2063](https://github.com/IntelPython/dpnp/pull/2063)
* Resolve compilation warning and error while building in debug mode [#2066](https://github.com/IntelPython/dpnp/pull/2066)


## [0.15.0] - 05/25/2024
Expand Down
3 changes: 2 additions & 1 deletion dpnp/backend/kernels/dpnp_krnl_random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
25 changes: 24 additions & 1 deletion dpnp/backend/src/queue_sycl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<sycl::device> devices = sycl::device::get_devices();
Expand All @@ -69,7 +92,7 @@
// it->has(sycl::aspect::usm_shared_allocations) << " "
<< " - id=" << it->get_info<sycl::info::device::vendor_id>()
<< ", type="
<< static_cast<pi_uint64>(
<< device_type_to_str(
it->get_info<sycl::info::device::device_type>())
<< ", gws="
<< it->get_info<sycl::info::device::max_work_group_size>()
Expand Down
Loading