Skip to content

Commit 63c6d06

Browse files
author
iburylov
committed
clang format fix
Signed-off-by: iburylov <[email protected]>
1 parent c43c6b7 commit 63c6d06

File tree

5 files changed

+85
-87
lines changed

5 files changed

+85
-87
lines changed

sycl/include/CL/sycl/accessor.hpp

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,22 +1234,22 @@ accessor(buffer<DataT, Dimensions, AllocatorT>, Type1)
12341234
detail::deduceAccessTarget<Type1, Type1>(target::global_buffer),
12351235
access::placeholder::true_t>;
12361236

1237-
template <typename DataT, int Dimensions, typename AllocatorT,
1238-
typename Type1, typename Type2>
1237+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1238+
typename Type2>
12391239
accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2)
12401240
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type1, Type2>(),
12411241
detail::deduceAccessTarget<Type1, Type2>(target::global_buffer),
12421242
access::placeholder::true_t>;
12431243

1244-
template <typename DataT, int Dimensions, typename AllocatorT,
1245-
typename Type1, typename Type2, typename Type3>
1244+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1245+
typename Type2, typename Type3>
12461246
accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3)
12471247
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type2, Type3>(),
12481248
detail::deduceAccessTarget<Type2, Type3>(target::global_buffer),
12491249
access::placeholder::true_t>;
12501250

1251-
template <typename DataT, int Dimensions, typename AllocatorT,
1252-
typename Type1, typename Type2, typename Type3, typename Type4>
1251+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1252+
typename Type2, typename Type3, typename Type4>
12531253
accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3, Type4)
12541254
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type3, Type4>(),
12551255
detail::deduceAccessTarget<Type3, Type4>(target::global_buffer),
@@ -1266,22 +1266,22 @@ accessor(buffer<DataT, Dimensions, AllocatorT>, handler, Type1)
12661266
detail::deduceAccessTarget<Type1, Type1>(target::global_buffer),
12671267
access::placeholder::false_t>;
12681268

1269-
template <typename DataT, int Dimensions, typename AllocatorT,
1270-
typename Type1, typename Type2>
1269+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1270+
typename Type2>
12711271
accessor(buffer<DataT, Dimensions, AllocatorT>, handler, Type1, Type2)
12721272
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type1, Type2>(),
12731273
detail::deduceAccessTarget<Type1, Type2>(target::global_buffer),
12741274
access::placeholder::false_t>;
12751275

1276-
template <typename DataT, int Dimensions, typename AllocatorT,
1277-
typename Type1, typename Type2, typename Type3>
1276+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1277+
typename Type2, typename Type3>
12781278
accessor(buffer<DataT, Dimensions, AllocatorT>, handler, Type1, Type2, Type3)
12791279
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type2, Type3>(),
12801280
detail::deduceAccessTarget<Type2, Type3>(target::global_buffer),
12811281
access::placeholder::false_t>;
12821282

1283-
template <typename DataT, int Dimensions, typename AllocatorT,
1284-
typename Type1, typename Type2, typename Type3, typename Type4>
1283+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1284+
typename Type2, typename Type3, typename Type4>
12851285
accessor(buffer<DataT, Dimensions, AllocatorT>, handler, Type1, Type2, Type3,
12861286
Type4)
12871287
->accessor<DataT, Dimensions, detail::deduceAccessMode<Type3, Type4>(),
@@ -1685,41 +1685,32 @@ class host_accessor
16851685

16861686
#if __cplusplus > 201402L
16871687

1688-
/*
1689-
template <typename DataT, int Dimensions, typename AllocatorT, typename... Ts>
1690-
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Ts...)
1691-
->host_accessor<DataT, Dimensions, access::mode::read_write>;
1692-
1693-
template <typename DataT, int Dimensions, typename AllocatorT,
1694-
access_mode AccessMode, typename PropertyList = property_list,
1695-
typename... Ts>
1696-
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Ts...,
1697-
mode_tag_t<AccessMode>, PropertyList = {})
1698-
->host_accessor<DataT, Dimensions, AccessMode>;
1699-
*/
1700-
17011688
template <typename DataT, int Dimensions, typename AllocatorT>
17021689
host_accessor(buffer<DataT, Dimensions, AllocatorT>)
17031690
->host_accessor<DataT, Dimensions, access::mode::read_write>;
17041691

17051692
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1>
17061693
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Type1)
1707-
->host_accessor<DataT, Dimensions, detail::deduceAccessMode<Type1, Type1>()>;
1694+
->host_accessor<DataT, Dimensions,
1695+
detail::deduceAccessMode<Type1, Type1>()>;
17081696

1709-
template <typename DataT, int Dimensions, typename AllocatorT,
1710-
typename Type1, typename Type2>
1697+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1698+
typename Type2>
17111699
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2)
1712-
->host_accessor<DataT, Dimensions, detail::deduceAccessMode<Type1, Type2>()>;
1700+
->host_accessor<DataT, Dimensions,
1701+
detail::deduceAccessMode<Type1, Type2>()>;
17131702

1714-
template <typename DataT, int Dimensions, typename AllocatorT,
1715-
typename Type1, typename Type2, typename Type3>
1703+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1704+
typename Type2, typename Type3>
17161705
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3)
1717-
->host_accessor<DataT, Dimensions, detail::deduceAccessMode<Type2, Type3>()>;
1706+
->host_accessor<DataT, Dimensions,
1707+
detail::deduceAccessMode<Type2, Type3>()>;
17181708

1719-
template <typename DataT, int Dimensions, typename AllocatorT,
1720-
typename Type1, typename Type2, typename Type3, typename Type4>
1709+
template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
1710+
typename Type2, typename Type3, typename Type4>
17211711
host_accessor(buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3, Type4)
1722-
->host_accessor<DataT, Dimensions, detail::deduceAccessMode<Type3, Type4>()>;
1712+
->host_accessor<DataT, Dimensions,
1713+
detail::deduceAccessMode<Type3, Type4>()>;
17231714

17241715
#endif
17251716

sycl/include/CL/sycl/buffer.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,16 @@ class buffer {
279279

280280
#if __cplusplus > 201402L
281281

282-
template<typename... Ts>
283-
auto get_access(Ts... args) {
282+
template <typename... Ts> auto get_access(Ts... args) {
284283
return accessor{*this, args...};
285284
}
286285

287-
template<typename... Ts>
286+
template <typename... Ts>
288287
auto get_access(handler &commandGroupHandler, Ts... args) {
289288
return accessor{*this, commandGroupHandler, args...};
290289
}
291290

292-
template<typename... Ts>
293-
auto get_host_access(Ts... args) {
291+
template <typename... Ts> auto get_host_access(Ts... args) {
294292
return host_accessor{*this, args...};
295293
}
296294

sycl/include/CL/sycl/detail/accessor_impl.hpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,38 @@ constexpr access::mode deduceAccessMode() {
190190
// property_list = {} is not properly detected by deduction guide,
191191
// when parameter is passed without curly braces: access(buffer, noinit)
192192
// thus simplest approach is to check 2 last arguments for being a tag
193-
if constexpr ( std::is_same<MayBeTag1, mode_tag_t<access::mode::read>>::value ||
194-
std::is_same<MayBeTag2, mode_tag_t<access::mode::read>>::value ) {
193+
if constexpr (std::is_same<MayBeTag1,
194+
mode_tag_t<access::mode::read>>::value ||
195+
std::is_same<MayBeTag2,
196+
mode_tag_t<access::mode::read>>::value) {
195197
return access::mode::read;
196-
}
197-
else if constexpr ( std::is_same<MayBeTag1, mode_tag_t<access::mode::write>>::value ||
198-
std::is_same<MayBeTag2, mode_tag_t<access::mode::write>>::value ) {
198+
} else if constexpr (std::is_same<MayBeTag1,
199+
mode_tag_t<access::mode::write>>::value ||
200+
std::is_same<MayBeTag2,
201+
mode_tag_t<access::mode::write>>::value) {
199202
return access::mode::write;
200-
}
201-
else if constexpr ( std::is_same<MayBeTag1, mode_target_tag_t<access::mode::read, access::target::constant_buffer>>::value ||
202-
std::is_same<MayBeTag2, mode_target_tag_t<access::mode::read, access::target::constant_buffer>>::value ) {
203+
} else if constexpr (
204+
std::is_same<MayBeTag1,
205+
mode_target_tag_t<access::mode::read,
206+
access::target::constant_buffer>>::value ||
207+
std::is_same<MayBeTag2,
208+
mode_target_tag_t<access::mode::read,
209+
access::target::constant_buffer>>::value) {
203210
return access::mode::read;
204-
}
205-
else {
211+
} else {
206212
return access::mode::read_write;
207213
}
208214
}
209215

210216
template <typename MayBeTag1, typename MayBeTag2>
211217
constexpr access::target deduceAccessTarget(access::target defaultTarget) {
212-
if constexpr ( std::is_same<MayBeTag1, mode_target_tag_t<access::mode::read, access::target::constant_buffer>>::value ||
213-
std::is_same<MayBeTag2, mode_target_tag_t<access::mode::read, access::target::constant_buffer>>::value) {
218+
if constexpr (
219+
std::is_same<MayBeTag1,
220+
mode_target_tag_t<access::mode::read,
221+
access::target::constant_buffer>>::value ||
222+
std::is_same<MayBeTag2,
223+
mode_target_tag_t<access::mode::read,
224+
access::target::constant_buffer>>::value) {
214225
return access::target::constant_buffer;
215226
}
216227
else {

sycl/test/basic_tests/accessor/Inputs/device_accessor.cpp

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ int main() {
1818
int data[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
1919

2020
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(9),
21-
{cl::sycl::property::buffer::use_host_ptr()});
21+
{cl::sycl::property::buffer::use_host_ptr()});
2222

2323
sycl::queue Queue;
2424

@@ -62,13 +62,13 @@ int main() {
6262

6363
cgh.single_task<class nonplaceholder_kernel>(
6464
[=]() {
65-
acc_7[6] = acc_1[0];
66-
acc_8[7] = acc_2[1];
67-
acc_9[7] = acc_3[1];
68-
acc_1[0] = acc_4[3];
69-
acc_2[1] = acc_5[4];
70-
acc_3[1] = acc_6[4];
71-
});
65+
acc_7[6] = acc_1[0];
66+
acc_8[7] = acc_2[1];
67+
acc_9[7] = acc_3[1];
68+
acc_1[0] = acc_4[3];
69+
acc_2[1] = acc_5[4];
70+
acc_3[1] = acc_6[4];
71+
});
7272
});
7373
Queue.wait();
7474

@@ -87,7 +87,7 @@ int main() {
8787
int data[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
8888

8989
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(9),
90-
{cl::sycl::property::buffer::use_host_ptr()});
90+
{cl::sycl::property::buffer::use_host_ptr()});
9191

9292
#if defined(accessor_new_api_test)
9393
sycl::accessor acc_1(buf_data);
@@ -128,7 +128,6 @@ int main() {
128128
sycl::queue Queue;
129129

130130
Queue.submit([&](sycl::handler &cgh) {
131-
132131
cgh.require(acc_1);
133132
cgh.require(acc_2);
134133
cgh.require(acc_3);
@@ -141,13 +140,13 @@ int main() {
141140

142141
cgh.single_task<class placeholder_kernel>(
143142
[=]() {
144-
acc_7[6] = acc_1[0];
145-
acc_8[7] = acc_2[1];
146-
acc_9[7] = acc_3[1];
147-
acc_1[0] = acc_4[3];
148-
acc_2[1] = acc_5[4];
149-
acc_3[1] = acc_6[4];
150-
});
143+
acc_7[6] = acc_1[0];
144+
acc_8[7] = acc_2[1];
145+
acc_9[7] = acc_3[1];
146+
acc_1[0] = acc_4[3];
147+
acc_2[1] = acc_5[4];
148+
acc_3[1] = acc_6[4];
149+
});
151150
});
152151
Queue.wait();
153152

@@ -166,7 +165,7 @@ int main() {
166165
int data[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
167166

168167
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(9),
169-
{cl::sycl::property::buffer::use_host_ptr()});
168+
{cl::sycl::property::buffer::use_host_ptr()});
170169

171170
sycl::queue Queue;
172171

@@ -216,13 +215,13 @@ int main() {
216215

217216
cgh.single_task<class nonplaceholder_noinit_kernel>(
218217
[=]() {
219-
acc_7[6] = 1;
220-
acc_8[7] = 2;
221-
acc_9[7] = 3;
222-
acc_1[0] = acc_4[3];
223-
acc_2[1] = acc_5[4];
224-
acc_3[1] = acc_6[4];
225-
});
218+
acc_7[6] = 1;
219+
acc_8[7] = 2;
220+
acc_9[7] = 3;
221+
acc_1[0] = acc_4[3];
222+
acc_2[1] = acc_5[4];
223+
acc_3[1] = acc_6[4];
224+
});
226225
});
227226
Queue.wait();
228227

@@ -241,7 +240,7 @@ int main() {
241240
int data[9] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
242241

243242
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(9),
244-
{cl::sycl::property::buffer::use_host_ptr()});
243+
{cl::sycl::property::buffer::use_host_ptr()});
245244

246245
#if defined(accessor_new_api_test)
247246
sycl::accessor acc_1(buf_data, sycl::noinit);
@@ -286,7 +285,6 @@ int main() {
286285
sycl::queue Queue;
287286

288287
Queue.submit([&](sycl::handler &cgh) {
289-
290288
cgh.require(acc_1);
291289
cgh.require(acc_2);
292290
cgh.require(acc_3);
@@ -299,13 +297,13 @@ int main() {
299297

300298
cgh.single_task<class placeholder_noinit_kernel>(
301299
[=]() {
302-
acc_7[6] = 1;
303-
acc_8[7] = 2;
304-
acc_9[7] = 3;
305-
acc_1[0] = acc_4[3];
306-
acc_2[1] = acc_5[4];
307-
acc_3[1] = acc_6[4];
308-
});
300+
acc_7[6] = 1;
301+
acc_8[7] = 2;
302+
acc_9[7] = 3;
303+
acc_1[0] = acc_4[3];
304+
acc_2[1] = acc_5[4];
305+
acc_3[1] = acc_6[4];
306+
});
309307
});
310308
Queue.wait();
311309

sycl/test/basic_tests/accessor/Inputs/host_accessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ int main() {
1717
int data[3] = {3, 7, 9};
1818

1919
sycl::buffer<int, 1> buf_data(data, sycl::range<1>(3),
20-
{cl::sycl::property::buffer::use_host_ptr()});
20+
{cl::sycl::property::buffer::use_host_ptr()});
2121

2222
{
2323
#if defined(accessor_new_api_test)

0 commit comments

Comments
 (0)