Skip to content

Commit 42c6c27

Browse files
committed
clang-format
Signed-off-by: James Brodman <[email protected]>
1 parent 16dbb8d commit 42c6c27

20 files changed

+65
-56
lines changed

sycl/include/CL/sycl.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
#pragma once
1010

11+
#include <CL/sycl/ONEAPI/atomic.hpp>
12+
#include <CL/sycl/ONEAPI/experimental/builtins.hpp>
13+
#include <CL/sycl/ONEAPI/function_pointer.hpp>
14+
#include <CL/sycl/ONEAPI/group_algorithm.hpp>
15+
#include <CL/sycl/ONEAPI/reduction.hpp>
16+
#include <CL/sycl/ONEAPI/sub_group.hpp>
1117
#include <CL/sycl/accessor.hpp>
1218
#include <CL/sycl/atomic.hpp>
1319
#include <CL/sycl/backend.hpp>
@@ -27,12 +33,6 @@
2733
#include <CL/sycl/multi_ptr.hpp>
2834
#include <CL/sycl/nd_item.hpp>
2935
#include <CL/sycl/nd_range.hpp>
30-
#include <CL/sycl/ONEAPI/atomic.hpp>
31-
#include <CL/sycl/ONEAPI/experimental/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>

sycl/include/CL/sycl/ONEAPI/atomic_accessor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#pragma once
1010

11-
#include <CL/sycl/access/access.hpp>
1211
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1312
#include <CL/sycl/ONEAPI/atomic_ref.hpp>
13+
#include <CL/sycl/access/access.hpp>
1414

1515
__SYCL_INLINE_NAMESPACE(cl) {
1616
namespace sycl {

sycl/include/CL/sycl/ONEAPI/atomic_fence.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#pragma once
1010

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

1515
#ifndef __SYCL_DEVICE_ONLY__
1616
#include <atomic>

sycl/include/CL/sycl/ONEAPI/atomic_ref.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
#pragma once
1010

1111
#include <CL/__spirv/spirv_ops.hpp>
12+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1213
#include <CL/sycl/access/access.hpp>
1314
#include <CL/sycl/atomic.hpp>
1415
#include <CL/sycl/detail/defines.hpp>
1516
#include <CL/sycl/detail/helpers.hpp>
16-
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1717

1818
#ifndef __SYCL_DEVICE_ONLY__
1919
#include <atomic>

sycl/include/CL/sycl/ONEAPI/group_algorithm.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
#include <CL/__spirv/spirv_ops.hpp>
1111
#include <CL/__spirv/spirv_types.hpp>
1212
#include <CL/__spirv/spirv_vars.hpp>
13+
#include <CL/sycl/ONEAPI/functional.hpp>
14+
#include <CL/sycl/ONEAPI/sub_group.hpp>
1315
#include <CL/sycl/detail/spirv.hpp>
1416
#include <CL/sycl/detail/type_traits.hpp>
1517
#include <CL/sycl/group.hpp>
16-
#include <CL/sycl/ONEAPI/functional.hpp>
17-
#include <CL/sycl/ONEAPI/sub_group.hpp>
1818

1919
#ifndef __DISABLE_SYCL_ONEAPI_GROUP_ALGORITHMS__
2020
__SYCL_INLINE_NAMESPACE(cl) {

sycl/include/CL/sycl/ONEAPI/reduction.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
#pragma once
1010

11+
#include <CL/sycl/ONEAPI/group_algorithm.hpp>
1112
#include <CL/sycl/accessor.hpp>
1213
#include <CL/sycl/handler.hpp>
13-
#include <CL/sycl/ONEAPI/group_algorithm.hpp>
1414

1515
__SYCL_INLINE_NAMESPACE(cl) {
1616
namespace sycl {

sycl/include/CL/sycl/ONEAPI/sub_group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
#include <CL/__spirv/spirv_ops.hpp>
1212
#include <CL/__spirv/spirv_vars.hpp>
13+
#include <CL/sycl/ONEAPI/functional.hpp>
1314
#include <CL/sycl/access/access.hpp>
1415
#include <CL/sycl/detail/defines.hpp>
1516
#include <CL/sycl/detail/generic_type_traits.hpp>
1617
#include <CL/sycl/detail/helpers.hpp>
1718
#include <CL/sycl/detail/spirv.hpp>
1819
#include <CL/sycl/detail/type_traits.hpp>
1920
#include <CL/sycl/id.hpp>
20-
#include <CL/sycl/ONEAPI/functional.hpp>
2121
#include <CL/sycl/range.hpp>
2222
#include <CL/sycl/types.hpp>
2323

sycl/include/CL/sycl/detail/spirv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <CL/__spirv/spirv_ops.hpp>
1111
#include <CL/__spirv/spirv_types.hpp>
1212
#include <CL/__spirv/spirv_vars.hpp>
13+
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1314
#include <CL/sycl/detail/generic_type_traits.hpp>
1415
#include <CL/sycl/detail/type_traits.hpp>
15-
#include <CL/sycl/ONEAPI/atomic_enums.hpp>
1616

1717
#ifdef __SYCL_DEVICE_ONLY__
1818
__SYCL_INLINE_NAMESPACE(cl) {

sycl/include/CL/sycl/handler.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ class __SYCL_EXPORT handler {
10041004
Reduction::has_fast_atomics && !Reduction::is_usm>
10051005
parallel_for(nd_range<Dims> Range, Reduction Redu, KernelType KernelFunc) {
10061006
ONEAPI::detail::reduCGFunc<KernelName>(*this, KernelFunc, Range, Redu,
1007-
Redu.getUserAccessor());
1007+
Redu.getUserAccessor());
10081008
}
10091009

10101010
/// Implements parallel_for() accepting nd_range and 1 reduction variable
@@ -1017,7 +1017,7 @@ class __SYCL_EXPORT handler {
10171017
Reduction::has_fast_atomics && Reduction::is_usm>
10181018
parallel_for(nd_range<Dims> Range, Reduction Redu, KernelType KernelFunc) {
10191019
ONEAPI::detail::reduCGFunc<KernelName>(*this, KernelFunc, Range, Redu,
1020-
Redu.getUSMPointer());
1020+
Redu.getUSMPointer());
10211021
}
10221022

10231023
/// Implements parallel_for() accepting nd_range and 1 reduction variable
@@ -1038,7 +1038,7 @@ class __SYCL_EXPORT handler {
10381038
shared_ptr_class<detail::queue_impl> QueueCopy = MQueue;
10391039
auto RWAcc = Redu.getReadWriteScalarAcc(*this);
10401040
ONEAPI::detail::reduCGFunc<KernelName>(*this, KernelFunc, Range, Redu,
1041-
RWAcc);
1041+
RWAcc);
10421042
this->finalize();
10431043

10441044
// Copy from RWAcc to user's reduction accessor.

sycl/include/CL/sycl/nd_item.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
#pragma once
1010

1111
#include <CL/__spirv/spirv_ops.hpp>
12+
#include <CL/sycl/ONEAPI/sub_group.hpp>
1213
#include <CL/sycl/access/access.hpp>
1314
#include <CL/sycl/detail/defines.hpp>
1415
#include <CL/sycl/detail/helpers.hpp>
1516
#include <CL/sycl/group.hpp>
1617
#include <CL/sycl/id.hpp>
1718
#include <CL/sycl/item.hpp>
1819
#include <CL/sycl/nd_range.hpp>
19-
#include <CL/sycl/ONEAPI/sub_group.hpp>
2020
#include <CL/sycl/range.hpp>
2121

2222
#include <cstddef>

sycl/source/function_pointer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include <detail/device_impl.hpp>
109
#include <CL/sycl/ONEAPI/function_pointer.hpp>
10+
#include <detail/device_impl.hpp>
1111
#include <detail/program_impl.hpp>
1212

1313
__SYCL_INLINE_NAMESPACE(cl) {

sycl/test/function-pointers/fp-as-kernel-arg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ int main() {
5454
auto AccB = BufB.template get_access<cl::sycl::access::mode::read>(CGH);
5555
CGH.parallel_for<class K>(
5656
KE, cl::sycl::range<1>(Size), [=](cl::sycl::id<1> Index) {
57-
auto Fptr =
58-
cl::sycl::ONEAPI::to_device_func_ptr<decltype(add)>(FptrStorage);
59-
AccA[Index] = Fptr(AccA[Index], AccB[Index]);
60-
});
57+
auto Fptr =
58+
cl::sycl::ONEAPI::to_device_func_ptr<decltype(add)>(FptrStorage);
59+
AccA[Index] = Fptr(AccA[Index], AccB[Index]);
60+
});
6161
});
6262

6363
auto HostAcc = BufA.get_access<cl::sycl::access::mode::read>();

sycl/test/function-pointers/pass-fp-through-buffer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ int main() {
6969
DispatchTable.template get_access<cl::sycl::access::mode::read>(CGH);
7070
CGH.parallel_for<class K>(
7171
KE, cl::sycl::range<1>(Size), [=](cl::sycl::id<1> Index) {
72-
auto FP =
73-
cl::sycl::ONEAPI::to_device_func_ptr<int(int, int)>(AccDT[Mode]);
72+
auto FP = cl::sycl::ONEAPI::to_device_func_ptr<int(int, int)>(
73+
AccDT[Mode]);
7474

75-
AccA[Index] = FP(AccA[Index], AccB[Index]);
76-
});
75+
AccA[Index] = FP(AccA[Index], AccB[Index]);
76+
});
7777
});
7878

7979
auto HostAcc = bufA.get_access<cl::sycl::access::mode::read>();

sycl/test/reduction/reduction_ctor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ int main() {
9393
testBoth<int>(0, ONEAPI::bit_or<int>(), 1, 8);
9494
testBoth<int>(0, ONEAPI::bit_xor<int>(), 7, 3);
9595
testBoth<int>(~0, ONEAPI::bit_and<int>(), 7, 3);
96-
testBoth<int>((std::numeric_limits<int>::max)(), ONEAPI::minimum<int>(), 7, 3);
97-
testBoth<int>((std::numeric_limits<int>::min)(), ONEAPI::maximum<int>(), 7, 3);
96+
testBoth<int>((std::numeric_limits<int>::max)(), ONEAPI::minimum<int>(), 7,
97+
3);
98+
testBoth<int>((std::numeric_limits<int>::min)(), ONEAPI::maximum<int>(), 7,
99+
3);
98100

99101
testBoth<float>(0, ONEAPI::plus<float>(), 1, 7);
100102
testBoth<float>(1, std::multiplies<float>(), 1, 7);

sycl/test/reduction/reduction_nd_ext_type.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,17 @@ int runTests(const string_class &ExtensionName) {
6666
test<T, 1, access::mode::read_write, std::multiplies<T>>(0, 4, 4);
6767
test<T, 0, access::mode::discard_write, ONEAPI::plus<T>>(0, 4, 64);
6868

69-
test<T, 0, access::mode::read_write, ONEAPI::minimum<T>>(getMaximumFPValue<T>(), 7, 7);
70-
test<T, 1, access::mode::discard_write, ONEAPI::maximum<T>>(getMinimumFPValue<T>(), 7, 7 * 5);
69+
test<T, 0, access::mode::read_write, ONEAPI::minimum<T>>(
70+
getMaximumFPValue<T>(), 7, 7);
71+
test<T, 1, access::mode::discard_write, ONEAPI::maximum<T>>(
72+
getMinimumFPValue<T>(), 7, 7 * 5);
7173

7274
#if __cplusplus >= 201402L
7375
test<T, 1, access::mode::read_write, ONEAPI::plus<>>(1, 3, 3 * 5);
74-
test<T, 1, access::mode::discard_write, ONEAPI::minimum<>>(getMaximumFPValue<T>(), 3, 3);
75-
test<T, 0, access::mode::discard_write, ONEAPI::maximum<>>(getMinimumFPValue<T>(), 3, 3);
76+
test<T, 1, access::mode::discard_write, ONEAPI::minimum<>>(
77+
getMaximumFPValue<T>(), 3, 3);
78+
test<T, 0, access::mode::discard_write, ONEAPI::maximum<>>(
79+
getMinimumFPValue<T>(), 3, 3);
7680
#endif // __cplusplus >= 201402L
7781

7882
std::cout << "Test passed\n";

sycl/test/reduction/reduction_placeholder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// RUN: %ACC_RUN_PLACEHOLDER %t.out
88

99
// RUNx: env SYCL_DEVICE_TYPE=HOST %t.out
10-
// TODO: Enable the test for HOST when it supports ONEAPI::reduce() and barrier()
10+
// TODO: Enable the test for HOST when it supports ONEAPI::reduce() and
11+
// barrier()
1112

1213
// This test performs basic checks of parallel_for(nd_range, reduction, func)
1314
// with reductions initialized with a placeholder accessor.

sycl/test/reduction/reduction_transparent.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ void testId(T Identity, size_t WGSize, size_t NWItems) {
4646
range<1> LocalRange(WGSize);
4747
nd_range<1> NDRange(GlobalRange, LocalRange);
4848
CGH.parallel_for<SomeIdClass<T, Dim, BinaryOperation>>(
49-
NDRange, ONEAPI::reduction(Out, Identity, BOp), [=](nd_item<1> NDIt, auto &Sum) {
49+
NDRange, ONEAPI::reduction(Out, Identity, BOp),
50+
[=](nd_item<1> NDIt, auto &Sum) {
5051
Sum.combine(In[NDIt.get_global_linear_id()]);
5152
});
5253
});

sycl/test/reduction/reduction_usm.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// RUN: %ACC_RUN_PLACEHOLDER %t.out
88

99
// RUNx: env SYCL_DEVICE_TYPE=HOST %t.out
10-
// TODO: Enable the test for HOST when it supports ONEAPI::reduce() and barrier()
10+
// TODO: Enable the test for HOST when it supports ONEAPI::reduce() and
11+
// barrier()
1112

1213
// This test performs basic checks of parallel_for(nd_range, reduction, func)
1314
// with reductions initialized with USM var.
@@ -113,7 +114,8 @@ int main() {
113114
testUSM<int, 1, ONEAPI::bit_or<int>>(0, 4, 128);
114115

115116
// fast reduce
116-
testUSM<float, 1, ONEAPI::minimum<float>>(getMaximumFPValue<float>(), 5, 5 * 7);
117+
testUSM<float, 1, ONEAPI::minimum<float>>(getMaximumFPValue<float>(), 5,
118+
5 * 7);
117119
testUSM<float, 0, ONEAPI::maximum<float>>(getMinimumFPValue<float>(), 4, 128);
118120

119121
// generic algorithm

sycl/test/sub_group/generic_reduce.cpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,18 @@ void check_op(queue &Queue, T init, BinaryOperation op, bool skip_init = false,
2424
Queue.submit([&](handler &cgh) {
2525
auto sgsizeacc = sgsizebuf.get_access<access::mode::read_write>(cgh);
2626
auto acc = buf.template get_access<access::mode::read_write>(cgh);
27-
cgh.parallel_for(
28-
NdRange, [=](nd_item<1> NdItem) {
29-
ONEAPI::sub_group sg = NdItem.get_sub_group();
30-
if (skip_init) {
31-
acc[NdItem.get_global_id(0)] =
32-
reduce(sg, T(NdItem.get_global_id(0)), op);
33-
} else {
34-
acc[NdItem.get_global_id(0)] =
35-
reduce(sg, T(NdItem.get_global_id(0)), init, op);
36-
}
37-
if (NdItem.get_global_id(0) == 0)
38-
sgsizeacc[0] = sg.get_max_local_range()[0];
39-
});
27+
cgh.parallel_for(NdRange, [=](nd_item<1> NdItem) {
28+
ONEAPI::sub_group sg = NdItem.get_sub_group();
29+
if (skip_init) {
30+
acc[NdItem.get_global_id(0)] =
31+
reduce(sg, T(NdItem.get_global_id(0)), op);
32+
} else {
33+
acc[NdItem.get_global_id(0)] =
34+
reduce(sg, T(NdItem.get_global_id(0)), init, op);
35+
}
36+
if (NdItem.get_global_id(0) == 0)
37+
sgsizeacc[0] = sg.get_max_local_range()[0];
38+
});
4039
});
4140
auto acc = buf.template get_access<access::mode::read_write>();
4241
auto sgsizeacc = sgsizebuf.get_access<access::mode::read_write>();

sycl/test/sub_group/scan.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ void check(queue &Queue, size_t G = 120, size_t L = 60) {
9090
check_op<T>(Queue, std::numeric_limits<T>::infinity(), ONEAPI::minimum<T>(),
9191
true, G, L);
9292
} else {
93-
check_op<T>(Queue, std::numeric_limits<T>::max(), ONEAPI::minimum<T>(), true,
94-
G, L);
93+
check_op<T>(Queue, std::numeric_limits<T>::max(), ONEAPI::minimum<T>(),
94+
true, G, L);
9595
}
9696

9797
check_op<T>(Queue, T(G), ONEAPI::maximum<T>(), false, G, L);
9898
if (std::is_floating_point<T>::value ||
9999
std::is_same<T, cl::sycl::half>::value) {
100-
check_op<T>(Queue, -std::numeric_limits<T>::infinity(), ONEAPI::maximum<T>(),
101-
true, G, L);
100+
check_op<T>(Queue, -std::numeric_limits<T>::infinity(),
101+
ONEAPI::maximum<T>(), true, G, L);
102102
} else {
103-
check_op<T>(Queue, std::numeric_limits<T>::min(), ONEAPI::maximum<T>(), true,
104-
G, L);
103+
check_op<T>(Queue, std::numeric_limits<T>::min(), ONEAPI::maximum<T>(),
104+
true, G, L);
105105
}
106106

107107
#if __cplusplus >= 201402L

0 commit comments

Comments
 (0)