Skip to content

Commit ad30097

Browse files
[NFC][SYCL] Reduce dependencies of <sycl/group.hpp> (#20090)
1 parent 05ea3e9 commit ad30097

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

sycl/include/sycl/detail/fwd/multi_ptr.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ inline namespace _V1 {
1616
template <typename ElementType, access::address_space Space,
1717
access::decorated DecorateAddress>
1818
class multi_ptr;
19+
template <access::address_space Space, access::decorated DecorateAddress,
20+
typename ElementType>
21+
multi_ptr<ElementType, Space, DecorateAddress>
22+
address_space_cast(ElementType *pointer);
1923
} // namespace _V1
2024
} // namespace sycl

sycl/include/sycl/group.hpp

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

99
#pragma once
1010

11-
#include <sycl/__spirv/spirv_types.hpp> // for Scope, __ocl_event_t
12-
#include <sycl/access/access.hpp> // for decorated, mode, addr...
13-
#include <sycl/detail/common.hpp> // for NDLoop, __SYCL_ASSERT
14-
#include <sycl/detail/defines.hpp> // for __SYCL_TYPE
15-
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
11+
#include <sycl/__spirv/spirv_types.hpp> // for Scope, __ocl_event_t
12+
#include <sycl/access/access.hpp> // for decorated, mode, addr...
13+
#include <sycl/detail/common.hpp> // for NDLoop
14+
#include <sycl/detail/defines.hpp> // for __SYCL_TYPE
15+
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
16+
#include <sycl/detail/fwd/multi_ptr.hpp>
1617
#include <sycl/detail/generic_type_traits.hpp> // for convertToOpenCLType
1718
#include <sycl/detail/helpers.hpp> // for Builder, getSPIRVMemo...
18-
#include <sycl/detail/item_base.hpp> // for id, range
1919
#include <sycl/detail/type_traits.hpp> // for is_bool, change_base_...
2020
#include <sycl/device_event.hpp> // for device_event
21-
#include <sycl/exception.hpp> // for make_error_code, errc
22-
#include <sycl/h_item.hpp> // for h_item
2321
#include <sycl/id.hpp> // for id
2422
#include <sycl/item.hpp> // for item
2523
#include <sycl/memory_enums.hpp> // for memory_scope
26-
#include <sycl/multi_ptr.hpp> // for multi_ptr, address_sp...
2724
#include <sycl/pointers.hpp> // for decorated_global_ptr
2825
#include <sycl/range.hpp> // for range
2926

30-
#include <memory> // for unique_ptr
27+
#ifndef __SYCL_DEVICE_ONLY__
28+
#include <sycl/exception.hpp>
29+
30+
#include <memory> // for unique_ptr
31+
#endif
32+
3133
#include <stddef.h> // for size_t
3234
#include <stdint.h> // for uint8_t, uint32_t
3335
#include <type_traits> // for enable_if_t, remove_c...
3436

3537
namespace sycl {
3638
inline namespace _V1 {
37-
namespace detail {
38-
class Builder;
39+
template <int Dimensions> class h_item;
3940

41+
namespace detail {
4042
// Implements a barrier accross work items within a work group.
4143
inline void workGroupBarrier() {
4244
#ifdef __SYCL_DEVICE_ONLY__

sycl/test/include_deps/sycl_detail_core.hpp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595
// CHECK-NEXT: detail/kernel_desc.hpp
9696
// CHECK-NEXT: group.hpp
9797
// CHECK-NEXT: device_event.hpp
98-
// CHECK-NEXT: h_item.hpp
9998
// CHECK-NEXT: item.hpp
99+
// CHECK-NEXT: h_item.hpp
100100
// CHECK-NEXT: kernel_handler.hpp
101101
// CHECK-NEXT: nd_item.hpp
102102
// CHECK-NEXT: nd_range.hpp

0 commit comments

Comments
 (0)