Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 4 additions & 68 deletions sycl/include/sycl/ext/oneapi/experimental/graph/dynamic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,12 @@ class __SYCL_EXPORT dynamic_command_group {
namespace detail {
class __SYCL_EXPORT dynamic_parameter_base {
public:
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
dynamic_parameter_base(size_t ParamSize, const void *Data);
dynamic_parameter_base();
#else
dynamic_parameter_base() = default;
#endif

dynamic_parameter_base(
const std::shared_ptr<detail::dynamic_parameter_impl> &impl);

dynamic_parameter_base(const sycl::ext::oneapi::experimental::command_graph<
graph_state::modifiable>
Graph);

dynamic_parameter_base(const sycl::ext::oneapi::experimental::command_graph<
graph_state::modifiable>
Graph,
size_t ParamSize, const void *Data);

/// Common Reference Semantics
friend bool operator==(const dynamic_parameter_base &LHS,
const dynamic_parameter_base &RHS) {
Expand Down Expand Up @@ -126,13 +113,7 @@ class __SYCL_EXPORT dynamic_work_group_memory_base
public:
dynamic_work_group_memory_base() = default;

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
dynamic_work_group_memory_base(size_t BufferSizeInBytes);
#endif
// TODO: Remove in next ABI breaking window
dynamic_work_group_memory_base(
const experimental::command_graph<graph_state::modifiable> Graph,
size_t BufferSizeInBytes);

protected:
void updateWorkGroupMem(size_t NewBufferSizeInBytes);
Expand Down Expand Up @@ -171,7 +152,6 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(dynamic_work_group_memory)
// closed.
dynamic_work_group_memory() = default;

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
#ifndef __SYCL_DEVICE_ONLY__
/// Constructs a new dynamic_work_group_memory object.
/// @param Num Number of elements in the unbounded array DataT.
Expand All @@ -181,30 +161,6 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(dynamic_work_group_memory)
#else
dynamic_work_group_memory(size_t /*Num*/) {}
#endif
#endif

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_DEPRECATED("Dynamic_work_group_memory constructors taking a graph "
"object have been deprecated "
"and will be removed in the next ABI breaking window.")
#endif

#ifndef __SYCL_DEVICE_ONLY__
/// Constructs a new dynamic_work_group_memory object.
/// @param Graph The graph associated with this object.
/// @param Num Number of elements in the unbounded array DataT.
dynamic_work_group_memory(
const experimental::command_graph<graph_state::modifiable> &Graph,
size_t Num)
: detail::dynamic_work_group_memory_base(
Graph, Num * sizeof(std::remove_extent_t<DataT>)) {}

#else
dynamic_work_group_memory(
const experimental::command_graph<graph_state::modifiable> &
/* Graph */,
size_t /* Num */) {}
#endif

work_group_memory<DataT, PropertyListT> get() const {
#ifndef __SYCL_DEVICE_ONLY__
Expand Down Expand Up @@ -259,21 +215,16 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(dynamic_local_accessor)

#ifndef __SYCL_DEVICE_ONLY__
/// Constructs a new dynamic_local_accessor object.
/// @param Graph The graph associated with this object.
/// @param AllocationSize The size of the local accessor.
/// @param PropList List of properties for the underlying accessor.
dynamic_local_accessor(
const experimental::command_graph<graph_state::modifiable> & /* Graph */,
range<Dimensions> AllocationSize, const property_list &PropList = {})
dynamic_local_accessor(range<Dimensions> AllocationSize,
const property_list &PropList = {})
: detail::dynamic_local_accessor_base(
detail::convertToArrayOfN<3, 1>(AllocationSize), Dimensions,
sizeof(DataT), PropList) {}
#else
dynamic_local_accessor(
const experimental::command_graph<graph_state::modifiable> &
/* Graph */,
range<Dimensions> /* AllocationSize */,
const property_list & /*PropList */ = {}) {}
dynamic_local_accessor(range<Dimensions> /* AllocationSize */,
const property_list & /*PropList */ = {}) {}
#endif

local_accessor<DataT, Dimensions> get() const {
Expand Down Expand Up @@ -320,26 +271,11 @@ class dynamic_parameter : public detail::dynamic_parameter_base {
: sycl::detail::kernel_param_kind_t::kind_std_layout;

public:
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
/// Constructs a new dynamic parameter.
/// @param Graph The graph associated with this parameter.
/// @param Param A reference value for this parameter used for CTAD.
dynamic_parameter(const ValueT &Param)
: detail::dynamic_parameter_base(sizeof(ValueT), &Param) {}
#endif

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
__SYCL_DEPRECATED("Dynamic_parameter constructors taking a graph object have "
"been deprecated "
"and will be removed in the next ABI breaking window.")
#endif
/// Constructs a new dynamic parameter.
/// @param Graph The graph associated with this parameter.
/// @param Param A reference value for this parameter used for CTAD.
dynamic_parameter(
const experimental::command_graph<graph_state::modifiable> &Graph,
const ValueT &Param)
: detail::dynamic_parameter_base(Graph, sizeof(ValueT), &Param) {}

/// Updates this dynamic parameter and all registered nodes with a new value.
/// @param NewValue The new value for the parameter.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,9 @@ class __SYCL_EXPORT modifiable_command_graph
/// @param path The path to write the DOT file to.
/// @param verbose If true, print additional information about the nodes such
/// as kernel args or memory access where applicable.
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
void print_graph(const std::string path, bool verbose = false) const {
print_graph(sycl::detail::string_view{path}, verbose);
}
#else
void print_graph(const std::string path, bool verbose = false) const;
#endif

/// Get a list of all nodes contained in this graph.
std::vector<node> get_nodes() const;
Expand Down Expand Up @@ -216,23 +212,6 @@ class __SYCL_EXPORT modifiable_command_graph
static void checkNodePropertiesAndThrow(const property_list &Properties);
};

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
#ifdef __SYCL_GRAPH_IMPL_CPP
// Magic combination found by trial and error:
__SYCL_EXPORT
#if _WIN32
inline
#endif
#else
inline
#endif
void
modifiable_command_graph::print_graph(const std::string path,
bool verbose) const {
print_graph(sycl::detail::string_view{path}, verbose);
}
#endif

} // namespace detail
} // namespace experimental
} // namespace oneapi
Expand Down
19 changes: 2 additions & 17 deletions sycl/source/detail/graph/dynamic_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ namespace oneapi {
namespace experimental {
namespace detail {

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
dynamic_parameter_base::dynamic_parameter_base()
: impl(std::make_shared<dynamic_parameter_impl>()) {}
#endif

dynamic_parameter_base::dynamic_parameter_base(
const std::shared_ptr<detail::dynamic_parameter_impl> &impl)
: impl(impl) {}

dynamic_parameter_base::dynamic_parameter_base(
const command_graph<graph_state::modifiable>)
: impl(std::make_shared<dynamic_parameter_impl>()) {}
dynamic_parameter_base::dynamic_parameter_base(
const command_graph<graph_state::modifiable>, size_t ParamSize,
const void *Data)
dynamic_parameter_base::dynamic_parameter_base(size_t ParamSize,
const void *Data)
: impl(std::make_shared<dynamic_parameter_impl>(ParamSize, Data)) {}

void dynamic_parameter_base::updateValue(const void *NewValue, size_t Size) {
Expand All @@ -57,16 +51,7 @@ void dynamic_parameter_base::updateAccessor(
impl->updateAccessor(Acc);
}

#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
dynamic_work_group_memory_base::dynamic_work_group_memory_base(
size_t BufferSizeInBytes)
: dynamic_parameter_base(
std::make_shared<dynamic_work_group_memory_impl>(BufferSizeInBytes)) {
}
#endif

dynamic_work_group_memory_base::dynamic_work_group_memory_base(
const experimental::command_graph<graph_state::modifiable> /* Graph */,
size_t BufferSizeInBytes)
: dynamic_parameter_base(
std::make_shared<dynamic_work_group_memory_impl>(BufferSizeInBytes)) {
Expand Down
7 changes: 0 additions & 7 deletions sycl/source/detail/graph/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,6 @@ class graph_impl : public std::enable_shared_from_this<graph_impl> {
/// @return Context associated with graph.
sycl::context getContext() const { return MContext; }

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
/// Query for the context impl tied to this graph.
/// @return shared_ptr ref for the context impl associated with graph.
const std::shared_ptr<sycl::detail::context_impl> &getContextImplPtr() const {
return sycl::detail::getSyclObjImpl(MContext);
}
#endif
sycl::detail::context_impl &getContextImpl() const {
return *sycl::detail::getSyclObjImpl(MContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main() {
std::vector<int> HostDataA(Size);

exp_ext::command_graph Graph{Ctxt, Queue.get_device()};
exp_ext::dynamic_work_group_memory<int[]> DynLocalMem{Graph, LocalSize};
exp_ext::dynamic_work_group_memory<int[]> DynLocalMem{LocalSize};

Queue.memset(PtrA, 0, Size * sizeof(int)).wait();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main() {
Queue.memset(PtrA, 0, Size * sizeof(int)).wait();
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_0>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main() {
Queue.memset(PtrA, 0, Size * sizeof(int)).wait();
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_1>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main() {
Queue.memset(PtrA, 0, N * sizeof(int)).wait();
Queue.memset(PtrB, 0, N * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_2>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main() {
Queue.memset(PtrA, 0, Size * sizeof(int)).wait();
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_0>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main() {
Queue.memset(PtrA, 0, N * sizeof(int)).wait();
Queue.memset(PtrB, 0, N * sizeof(int)).wait();

exp_ext::dynamic_parameter DynParam(Graph, PtrA);
exp_ext::dynamic_parameter DynParam(PtrA);

nd_range<3> NDRange{GlobalWorkSize, LocalWorkSize};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main() {
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();
Queue.memset(PtrUnused, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_0>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main() {
Queue.memset(PtrA, 0, Size * sizeof(int)).wait();
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id_A = exp_ext::get_kernel_id<ff_0>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ int main() {
Queue.memcpy(PtrB, HostDataB.data(), Size * sizeof(int)).wait();
Queue.memset(PtrC, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter ParamA(Graph, PtrA);
exp_ext::dynamic_parameter ParamB(Graph, PtrB);
exp_ext::dynamic_parameter ParamOut(Graph, PtrC);
exp_ext::dynamic_parameter ParamA(PtrA);
exp_ext::dynamic_parameter ParamB(PtrB);
exp_ext::dynamic_parameter ParamOut(PtrC);

nd_range<1> NDRange{Size, 32};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main() {
Queue.memset(PtrA, 0, Size * sizeof(int)).wait();
Queue.memset(PtrB, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(SubGraph, PtrA);
exp_ext::dynamic_parameter InputParam(PtrA);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id SubKernel_id = exp_ext::get_kernel_id<ff_1>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main() {

Queue.memset(DeviceData, 0, Size * sizeof(int)).wait();

exp_ext::dynamic_parameter InputParam(Graph, ScalarValue);
exp_ext::dynamic_parameter InputParam(ScalarValue);

kernel_bundle Bundle = get_kernel_bundle<bundle_state::executable>(Ctxt);
kernel_id Kernel_id = exp_ext::get_kernel_id<ff_6>();
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/Update/dyn_cgf_with_all_dyn_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ int main() {
std::vector<int> HostDataB(Size);
std::vector<int> HostDataC(Size);

exp_ext::dynamic_parameter DynParam1(Graph, PtrA);
exp_ext::dynamic_parameter DynParam2(Graph, PtrC);
exp_ext::dynamic_parameter DynParam1(PtrA);
exp_ext::dynamic_parameter DynParam2(PtrC);

auto CGFA = [&](handler &CGH) {
CGH.set_arg(0, DynParam1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ int main() {
std::vector<int> HostDataC(Size);

int ScalarValue = 17;
exp_ext::dynamic_parameter DynParamScalar(Graph, ScalarValue);
exp_ext::dynamic_parameter DynParamPtr(Graph, PtrA);
exp_ext::dynamic_parameter DynParamScalar(ScalarValue);
exp_ext::dynamic_parameter DynParamPtr(PtrA);

// Kernel has 2 dynamic parameters, one of scalar type & one of ptr type
auto CGFA = [&](handler &CGH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main() {
std::vector<int> HostDataA(Size);
std::vector<int> HostDataB(Size);

exp_ext::dynamic_local_accessor<int, 1> DynLocalMem(Graph, LocalSizeA);
exp_ext::dynamic_local_accessor<int, 1> DynLocalMem(LocalSizeA);

nd_range<1> NDrangeA{Size, LocalSizeA};
auto CGFA = [&](handler &CGH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main() {
std::vector<int> HostDataA(Size);
std::vector<int> HostDataB(Size);

exp_ext::dynamic_work_group_memory<int[]> DynLocalMem(Graph, LocalSizeA);
exp_ext::dynamic_work_group_memory<int[]> DynLocalMem(LocalSizeA);

nd_range<1> NDrangeA{Size, LocalSizeA};
auto CGFA = [&](handler &CGH) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int main() {
std::vector<int> HostDataB(Size);
std::vector<int> HostDataC(Size);

exp_ext::dynamic_parameter DynParam(Graph, PtrA);
exp_ext::dynamic_parameter DynParam(PtrA);

auto CGFA = [&](handler &CGH) {
CGH.set_arg(0, DynParam);
Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/Graph/Update/dyn_local_accessor_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main() {
int *PtrA = malloc_device<T>(Size, Queue);
std::vector<T> HostDataA(Size);

exp_ext::dynamic_local_accessor<T, 1> DynLocalMem{Graph, LocalSize};
exp_ext::dynamic_local_accessor<T, 1> DynLocalMem{LocalSize};

Queue.memset(PtrA, 0, Size * sizeof(T)).wait();

Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/Graph/Update/dyn_local_accessor_multiple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ int main() {
int *PtrA = malloc_device<T>(Size, Queue);
std::vector<T> HostDataA(Size);

exp_ext::dynamic_local_accessor<T, 1> DynLocalMemA{Graph, LocalSize};
exp_ext::dynamic_local_accessor<T, 1> DynLocalMemB{Graph, LocalSize};
exp_ext::dynamic_local_accessor<T, 1> DynLocalMemA{LocalSize};
exp_ext::dynamic_local_accessor<T, 1> DynLocalMemB{LocalSize};

Queue.memset(PtrA, 0, Size * sizeof(T)).wait();

Expand Down
Loading
Loading