Skip to content

Commit 50435a6

Browse files
[SYCL] Deprecate Intel extension ctz function (#5333)
ctz function is added to the core SYCL specification. Added a test for fixed issue (changed namespace for ctz function).
1 parent a2189c6 commit 50435a6

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

sycl/include/CL/sycl/builtins.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,10 @@ detail::enable_if_t<detail::is_geninteger<T>::value, T> ctz(T x) __NOEXC {
734734
namespace ext {
735735
namespace intel {
736736
template <typename T>
737-
sycl::detail::enable_if_t<sycl::detail::is_geninteger<T>::value, T>
738-
ctz(T x) __NOEXC {
737+
__SYCL_DEPRECATED(
738+
"'sycl::ext::intel::ctz' is deprecated, use 'sycl::ctz' instead")
739+
sycl::detail::enable_if_t<sycl::detail::is_geninteger<T>::value, T> ctz(
740+
T x) __NOEXC {
739741
return sycl::ctz(x);
740742
}
741743
} // namespace intel
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
2+
3+
#include <sycl/sycl.hpp>
4+
5+
int main() {
6+
7+
long long int a = -9223372034707292160ll;
8+
long long int b = sycl::ctz(a);
9+
// expected-warning@+1 {{'ctz<long long>' is deprecated: 'sycl::ext::intel::ctz' is deprecated, use 'sycl::ctz' instead}}
10+
long long int c = sycl::ext::intel::ctz(a);
11+
12+
return 0;
13+
}

0 commit comments

Comments
 (0)