Skip to content

Commit a84c5e3

Browse files
authored
Revert "[SYCL] Add implementation of sycl::intel::barrier (#2198)"
This reverts commit 3df81ac.
1 parent e65841b commit a84c5e3

File tree

4 files changed

+1
-129
lines changed

4 files changed

+1
-129
lines changed

sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ John Pennycook, Intel (john 'dot' pennycook 'at' intel 'dot' com)
5151

5252
== Dependencies
5353

54-
This extension is written against the SYCL 1.2.1 specification, Revision v1.2.1-6 and the following extensions:
55-
56-
- +SYCL_INTEL_extended_atomics+
54+
This extension is written against the SYCL 1.2.1 specification, Revision v1.2.1-6.
5755

5856
== Overview
5957

@@ -69,10 +67,6 @@ The extension introduces the following functions:
6967
- +reduce+
7068
- +exclusive_scan+
7169
- +inclusive_scan+
72-
- +barrier+
73-
74-
The definitions and behavior of the following functions are based on equivalents in the SYCL 2020 provisional specification:
75-
- +barrier+
7670

7771
=== Alignment with OpenCL vs C++
7872

@@ -258,21 +252,6 @@ The return types of the collective functions in {cpp}17 are not deduced from the
258252
|Perform an inclusive scan over the values in the range [_first_, _last_) using the operator _binary_op_, which must be one of the group algorithms library function objects. The value written to +result + i+ is the inclusive scan of the first +i+ values in the range and an initial value specified by _init_. Returns a pointer to the end of the output range. _first_, _last_, _result_, _binary_op_ and _init_ must be the same for all work-items in the group. _binary_op(init, *first)_ must return a value of type _T_.
259253
|===
260254

261-
==== Synchronization
262-
263-
The behavior of memory fences in this section is aligned with the single happens-before relationship defined by the +SYCL_INTEL_extended_atomics+ extension.
264-
265-
|===
266-
|Function|Description
267-
268-
|+template <typename Group> void barrier(Group g);+
269-
|Synchronize all work-items in the group, and ensure that all memory accesses to any address space prior to the barrier are visible to all work-items in the group after the barrier. The scope of the group memory fences implied by this barrier is the narrowest scope including all work-items in the group.
270-
271-
|+template <typename Group> void barrier(Group g, memory_scope scope);+
272-
|Synchronize all work-items in the group, and ensure that all memory accesses to any address space prior to the barrier are visible to all work-items specified by _scope_ after the barrier. The scope of the group memory fences implied by this barrier is controlled by _scope_ and must be broader than the narrowest scope including all work-items in the group. If the specified _scope_ is narrower than the narrowest scope including all work-items in the group, the _scope_ argument is ignored.
273-
274-
|===
275-
276255
== Issues
277256

278257
None.
@@ -291,7 +270,6 @@ None.
291270
|========================================
292271
|Rev|Date|Author|Changes
293272
|1|2020-01-30|John Pennycook|*Initial public working draft*
294-
|2|2020-07-28|John Pennycook|*Add group barrier*
295273
|========================================
296274
297275
//************************************************************************

sycl/doc/extensions/SubGroupAlgorithms/SYCL_INTEL_sub_group_algorithms.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ This extension adds sub-group support to all of the functions from +SYCL_INTEL_g
7070
- +reduce+
7171
- +exclusive_scan+
7272
- +inclusive_scan+
73-
- +barrier+
7473

7574
It additionally introduces a number of functions that are currently specific to sub-groups:
7675

@@ -166,7 +165,6 @@ None.
166165
|========================================
167166
|Rev|Date|Author|Changes
168167
|1|2020-03-16|John Pennycook|*Initial public working draft*
169-
|2|2020-07-28|John Pennycook|*Add group barrier*
170168
|========================================
171169
172170
//************************************************************************

sycl/include/CL/sycl/intel/group_algorithm.hpp

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <CL/sycl/detail/spirv.hpp>
1414
#include <CL/sycl/detail/type_traits.hpp>
1515
#include <CL/sycl/group.hpp>
16-
#include <CL/sycl/intel/atomic.hpp>
1716
#include <CL/sycl/intel/functional.hpp>
1817
#include <CL/sycl/intel/sub_group.hpp>
1918

@@ -78,15 +77,6 @@ template <> inline id<3> linear_id_to_id(range<3> r, size_t linear_id) {
7877
return result;
7978
}
8079

81-
// TODO: Replace with Group::fence_scope from SYCL 2020 provisional
82-
template <typename Group> struct FenceScope {
83-
static constexpr intel::memory_scope value = intel::memory_scope::work_group;
84-
};
85-
86-
template <> struct FenceScope<intel::sub_group> {
87-
static constexpr intel::memory_scope value = intel::memory_scope::sub_group;
88-
};
89-
9080
template <typename T, class BinaryOperation> struct identity {};
9181

9282
template <typename T, typename V> struct identity<T, intel::plus<V>> {
@@ -906,42 +896,6 @@ template <typename Group> bool leader(Group g) {
906896
#endif
907897
}
908898

909-
template <typename Group> void barrier(Group, memory_scope scope) {
910-
static_assert(sycl::detail::is_generic_group<Group>::value,
911-
"Group algorithms only support the sycl::group and "
912-
"intel::sub_group class.");
913-
#ifdef __SYCL_DEVICE_ONLY__
914-
// MemoryScope must be broader than Group scope for correctness
915-
auto GroupScope = detail::FenceScope<Group>::value;
916-
auto BroadestScope = (scope > GroupScope) ? scope : GroupScope;
917-
auto MemoryScope = sycl::detail::spirv::getScope(BroadestScope);
918-
auto ExecutionScope = sycl::detail::spirv::group_scope<Group>::value;
919-
__spirv_ControlBarrier(ExecutionScope, MemoryScope,
920-
__spv::MemorySemanticsMask::AcquireRelease |
921-
__spv::MemorySemanticsMask::SubgroupMemory |
922-
__spv::MemorySemanticsMask::WorkgroupMemory |
923-
__spv::MemorySemanticsMask::CrossWorkgroupMemory);
924-
#else
925-
(void)scope;
926-
throw runtime_error("Group algorithms are not supported on host device.",
927-
PI_INVALID_DEVICE);
928-
#endif
929-
}
930-
931-
template <typename Group> void barrier(Group g) {
932-
static_assert(sycl::detail::is_generic_group<Group>::value,
933-
"Group algorithms only support the sycl::group and "
934-
"intel::sub_group class.");
935-
#ifdef __SYCL_DEVICE_ONLY__
936-
auto MemoryScope = detail::FenceScope<Group>::value;
937-
barrier(g, MemoryScope);
938-
#else
939-
(void)g;
940-
throw runtime_error("Group algorithms are not supported on host device.",
941-
PI_INVALID_DEVICE);
942-
#endif
943-
}
944-
945899
} // namespace intel
946900
} // namespace sycl
947901
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/test/group-algorithm/barrier.cpp

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)