Skip to content

Commit 86acba4

Browse files
author
Ewan Crawford
committed
[SYCL][Graph] Remove assume_data_outlives_buffer property
Implements spec feedback to remove this property, goes with spec PR #311
1 parent cb49b0b commit 86acba4

21 files changed

+16
-175
lines changed

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,6 @@ class assume_buffer_outlives_graph
117117
public:
118118
assume_buffer_outlives_graph() = default;
119119
};
120-
121-
/// Property passed to command_graph constructor to allow buffers created with
122-
/// host pointers. Passing this property represents a promise from the user that
123-
/// the host data will outlive the buffer and by extension any graph that it is
124-
/// used in.
125-
///
126-
class assume_data_outlives_buffer
127-
: public ::sycl::detail::DataLessProperty<
128-
::sycl::detail::GraphAssumeDataOutlivesBuffer> {
129-
public:
130-
assume_data_outlives_buffer() = default;
131-
};
132-
133120
} // namespace graph
134121

135122
namespace node {

sycl/source/detail/graph_impl.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ graph_impl::add(sycl::detail::CG::CGTYPE CGType,
271271
for (auto &Req : Requirements) {
272272
// Track and mark the memory objects being used by the graph.
273273
auto MemObj = static_cast<sycl::detail::SYCLMemObjT *>(Req->MSYCLMemObj);
274-
if (MemObj->getUserPtr() && !MAllowBuffersHostPointers) {
275-
throw sycl::exception(
276-
make_error_code(errc::invalid),
277-
"Cannot use a buffer which was created with a host pointer in a "
278-
"graph without passing the assume_data_outlives_buffer property on "
279-
"Graph construction.");
280-
}
281274
bool WasInserted = MMemObjs.insert(MemObj).second;
282275
if (WasInserted) {
283276
MemObj->markBeingUsedInGraph();

sycl/source/detail/graph_impl.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,6 @@ class graph_impl {
305305
if (PropList.has_property<property::graph::no_cycle_check>()) {
306306
MSkipCycleChecks = true;
307307
}
308-
if (PropList.has_property<property::graph::assume_data_outlives_buffer>()) {
309-
MAllowBuffersHostPointers = true;
310-
}
311308
if (PropList
312309
.has_property<property::graph::assume_buffer_outlives_graph>()) {
313310
MAllowBuffers = true;
@@ -615,11 +612,6 @@ class graph_impl {
615612
/// Unique set of SYCL Memory Objects which are currently in use in the graph.
616613
std::set<sycl::detail::SYCLMemObjT *> MMemObjs;
617614

618-
/// Controls whether we allow buffers that are created with host pointers to
619-
/// be used in the graph. Set by the presence of the
620-
/// assume_data_outlives_buffer property.
621-
bool MAllowBuffersHostPointers = false;
622-
623615
/// Controls whether we allow buffers to be used in the graph. Set by the
624616
/// presence of the assume_buffer_outlives_graph property.
625617
bool MAllowBuffers = false;

sycl/test-e2e/Graph/Explicit/assume_data_outlives_buffer_property.cpp

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

sycl/test-e2e/Graph/Inputs/assume_data_outlives_buffer_property.cpp

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

sycl/test-e2e/Graph/Inputs/basic_buffer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ int main() {
2828
exp_ext::command_graph Graph{
2929
Queue.get_context(),
3030
Queue.get_device(),
31-
{exp_ext::property::graph::assume_buffer_outlives_graph{},
32-
exp_ext::property::graph::assume_data_outlives_buffer{}}};
31+
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};
3332

3433
// Add commands to graph
3534
add_nodes(Graph, Queue, Size, BufferA, BufferB, BufferC);

sycl/test-e2e/Graph/Inputs/buffer_copy.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ int main() {
3737
exp_ext::command_graph Graph{
3838
Queue.get_context(),
3939
Queue.get_device(),
40-
{exp_ext::property::graph::assume_buffer_outlives_graph{},
41-
exp_ext::property::graph::assume_data_outlives_buffer{}}};
40+
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};
4241

4342
// Copy from B to A
4443
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {

sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ int main() {
3838
exp_ext::command_graph Graph{
3939
Queue.get_context(),
4040
Queue.get_device(),
41-
{exp_ext::property::graph::assume_buffer_outlives_graph{},
42-
exp_ext::property::graph::assume_data_outlives_buffer{}}};
41+
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};
4342

4443
// Copy from B to A
4544
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {

sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ int main() {
2424
exp_ext::command_graph Graph{
2525
Queue.get_context(),
2626
Queue.get_device(),
27-
{exp_ext::property::graph::assume_buffer_outlives_graph{},
28-
exp_ext::property::graph::assume_data_outlives_buffer{}}};
27+
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};
2928

3029
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
3130
auto AccA = BufferA.get_access(CGH);

sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ int main() {
2525
exp_ext::command_graph Graph{
2626
Queue.get_context(),
2727
Queue.get_device(),
28-
{exp_ext::property::graph::assume_buffer_outlives_graph{},
29-
exp_ext::property::graph::assume_data_outlives_buffer{}}};
28+
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};
3029

3130
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
3231
auto AccA = BufferA.get_access<access::mode::write>(CGH);

0 commit comments

Comments
 (0)