Skip to content

Commit e0b8033

Browse files
committed
Move general language extensions to the ONEAPI namespace
Signed-off-by: James Brodman <[email protected]>
1 parent 4c57d4d commit e0b8033

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+531
-499
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,7 +2816,7 @@ bool Util::isSyclSpecConstantType(const QualType &Ty) {
28162816
std::array<DeclContextDesc, 4> Scopes = {
28172817
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "cl"},
28182818
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "sycl"},
2819-
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "experimental"},
2819+
Util::DeclContextDesc{clang::Decl::Kind::Namespace, "ONEAPI"},
28202820
Util::DeclContextDesc{Decl::Kind::ClassTemplateSpecialization, Name}};
28212821
return matchQualifiedTypeName(Ty, Scopes);
28222822
}

clang/test/CodeGenSYCL/Inputs/sycl.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ struct get_kernel_name_t<auto_name, Type> {
242242
using name = Type;
243243
};
244244

245-
namespace experimental {
245+
namespace ONEAPI {
246246
template <typename T, typename ID = T>
247247
class spec_constant {
248248
public:
@@ -256,7 +256,7 @@ class spec_constant {
256256
return get();
257257
}
258258
};
259-
} // namespace experimental
259+
} // namespace ONEAPI
260260

261261
#define ATTR_SYCL_KERNEL __attribute__((sycl_kernel))
262262
template <typename KernelName = auto_name, typename KernelType>

clang/test/CodeGenSYCL/int_header_spec_const.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ class MyDoubleConst;
2020

2121
int main() {
2222
// Create specialization constants.
23-
cl::sycl::experimental::spec_constant<bool, MyBoolConst> i1(false);
24-
cl::sycl::experimental::spec_constant<char, MyInt8Const> i8(0);
25-
cl::sycl::experimental::spec_constant<unsigned char, MyUInt8Const> ui8(0);
26-
cl::sycl::experimental::spec_constant<short, MyInt16Const> i16(0);
27-
cl::sycl::experimental::spec_constant<unsigned short, MyUInt16Const> ui16(0);
28-
cl::sycl::experimental::spec_constant<int, MyInt32Const> i32(0);
23+
cl::sycl::ONEAPI::spec_constant<bool, MyBoolConst> i1(false);
24+
cl::sycl::ONEAPI::spec_constant<char, MyInt8Const> i8(0);
25+
cl::sycl::ONEAPI::spec_constant<unsigned char, MyUInt8Const> ui8(0);
26+
cl::sycl::ONEAPI::spec_constant<short, MyInt16Const> i16(0);
27+
cl::sycl::ONEAPI::spec_constant<unsigned short, MyUInt16Const> ui16(0);
28+
cl::sycl::ONEAPI::spec_constant<int, MyInt32Const> i32(0);
2929
// Constant used twice, but there must be single entry in the int header,
3030
// otherwise compilation error would be issued.
31-
cl::sycl::experimental::spec_constant<int, MyInt32Const> i32_1(0);
32-
cl::sycl::experimental::spec_constant<unsigned int, MyUInt32Const> ui32(0);
33-
cl::sycl::experimental::spec_constant<float, MyFloatConst> f32(0);
34-
cl::sycl::experimental::spec_constant<double, MyDoubleConst> f64(0);
31+
cl::sycl::ONEAPI::spec_constant<int, MyInt32Const> i32_1(0);
32+
cl::sycl::ONEAPI::spec_constant<unsigned int, MyUInt32Const> ui32(0);
33+
cl::sycl::ONEAPI::spec_constant<float, MyFloatConst> f32(0);
34+
cl::sycl::ONEAPI::spec_constant<double, MyDoubleConst> f64(0);
3535

3636
double val;
3737
double *ptr = &val; // to avoid "unused" warnings

clang/test/SemaSYCL/Inputs/sycl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class handler {
208208
}
209209
};
210210

211-
namespace experimental {
211+
namespace ONEAPI {
212212

213213
template <typename T, typename ID = T>
214214
class spec_constant {};

clang/test/SemaSYCL/spec_const_and_accesor_crash.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ __attribute__((sycl_kernel)) void kernel(Func kernelFunc) {
1010
}
1111

1212
int main() {
13-
cl::sycl::experimental::spec_constant<char, class MyInt32Const> spec_const;
13+
cl::sycl::ONEAPI::spec_constant<char, class MyInt32Const> spec_const;
1414
cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write> accessor;
15-
// CHECK: FieldDecl {{.*}} implicit referenced 'cl::sycl::experimental::spec_constant<char, class MyInt32Const>'
15+
// CHECK: FieldDecl {{.*}} implicit referenced 'cl::sycl::ONEAPI::spec_constant<char, class MyInt32Const>'
1616
// CHECK: FieldDecl {{.*}} implicit referenced 'cl::sycl::accessor<int, 1, cl::sycl::access::mode::read_write>'
1717
kernel<class MyKernel>([spec_const, accessor]() {});
1818
return 0;

sycl/include/CL/sycl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
#include <CL/sycl/handler.hpp>
2323
#include <CL/sycl/id.hpp>
2424
#include <CL/sycl/image.hpp>
25-
#include <CL/sycl/intel/atomic.hpp>
26-
#include <CL/sycl/intel/builtins.hpp>
27-
#include <CL/sycl/intel/function_pointer.hpp>
28-
#include <CL/sycl/intel/group_algorithm.hpp>
29-
#include <CL/sycl/intel/reduction.hpp>
30-
#include <CL/sycl/intel/sub_group.hpp>
3125
#include <CL/sycl/item.hpp>
3226
#include <CL/sycl/kernel.hpp>
3327
#include <CL/sycl/multi_ptr.hpp>
3428
#include <CL/sycl/nd_item.hpp>
3529
#include <CL/sycl/nd_range.hpp>
30+
#include <CL/sycl/ONEAPI/atomic.hpp>
31+
#include <CL/sycl/ONEAPI/builtins.hpp>
32+
#include <CL/sycl/ONEAPI/function_pointer.hpp>
33+
#include <CL/sycl/ONEAPI/group_algorithm.hpp>
34+
#include <CL/sycl/ONEAPI/reduction.hpp>
35+
#include <CL/sycl/ONEAPI/sub_group.hpp>
3636
#include <CL/sycl/pipes.hpp>
3737
#include <CL/sycl/platform.hpp>
3838
#include <CL/sycl/pointers.hpp>
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==---------------- atomic.hpp - SYCL_INTEL_extended_atomics --------------==//
1+
//==--------------- atomic.hpp - SYCL_ONEAPI_extended_atomics --------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -8,7 +8,7 @@
88

99
#pragma once
1010

11-
#include <CL/sycl/intel/atomic_accessor.hpp>
12-
#include <CL/sycl/intel/atomic_enums.hpp>
13-
#include <CL/sycl/intel/atomic_fence.hpp>
14-
#include <CL/sycl/intel/atomic_ref.hpp>
11+
#include <CL/sycl/ONEAPI/atomic_accessor.hpp>
12+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
13+
#include <CL/sycl/ONEAPI/atomic_fence.hpp>
14+
#include <CL/sycl/ONEAPI/atomic_ref.hpp>

sycl/include/CL/sycl/intel/atomic_accessor.hpp renamed to sycl/include/CL/sycl/ONEAPI/atomic_accessor.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#pragma once
1010

1111
#include <CL/sycl/access/access.hpp>
12-
#include <CL/sycl/intel/atomic_enums.hpp>
13-
#include <CL/sycl/intel/atomic_ref.hpp>
12+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
13+
#include <CL/sycl/ONEAPI/atomic_ref.hpp>
1414

1515
__SYCL_INLINE_NAMESPACE(cl) {
1616
namespace sycl {
17-
namespace intel {
17+
namespace ONEAPI {
1818

1919
#if __cplusplus > 201402L
2020

@@ -123,6 +123,6 @@ atomic_accessor(buffer<DataT, Dimensions, AllocatorT>, handler,
123123

124124
#endif
125125

126-
} // namespace intel
126+
} // namespace ONEAPI
127127
} // namespace sycl
128128
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/intel/atomic_enums.hpp renamed to sycl/include/CL/sycl/ONEAPI/atomic_enums.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==---------------- atomic_enums.hpp - SYCL_INTEL_extended_atomics enums --==//
1+
//==--------------- atomic_enums.hpp - SYCL_ONEAPI_extended_atomics enums --==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -20,7 +20,7 @@
2020

2121
__SYCL_INLINE_NAMESPACE(cl) {
2222
namespace sycl {
23-
namespace intel {
23+
namespace ONEAPI {
2424

2525
enum class memory_order : int {
2626
relaxed,
@@ -63,7 +63,7 @@ namespace detail {
6363
// Nested ternary conditions in else branch required for C++11
6464
#if __cplusplus >= 201402L
6565
static inline constexpr std::memory_order
66-
getStdMemoryOrder(::cl::sycl::intel::memory_order order) {
66+
getStdMemoryOrder(::cl::sycl::ONEAPI::memory_order order) {
6767
switch (order) {
6868
case memory_order::relaxed:
6969
return std::memory_order_relaxed;
@@ -81,7 +81,7 @@ getStdMemoryOrder(::cl::sycl::intel::memory_order order) {
8181
}
8282
#else
8383
static inline constexpr std::memory_order
84-
getStdMemoryOrder(::cl::sycl::intel::memory_order order) {
84+
getStdMemoryOrder(::cl::sycl::ONEAPI::memory_order order) {
8585
return (order == memory_order::relaxed)
8686
? std::memory_order_relaxed
8787
: (order == memory_order::__consume_unsupported)
@@ -98,6 +98,6 @@ getStdMemoryOrder(::cl::sycl::intel::memory_order order) {
9898
} // namespace detail
9999
#endif // __SYCL_DEVICE_ONLY__
100100

101-
} // namespace intel
101+
} // namespace ONEAPI
102102
} // namespace sycl
103103
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/intel/atomic_fence.hpp renamed to sycl/include/CL/sycl/ONEAPI/atomic_fence.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==----- atomic_fence.hpp - SYCL_INTEL_extended_atomics atomic_fence ------==//
1+
//==---- atomic_fence.hpp - SYCL_ONEAPI_extended_atomics atomic_fence ------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,15 +10,15 @@
1010

1111
#include <CL/__spirv/spirv_ops.hpp>
1212
#include <CL/sycl/detail/spirv.hpp>
13-
#include <CL/sycl/intel/atomic_enums.hpp>
13+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1414

1515
#ifndef __SYCL_DEVICE_ONLY__
1616
#include <atomic>
1717
#endif
1818

1919
__SYCL_INLINE_NAMESPACE(cl) {
2020
namespace sycl {
21-
namespace intel {
21+
namespace ONEAPI {
2222
namespace detail {
2323
using namespace cl::sycl::detail;
2424
}
@@ -35,6 +35,6 @@ static inline void atomic_fence(memory_order order, memory_scope scope) {
3535
#endif
3636
}
3737

38-
} // namespace intel
38+
} // namespace ONEAPI
3939
} // namespace sycl
4040
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/intel/atomic_ref.hpp renamed to sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==----- atomic_ref.hpp - SYCL_INTEL_extended_atomics atomic_ref ----------==//
1+
//==----- atomic_ref.hpp - SYCL_ONEAPI_extended_atomics atomic_ref ----------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -13,7 +13,7 @@
1313
#include <CL/sycl/atomic.hpp>
1414
#include <CL/sycl/detail/defines.hpp>
1515
#include <CL/sycl/detail/helpers.hpp>
16-
#include <CL/sycl/intel/atomic_enums.hpp>
16+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1717

1818
#ifndef __SYCL_DEVICE_ONLY__
1919
#include <atomic>
@@ -27,14 +27,14 @@ namespace sycl {
2727
template <typename pointerT, access::address_space AddressSpace>
2828
class multi_ptr;
2929

30-
namespace intel {
30+
namespace ONEAPI {
3131
namespace detail {
3232

33-
// Import from detail:: into intel::detail:: to improve readability later
33+
// Import from detail:: into ONEAPI::detail:: to improve readability later
3434
using namespace ::cl::sycl::detail;
3535

36-
using memory_order = cl::sycl::intel::memory_order;
37-
using memory_scope = cl::sycl::intel::memory_scope;
36+
using memory_order = cl::sycl::ONEAPI::memory_order;
37+
using memory_scope = cl::sycl::ONEAPI::memory_scope;
3838

3939
template <typename T>
4040
using IsValidAtomicType =
@@ -127,14 +127,14 @@ class atomic_ref_base {
127127
detail::IsValidAtomicType<T>::value,
128128
"Invalid atomic type. Valid types are arithmetic and pointer types");
129129
static_assert(!std::is_same<T, bool>::value,
130-
"intel::atomic_ref does not support bool type");
130+
"ONEAPI::atomic_ref does not support bool type");
131131
static_assert(!(std::is_same<T, char>::value ||
132132
std::is_same<T, signed char>::value ||
133133
std::is_same<T, unsigned char>::value),
134-
"intel::atomic_ref does not support char type");
134+
"ONEAPI::atomic_ref does not support char type");
135135
static_assert(!(std::is_same<T, short>::value ||
136136
std::is_same<T, unsigned short>::value),
137-
"intel::atomic_ref does not support short type");
137+
"ONEAPI::atomic_ref does not support short type");
138138
static_assert(detail::IsValidAtomicAddressSpace<AddressSpace>::value,
139139
"Invalid atomic address_space. Valid address spaces are: "
140140
"global_space, local_space, global_device_space");
@@ -651,6 +651,6 @@ class atomic_ref : public detail::atomic_ref_impl<T, DefaultOrder, DefaultScope,
651651
AddressSpace>::atomic_ref_impl;
652652
};
653653

654-
} // namespace intel
654+
} // namespace ONEAPI
655655
} // namespace sycl
656656
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/intel/builtins.hpp renamed to sycl/include/CL/sycl/ONEAPI/builtins.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818

1919
__SYCL_INLINE_NAMESPACE(cl) {
2020
namespace sycl {
21-
namespace intel {
22-
namespace experimental {
21+
namespace ONEAPI {
2322

2423
// Provides functionality to print data from kernels in a C way:
2524
// - On non-host devices this function is directly mapped to printf from
@@ -67,8 +66,7 @@ int printf(const CONSTANT_AS char *__format, Args... args) {
6766
#endif
6867
}
6968

70-
} // namespace experimental
71-
} // namespace intel
69+
} // namespace ONEAPI
7270
} // namespace sycl
7371
} // __SYCL_INLINE_NAMESPACE(cl)
7472

sycl/include/CL/sycl/intel/function_pointer.hpp renamed to sycl/include/CL/sycl/ONEAPI/function_pointer.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace detail {
2121
__SYCL_EXPORT cl_ulong getDeviceFunctionPointerImpl(device &D, program &P,
2222
const char *FuncName);
2323
}
24-
namespace intel {
24+
namespace ONEAPI {
2525

2626
// This is a preview extension implementation, intended to provide early
2727
// access to a feature for review and community feedback.
@@ -83,6 +83,6 @@ device_func_ptr_holder_t get_device_func_ptr(FuncType F, const char *FuncName,
8383

8484
return sycl::detail::getDeviceFunctionPointerImpl(D, P, FuncName);
8585
}
86-
} // namespace intel
86+
} // namespace ONEAPI
8787
} // namespace sycl
8888
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/intel/functional.hpp renamed to sycl/include/CL/sycl/ONEAPI/functional.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
__SYCL_INLINE_NAMESPACE(cl) {
1313
namespace sycl {
14-
namespace intel {
14+
namespace ONEAPI {
1515

1616
template <typename T = void> struct minimum {
1717
T operator()(const T &lhs, const T &rhs) const {
@@ -57,7 +57,7 @@ template <typename T = void> using bit_or = std::bit_or<T>;
5757
template <typename T = void> using bit_xor = std::bit_xor<T>;
5858
template <typename T = void> using bit_and = std::bit_and<T>;
5959

60-
} // namespace intel
60+
} // namespace ONEAPI
6161

6262
#ifdef __SYCL_DEVICE_ONLY__
6363
namespace detail {
@@ -93,15 +93,15 @@ struct GroupOpTag<T, detail::enable_if_t<detail::is_sgenfloat<T>::value>> {
9393
return Ret; \
9494
}
9595

96-
__SYCL_CALC_OVERLOAD(GroupOpISigned, SMin, intel::minimum<T>)
97-
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, UMin, intel::minimum<T>)
98-
__SYCL_CALC_OVERLOAD(GroupOpFP, FMin, intel::minimum<T>)
99-
__SYCL_CALC_OVERLOAD(GroupOpISigned, SMax, intel::maximum<T>)
100-
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, UMax, intel::maximum<T>)
101-
__SYCL_CALC_OVERLOAD(GroupOpFP, FMax, intel::maximum<T>)
102-
__SYCL_CALC_OVERLOAD(GroupOpISigned, IAdd, intel::plus<T>)
103-
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, IAdd, intel::plus<T>)
104-
__SYCL_CALC_OVERLOAD(GroupOpFP, FAdd, intel::plus<T>)
96+
__SYCL_CALC_OVERLOAD(GroupOpISigned, SMin, ONEAPI::minimum<T>)
97+
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, UMin, ONEAPI::minimum<T>)
98+
__SYCL_CALC_OVERLOAD(GroupOpFP, FMin, ONEAPI::minimum<T>)
99+
__SYCL_CALC_OVERLOAD(GroupOpISigned, SMax, ONEAPI::maximum<T>)
100+
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, UMax, ONEAPI::maximum<T>)
101+
__SYCL_CALC_OVERLOAD(GroupOpFP, FMax, ONEAPI::maximum<T>)
102+
__SYCL_CALC_OVERLOAD(GroupOpISigned, IAdd, ONEAPI::plus<T>)
103+
__SYCL_CALC_OVERLOAD(GroupOpIUnsigned, IAdd, ONEAPI::plus<T>)
104+
__SYCL_CALC_OVERLOAD(GroupOpFP, FAdd, ONEAPI::plus<T>)
105105

106106
#undef __SYCL_CALC_OVERLOAD
107107

0 commit comments

Comments
 (0)