Skip to content

Commit 092194d

Browse files
sorted includes in graph files
1 parent ec268c1 commit 092194d

File tree

7 files changed

+80
-91
lines changed

7 files changed

+80
-91
lines changed

sycl/include/sycl/ext/oneapi/experimental/graph.hpp

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@
88

99
#pragma once
1010

11-
#include <sycl/context.hpp> // for context
1211
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
1312
#include <sycl/detail/owner_less_base.hpp> // for OwnerLessBase
14-
#include <sycl/detail/property_helper.hpp> // for DataLessPropKind, PropWith...
1513
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
16-
#include <sycl/detail/string_view.hpp>
14+
#include <sycl/detail/string_view.hpp> // for string_view
1715
#endif
18-
#include <sycl/device.hpp> // for device
19-
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph properties classes and graph_state
16+
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph_state
2017
#include <sycl/ext/oneapi/experimental/graph_node.hpp> // for node class
21-
#include <sycl/ext/oneapi/properties/properties.hpp> // for empty_properties_t
22-
#include <sycl/nd_range.hpp> // for range, nd_range
23-
#include <sycl/properties/property_traits.hpp> // for is_property, is_property_of
24-
#include <sycl/property_list.hpp> // for property_list
18+
#include <sycl/property_list.hpp> // for property_list
2519

2620
#include <functional> // for function
2721
#include <memory> // for shared_ptr
@@ -30,22 +24,21 @@
3024

3125
namespace sycl {
3226
inline namespace _V1 {
27+
// Forward declarations
3328
class handler;
3429
class queue;
3530
class device;
36-
class node;
37-
38-
namespace detail {
39-
class CG;
40-
} // namespace detail
31+
class context;
4132

4233
namespace ext {
4334
namespace oneapi {
4435
namespace experimental {
36+
// Forward declarations
4537
template <graph_state State> class command_graph;
4638
class dynamic_command_group;
4739

4840
namespace detail {
41+
// Forward declarations
4942
class graph_impl;
5043
class exec_graph_impl;
5144

@@ -337,56 +330,6 @@ class __SYCL_EXPORT executable_command_graph
337330

338331
std::shared_ptr<detail::exec_graph_impl> impl;
339332
};
340-
341-
class dynamic_command_group_impl
342-
: public std::enable_shared_from_this<dynamic_command_group_impl> {
343-
public:
344-
dynamic_command_group_impl(
345-
const command_graph<graph_state::modifiable> &Graph);
346-
347-
/// Returns the index of the active command-group
348-
size_t getActiveIndex() const { return MActiveCGF; }
349-
350-
/// Returns the number of CGs in the dynamic command-group.
351-
size_t getNumCGs() const { return MCommandGroups.size(); }
352-
353-
/// Set the index of the active command-group.
354-
/// @param Index The new index.
355-
void setActiveIndex(size_t Index);
356-
357-
/// Instantiates a command-group object for each CGF in the list.
358-
/// @param CGFList List of CGFs to finalize with a handler into CG objects.
359-
void
360-
finalizeCGFList(const std::vector<std::function<void(handler &)>> &CGFList);
361-
362-
/// Retrieve CG at the currently active index
363-
/// @param Shared pointer to the active CG object.
364-
std::shared_ptr<sycl::detail::CG> getActiveCG() const {
365-
return MCommandGroups[MActiveCGF];
366-
}
367-
368-
unsigned long long getID() const { return MID; }
369-
370-
/// Type of the CGs in this dynamic command-group
371-
sycl::detail::CGType MCGType = sycl::detail::CGType::None;
372-
373-
/// Graph this dynamic command-group is associated with.
374-
std::shared_ptr<graph_impl> MGraph;
375-
376-
/// Index of active command-group
377-
std::atomic<size_t> MActiveCGF;
378-
379-
/// List of command-groups for dynamic command-group nodes
380-
std::vector<std::shared_ptr<sycl::detail::CG>> MCommandGroups;
381-
382-
/// List of nodes using this dynamic command-group.
383-
std::vector<std::weak_ptr<node_impl>> MNodes;
384-
385-
private:
386-
unsigned long long MID;
387-
// Used for std::hash in order to create a unique hash for the instance.
388-
inline static std::atomic<unsigned long long> NextAvailableID = 0;
389-
};
390333
} // namespace detail
391334

392335
/// Graph in the modifiable state.

sycl/include/sycl/ext/oneapi/experimental/graph_dynamic.hpp

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

99
#pragma once
1010

11-
#include <sycl/accessor.hpp> // for detail::AccessorBaseHost
12-
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
13-
#include <sycl/detail/kernel_desc.hpp> // for kernel_param_kind_t
14-
#include <sycl/detail/property_helper.hpp> // for DataLessPropKind, PropWith...
11+
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
12+
#include <sycl/detail/kernel_desc.hpp> // for kernel_param_kind_t
1513
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph_state
16-
#include <sycl/ext/oneapi/experimental/graph_node.hpp> // for command_graph class
17-
#include <sycl/ext/oneapi/experimental/work_group_memory.hpp> // for dynamic_work_group_memory
14+
#include <sycl/ext/oneapi/experimental/work_group_memory.hpp> // for work_group_memory
1815
#include <sycl/ext/oneapi/properties/properties.hpp> // for empty_properties_t
19-
#include <sycl/property_list.hpp> // for property_list
2016

2117
#include <functional> // for function
2218
#include <memory> // for shared_ptr
2319
#include <vector> // for vector
2420

2521
namespace sycl {
2622
inline namespace _V1 {
27-
28-
// Forward declare sycl:: classes
23+
// Forward declarations
2924
class handler;
25+
class property_list;
26+
27+
namespace detail {
28+
// Forward declarations
29+
class AccessorBaseHost;
30+
} // namespace detail
31+
3032
namespace ext {
3133
namespace oneapi {
3234
namespace experimental {
33-
34-
// Forward declare ext::oneapi::experimental classes
35+
// Forward declarations
36+
class raw_kernel_arg;
3537
template <graph_state State> class command_graph;
3638
template <typename, typename> class work_group_memory;
37-
class raw_kernel_arg;
3839

3940
namespace detail {
40-
// Forward declare ext::oneapi::experimental::detail classes
41+
// Forward declarations
4142
class dynamic_parameter_impl;
4243
class dynamic_command_group_impl;
4344
} // namespace detail
@@ -335,7 +336,8 @@ class dynamic_parameter : public detail::dynamic_parameter_base {
335336
const ValueT &Param)
336337
: detail::dynamic_parameter_base(Graph, sizeof(ValueT), &Param) {}
337338

338-
/// Updates this dynamic parameter and all registered nodes with a new value.
339+
/// Updates this dynamic parameter and all registered nodes with a new
340+
/// value.
339341
/// @param NewValue The new value for the parameter.
340342
void update(const ValueT &NewValue) {
341343
if constexpr (IsAccessor) {

sycl/include/sycl/ext/oneapi/experimental/graph_node.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
#pragma once
1010

1111
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
12-
#include <sycl/detail/kernel_desc.hpp> // for kernel_param_kind_t
13-
#include <sycl/detail/property_helper.hpp> // for DataLessPropKind, PropWith...
12+
#include <sycl/detail/property_helper.hpp> // for PropertyWith...
1413
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph properties classes
1514
#include <sycl/nd_range.hpp> // for range, nd_range
1615

1716
#include <memory> // for shared_ptr
18-
#include <vector> // for vector
17+
#include <vector> // for vector, hash
1918

2019
namespace sycl {
2120
inline namespace _V1 {

sycl/source/detail/graph_dynamic_impl.hpp

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,82 @@
1010

1111
#include <detail/accessor_impl.hpp> // for LocalAccessorImplHost
1212
#include <sycl/detail/cg_types.hpp> // for CGType
13+
#include <sycl/ext/oneapi/experimental/detail/properties/graph_properties.hpp> // for graph_state
1314
#include <sycl/ext/oneapi/experimental/raw_kernel_arg.hpp> // for raw_kernel_arg
1415

1516
#include <cstring> // for memcpy
1617
#include <vector> // for vector
1718

1819
namespace sycl {
1920
inline namespace _V1 {
20-
2121
// Forward declarations
2222
class handler;
2323

2424
namespace detail {
25-
2625
// Forward declarations
2726
class CG;
2827
} // namespace detail
2928

3029
namespace ext {
3130
namespace oneapi {
3231
namespace experimental {
33-
namespace detail {
32+
// Forward declarations
33+
template <graph_state State> class command_graph;
3434

35+
namespace detail {
3536
// Forward declarations
3637
class node_impl;
37-
class dynamic_command_group_impl;
38+
class graph_impl;
39+
40+
class dynamic_command_group_impl
41+
: public std::enable_shared_from_this<dynamic_command_group_impl> {
42+
public:
43+
dynamic_command_group_impl(
44+
const command_graph<graph_state::modifiable> &Graph);
45+
46+
/// Returns the index of the active command-group
47+
size_t getActiveIndex() const { return MActiveCGF; }
48+
49+
/// Returns the number of CGs in the dynamic command-group.
50+
size_t getNumCGs() const { return MCommandGroups.size(); }
51+
52+
/// Set the index of the active command-group.
53+
/// @param Index The new index.
54+
void setActiveIndex(size_t Index);
55+
56+
/// Instantiates a command-group object for each CGF in the list.
57+
/// @param CGFList List of CGFs to finalize with a handler into CG objects.
58+
void
59+
finalizeCGFList(const std::vector<std::function<void(handler &)>> &CGFList);
60+
61+
/// Retrieve CG at the currently active index
62+
/// @param Shared pointer to the active CG object.
63+
std::shared_ptr<sycl::detail::CG> getActiveCG() const {
64+
return MCommandGroups[MActiveCGF];
65+
}
66+
67+
unsigned long long getID() const { return MID; }
68+
69+
/// Type of the CGs in this dynamic command-group
70+
sycl::detail::CGType MCGType = sycl::detail::CGType::None;
71+
72+
/// Graph this dynamic command-group is associated with.
73+
std::shared_ptr<graph_impl> MGraph;
74+
75+
/// Index of active command-group
76+
std::atomic<size_t> MActiveCGF;
77+
78+
/// List of command-groups for dynamic command-group nodes
79+
std::vector<std::shared_ptr<sycl::detail::CG>> MCommandGroups;
80+
81+
/// List of nodes using this dynamic command-group.
82+
std::vector<std::weak_ptr<node_impl>> MNodes;
83+
84+
private:
85+
unsigned long long MID;
86+
// Used for std::hash in order to create a unique hash for the instance.
87+
inline static std::atomic<unsigned long long> NextAvailableID = 0;
88+
};
3889

3990
class dynamic_parameter_impl {
4091
public:

sycl/source/detail/graph_impl.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@
2525

2626
namespace sycl {
2727
inline namespace _V1 {
28-
2928
// Forward declarations
3029
class handler;
3130

3231
namespace detail {
33-
3432
// Forward declarations
3533
class SYCLMemObjT;
3634
class queue_impl;
@@ -42,12 +40,10 @@ class CG;
4240
namespace ext {
4341
namespace oneapi {
4442
namespace experimental {
45-
4643
// Forward declarations
4744
template <graph_state State> class command_graph;
4845

4946
namespace detail {
50-
5147
// Forward declarations
5248
class dynamic_command_group_impl;
5349

sycl/source/detail/graph_memory_pool.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ namespace ext {
2121
namespace oneapi {
2222
namespace experimental {
2323
namespace detail {
24-
2524
// Forward declarations
2625
class node_impl;
2726

sycl/source/detail/graph_node_impl.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace ext {
2626
namespace oneapi {
2727
namespace experimental {
2828
namespace detail {
29-
3029
// Forward declarations
3130
class node_impl;
3231
class exec_graph_impl;

0 commit comments

Comments
 (0)