Skip to content

Commit 11c23d2

Browse files
committed
Move MArgs and MDynamicParameters to KernelData
1 parent 20ea292 commit 11c23d2

File tree

12 files changed

+450
-357
lines changed

12 files changed

+450
-357
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
namespace sycl {
2020
inline namespace _V1 {
21-
class handler;
2221

2322
namespace detail {
23+
class KernelData;
24+
2425
template <typename T> struct is_unbounded_array : std::false_type {};
2526

2627
template <typename T> struct is_unbounded_array<T[]> : std::true_type {};
@@ -38,7 +39,7 @@ class work_group_memory_impl {
3839

3940
private:
4041
size_t buffer_size;
41-
friend class sycl::handler;
42+
friend class KernelData;
4243
};
4344

4445
} // namespace detail

sycl/include/sycl/handler.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,23 +501,21 @@ class __SYCL_EXPORT handler {
501501
extractArgsAndReqsFromLambda(char *LambdaPtr, size_t KernelArgsNum,
502502
const detail::kernel_param_desc_t *KernelArgs,
503503
bool IsESIMD);
504-
#endif
505504
/// Extracts and prepares kernel arguments from the lambda using information
506505
/// from the built-ins or integration header.
507506
void extractArgsAndReqsFromLambda(
508507
char *LambdaPtr, detail::kernel_param_desc_t (*ParamDescGetter)(int),
509508
size_t NumKernelParams, bool IsESIMD);
510-
509+
#endif
511510
/// Extracts and prepares kernel arguments set via set_arg(s).
512511
void extractArgsAndReqs();
513512

514-
#if defined(__INTEL_PREVIEW_BREAKING_CHANGES)
515-
// TODO: processArg need not to be public
516-
__SYCL_DLL_LOCAL
517-
#endif
513+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
514+
// TODO: remove in the next ABI-breaking window.
518515
void processArg(void *Ptr, const detail::kernel_param_kind_t &Kind,
519516
const int Size, const size_t Index, size_t &IndexShift,
520517
bool IsKernelCreatedFromSource, bool IsESIMD);
518+
#endif
521519

522520
/// \return a string containing name of SYCL kernel.
523521
detail::ABINeutralKernelNameStrT getKernelName();
@@ -3608,7 +3606,10 @@ class __SYCL_EXPORT handler {
36083606

36093607
void addArg(detail::kernel_param_kind_t ArgKind, void *Req, int AccessTarget,
36103608
int ArgIndex);
3609+
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
3610+
// TODO: remove in the next ABI-breaking window
36113611
void clearArgs();
3612+
#endif
36123613
void setArgsToAssociatedAccessors();
36133614

36143615
bool HasAssociatedAccessor(detail::AccessorImplHost *Req,

sycl/include/sycl/stream.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ inline namespace _V1 {
4242
namespace detail {
4343

4444
class stream_impl;
45+
class KernelData;
4546

4647
using FmtFlags = unsigned int;
4748

@@ -1041,7 +1042,7 @@ class __SYCL_EXPORT __SYCL_SPECIAL_CLASS __SYCL_TYPE(stream) stream
10411042
}
10421043
#endif
10431044

1044-
friend class handler;
1045+
friend class detail::KernelData;
10451046

10461047
template <typename SYCLObjT> friend class ext::oneapi::weak_object;
10471048

sycl/source/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ set(SYCL_COMMON_SOURCES
267267
"detail/device_filter.cpp"
268268
"detail/host_pipe_map.cpp"
269269
"detail/device_global_map.cpp"
270+
"detail/kernel_data.cpp"
270271
"detail/kernel_global_info.cpp"
271272
"detail/device_global_map_entry.cpp"
272273
"detail/device_image_impl.cpp"

sycl/source/detail/graph/dynamic_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ void dynamic_command_group_impl::finalizeCGFList(
343343
MCommandGroups.push_back(std::shared_ptr<sycl::detail::CG>(RawCGPtr));
344344

345345
// Track dynamic_parameter usage in command-group
346-
auto &DynamicParams = Handler.impl->MDynamicParameters;
346+
auto &DynamicParams = Handler.impl->MKernelData.getDynamicParameters();
347347

348348
if (DynamicParams.size() > 0 &&
349349
Handler.getType() == sycl::detail::CGType::CodeplayHostTask) {

sycl/source/detail/graph/graph_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ node_impl &graph_impl::add(std::function<void(handler &)> CGF,
471471

472472
// Retrieve any dynamic parameters which have been registered in the CGF and
473473
// register the actual nodes with them.
474-
auto &DynamicParams = Handler.impl->MDynamicParameters;
474+
auto &DynamicParams = Handler.impl->MKernelData.getDynamicParameters();
475475

476476
if (NodeType != node_type::kernel && DynamicParams.size() > 0) {
477477
throw sycl::exception(sycl::make_error_code(errc::invalid),

sycl/source/detail/handler_impl.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,12 @@ class handler_impl {
134134
sycl::ext::oneapi::experimental::node_type MUserFacingNodeType =
135135
sycl::ext::oneapi::experimental::node_type::empty;
136136

137-
// Storage for any SYCL Graph dynamic parameters which have been flagged for
138-
// registration in the CG, along with the argument index for the parameter.
139-
std::vector<std::pair<
140-
ext::oneapi::experimental::detail::dynamic_parameter_impl *, int>>
141-
MDynamicParameters;
142-
143137
/// The storage for the arguments passed.
144138
/// We need to store a copy of values that are passed explicitly through
145139
/// set_arg, require and so on, because we need them to be alive after
146140
/// we exit the method they are passed in.
147141
detail::CG::StorageInitHelper CGData;
148142

149-
/// The list of arguments for the kernel.
150-
std::vector<detail::ArgDesc> MArgs;
151-
152143
/// The list of associated accessors with this handler.
153144
/// These accessors were created with this handler as argument or
154145
/// have become required for this handler via require method.

0 commit comments

Comments
 (0)