Skip to content

Commit e429dfa

Browse files
Avoid using sycl::ext::intel::math::cyl_bessel_i0 on CUDA
1 parent 2b30bab commit e429dfa

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

dpnp/backend/extensions/window/kaiser.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
#define __SYCL_COMPILER_BESSEL_I0_SUPPORT 20241208L
4141
#endif
4242

43-
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT
43+
// The <sycl/ext/intel/math.hpp> header and related types like
44+
// _iml_half_internal are not compatible with NVIDIA GPUs and cause compilation
45+
// errors when building with -fsycl-targets=nvptx64-nvidia-cuda.
46+
#if !defined(__NVPTX__) && \
47+
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
4448
#include <sycl/ext/intel/math.hpp>
4549
#endif
4650

@@ -74,7 +78,8 @@ class KaiserFunctor
7478

7579
void operator()(sycl::id<1> id) const
7680
{
77-
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT
81+
#if !defined(__NVPTX__) && \
82+
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
7883
using sycl::ext::intel::math::cyl_bessel_i0;
7984
#else
8085
using dpnp::kernels::i0::impl::cyl_bessel_i0;

dpnp/backend/kernels/elementwise_functions/i0.hpp

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

38-
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT
38+
// The <sycl/ext/intel/math.hpp> header and related types like
39+
// _iml_half_internal are not compatible with NVIDIA GPUs and cause compilation
40+
// errors when building with -fsycl-targets=nvptx64-nvidia-cuda.
41+
#if !defined(__NVPTX__) && \
42+
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
3943
#include <sycl/ext/intel/math.hpp>
4044
#endif
4145

@@ -253,7 +257,8 @@ struct I0Functor
253257

254258
resT operator()(const argT &x) const
255259
{
256-
#if __SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT
260+
#if !defined(__NVPTX__) && \
261+
(__SYCL_COMPILER_VERSION >= __SYCL_COMPILER_BESSEL_I0_SUPPORT)
257262
using sycl::ext::intel::math::cyl_bessel_i0;
258263
#else
259264
using impl::cyl_bessel_i0;

0 commit comments

Comments
 (0)