Skip to content

Commit 2151275

Browse files
committed
support the older Intel compiler than 2026.0
1 parent fa1e817 commit 2151275

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ggml/src/ggml-sycl/element_wise.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ static __dpct_inline__ T op_elu(T x) {
7272
template<typename T>
7373
static __dpct_inline__ T op_tanh(T x) {
7474
if constexpr (std::is_same_v<T, sycl::ext::oneapi::bfloat16>) {
75-
return sycl::ext::oneapi::experimental::tanh(x);
75+
constexpr int ver = __INTEL_LLVM_COMPILER;
76+
#if defined(__INTEL_LLVM_COMPILER) && (__INTEL_LLVM_COMPILER >= 20260000)
77+
return sycl::ext::oneapi::experimental::tanh(x);
78+
#else
79+
return static_cast<T>(sycl::tanh(static_cast<float>(x)));
80+
#endif
7681
} else {
7782
return sycl::tanh(x);
7883
}

0 commit comments

Comments
 (0)