Skip to content

Commit c52ed2e

Browse files
committed
Merge branch 'master' into take_along_axis
2 parents 500691b + 9792685 commit c52ed2e

File tree

3 files changed

+22
-33
lines changed

3 files changed

+22
-33
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This release achieves 100% compliance with Python Array API specification (revis
2828
* Updated Python Array API specification version supported to `2024.12` [#2416](https://github.com/IntelPython/dpnp/pull/2416)
2929
* Removed `einsum_call` keyword from `dpnp.einsum_path` signature [#2421](https://github.com/IntelPython/dpnp/pull/2421)
3030
* Changed `"max dimensions"` to `None` in array API capabilities [#2432](https://github.com/IntelPython/dpnp/pull/2432)
31+
* Updated kernel header `i0.hpp` to expose `cyl_bessel_i0` function depending on build target [#2440](https://github.com/IntelPython/dpnp/pull/2440)
3132
* The parameter `axis` in `dpnp.take_along_axis` function has now a default value of `-1` [#2442](https://github.com/IntelPython/dpnp/pull/2442)
3233

3334
### Fixed

dpnp/backend/extensions/window/kaiser.cpp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,6 @@
3232

3333
#include <sycl/sycl.hpp>
3434

35-
/**
36-
* Version of SYCL DPC++ 2025.1 compiler where an issue with
37-
* sycl::ext::intel::math::cyl_bessel_i0(x) is fully resolved.
38-
*/
39-
#ifndef __SYCL_COMPILER_BESSEL_I0_SUPPORT
40-
#define __SYCL_COMPILER_BESSEL_I0_SUPPORT 20241208L
41-
#endif
42-
43-
// Include <sycl/ext/intel/math.hpp> only when targeting Intel devices.
44-
// This header relies on intel-specific types like _iml_half_internal,
45-
// which are not supported on non-intel backends (e.g., CUDA, AMD)
46-
#if defined(__SPIR__) && defined(__INTEL_LLVM_COMPILER) && \
47-
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
48-
#include <sycl/ext/intel/math.hpp>
49-
#endif
50-
5135
#include "../kernels/elementwise_functions/i0.hpp"
5236

5337
namespace dpnp::extensions::window
@@ -78,12 +62,7 @@ class KaiserFunctor
7862

7963
void operator()(sycl::id<1> id) const
8064
{
81-
#if defined(__SPIR__) && defined(__INTEL_LLVM_COMPILER) && \
82-
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
83-
using sycl::ext::intel::math::cyl_bessel_i0;
84-
#else
85-
using dpnp::kernels::i0::impl::cyl_bessel_i0;
86-
#endif
65+
using dpnp::kernels::i0::cyl_bessel_i0;
8766

8867
const auto i = id.get(0);
8968
const T alpha = (N - 1) / T(2);

dpnp/backend/kernels/elementwise_functions/i0.hpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,28 @@
3535
#define __SYCL_COMPILER_BESSEL_I0_SUPPORT 20241208L
3636
#endif
3737

38-
// Include <sycl/ext/intel/math.hpp> only when targeting Intel devices.
39-
// This header relies on intel-specific types like _iml_half_internal,
40-
// which are not supported on non-intel backends (e.g., CUDA, AMD)
41-
#if defined(__SPIR__) && defined(__INTEL_LLVM_COMPILER) && \
38+
/**
39+
* Include <sycl/ext/intel/math.hpp> only when targeting to Intel devices.
40+
* This header relies on intel-specific types like _iml_half_internal,
41+
* which are not suppose to work with other targets (e.g., CUDA, AMD).
42+
*/
43+
#if defined(__SPIR__) && defined(__INTEL_LLVM_COMPILER)
44+
#define __SYCL_EXT_INTEL_MATH_SUPPORT
45+
#endif
46+
47+
#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) && \
4248
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
4349
#include <sycl/ext/intel/math.hpp>
4450
#endif
4551

4652
namespace dpnp::kernels::i0
4753
{
54+
#if defined(__SYCL_EXT_INTEL_MATH_SUPPORT) && \
55+
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
56+
using sycl::ext::intel::math::cyl_bessel_i0;
57+
58+
#else
59+
4860
/**
4961
* The below implementation of Bessel function of order 0
5062
* is based on the source code from https://github.com/gcc-mirror/gcc
@@ -243,6 +255,10 @@ inline Tp cyl_bessel_i0(Tp x)
243255
}
244256
} // namespace impl
245257

258+
using impl::cyl_bessel_i0;
259+
260+
#endif
261+
246262
template <typename argT, typename resT>
247263
struct I0Functor
248264
{
@@ -257,13 +273,6 @@ struct I0Functor
257273

258274
resT operator()(const argT &x) const
259275
{
260-
#if defined(__SPIR__) && defined(__INTEL_LLVM_COMPILER) && \
261-
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
262-
using sycl::ext::intel::math::cyl_bessel_i0;
263-
#else
264-
using impl::cyl_bessel_i0;
265-
#endif
266-
267276
if constexpr (std::is_same_v<resT, sycl::half>) {
268277
return static_cast<resT>(cyl_bessel_i0<float>(float(x)));
269278
}

0 commit comments

Comments
 (0)