Skip to content

Commit 54e68a5

Browse files
author
Alexander Batashev
committed
clang-format
1 parent b1a8a11 commit 54e68a5

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#include <CL/sycl/detail/helpers.hpp>
1818
#include <CL/sycl/detail/spirv.hpp>
1919
#include <CL/sycl/detail/type_traits.hpp>
20+
#include <CL/sycl/enums.hpp>
2021
#include <CL/sycl/id.hpp>
2122
#include <CL/sycl/range.hpp>
2223
#include <CL/sycl/types.hpp>
23-
#include <CL/sycl/enums.hpp>
2424

2525
#include <type_traits>
2626

@@ -105,7 +105,8 @@ struct sub_group {
105105
using range_type = range<1>;
106106
using linear_id_type = uint32_t;
107107
static constexpr int dimensions = 1;
108-
static constexpr sycl::memory_scope fence_scope = sycl::memory_scope::sub_group;
108+
static constexpr sycl::memory_scope fence_scope =
109+
sycl::memory_scope::sub_group;
109110

110111
/* --- common interface members --- */
111112

@@ -728,13 +729,13 @@ struct sub_group {
728729
#endif
729730
}
730731

731-
protected:
732-
template <int dimensions> friend class cl::sycl::nd_item;
733-
friend sub_group this_sub_group();
734-
sub_group() = default;
735-
};
732+
protected:
733+
template <int dimensions> friend class cl::sycl::nd_item;
734+
friend sub_group this_sub_group();
735+
sub_group() = default;
736+
};
736737

737-
inline sub_group this_sub_group() {
738+
inline sub_group this_sub_group() {
738739
#ifdef __SYCL_DEVICE_ONLY__
739740
return sub_group();
740741
#else

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
#include <CL/sycl/detail/generic_type_traits.hpp>
1515
#include <CL/sycl/detail/helpers.hpp>
1616
#include <CL/sycl/detail/type_traits.hpp>
17-
#include <CL/sycl/id.hpp>
1817
#include <CL/sycl/enums.hpp>
18+
#include <CL/sycl/id.hpp>
1919

2020
#ifdef __SYCL_DEVICE_ONLY__
2121
__SYCL_INLINE_NAMESPACE(cl) {
@@ -260,8 +260,7 @@ getScope(ONEAPI::memory_scope Scope) {
260260
}
261261
}
262262

263-
constexpr __spv::Scope::Flag
264-
getScope(memory_scope Scope) {
263+
constexpr __spv::Scope::Flag getScope(memory_scope Scope) {
265264
switch (Scope) {
266265
case memory_scope::work_item:
267266
return __spv::Scope::Invocation;

sycl/include/CL/sycl/enums.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
__SYCL_INLINE_NAMESPACE(cl) {
1212
namespace sycl {
1313
enum class memory_scope : unsigned char {
14-
work_item = 0,
15-
sub_group = 1,
16-
work_group = 2,
17-
device = 3,
18-
system = 4
14+
work_item = 0,
15+
sub_group = 1,
16+
work_group = 2,
17+
device = 3,
18+
system = 4
1919
};
2020

2121
#if __cplusplus >= 201703L
@@ -25,6 +25,5 @@ inline constexpr auto memory_scope_work_group = memory_scope::work_group;
2525
inline constexpr auto memory_scope_device = memory_scope::device;
2626
inline constexpr auto memory_scope_system = memory_scope::system;
2727
#endif
28-
}
29-
}
30-
28+
} // namespace sycl
29+
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
#include <CL/sycl/detail/generic_type_traits.hpp>
1616
#include <CL/sycl/detail/helpers.hpp>
1717
#include <CL/sycl/device_event.hpp>
18+
#include <CL/sycl/enums.hpp>
1819
#include <CL/sycl/h_item.hpp>
1920
#include <CL/sycl/id.hpp>
2021
#include <CL/sycl/pointers.hpp>
2122
#include <CL/sycl/range.hpp>
22-
#include <CL/sycl/enums.hpp>
2323
#include <stdexcept>
2424
#include <type_traits>
2525

sycl/include/CL/sycl/sub_group.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,29 @@
88

99
#pragma once
1010

11-
#include <CL/sycl/group.hpp>
1211
#include <CL/sycl/ONEAPI/sub_group.hpp>
12+
#include <CL/sycl/group.hpp>
1313

1414
__SYCL_INLINE_NAMESPACE(cl) {
1515
namespace sycl {
1616
using ONEAPI::sub_group;
1717
// TODO move the entire sub_group class implementation to this file once
1818
// breaking changes are allowed.
1919

20-
template <> inline void group_barrier<sub_group>(sub_group Group, memory_scope FenceScope) {
20+
template <>
21+
inline void group_barrier<sub_group>(sub_group Group, memory_scope FenceScope) {
2122
(void)Group;
2223
(void)FenceScope;
2324
#ifdef __SYCL_DEVICE_ONLY__
24-
__spirv_ControlBarrier(
25-
__spv::Scope::Subgroup, detail::spirv::getScope(FenceScope),
26-
__spv::MemorySemanticsMask::AcquireRelease |
27-
__spv::MemorySemanticsMask::SubgroupMemory |
28-
__spv::MemorySemanticsMask::WorkgroupMemory |
29-
__spv::MemorySemanticsMask::CrossWorkgroupMemory);
25+
__spirv_ControlBarrier(__spv::Scope::Subgroup,
26+
detail::spirv::getScope(FenceScope),
27+
__spv::MemorySemanticsMask::AcquireRelease |
28+
__spv::MemorySemanticsMask::SubgroupMemory |
29+
__spv::MemorySemanticsMask::WorkgroupMemory |
30+
__spv::MemorySemanticsMask::CrossWorkgroupMemory);
3031
#else
31-
throw runtime_error("Sub-groups are not supported on host device.",
32-
PI_INVALID_DEVICE);
32+
throw runtime_error("Sub-groups are not supported on host device.",
33+
PI_INVALID_DEVICE);
3334
#endif
3435
}
3536
} // namespace sycl

0 commit comments

Comments
 (0)