Skip to content

[SYCL][Graph] Remove assume_data_outlives_buffer property #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2023
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
13 changes: 0 additions & 13 deletions sycl/include/sycl/ext/oneapi/experimental/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,6 @@ class assume_buffer_outlives_graph
public:
assume_buffer_outlives_graph() = default;
};

/// Property passed to command_graph constructor to allow buffers created with
/// host pointers. Passing this property represents a promise from the user that
/// the host data will outlive the buffer and by extension any graph that it is
/// used in.
///
class assume_data_outlives_buffer
: public ::sycl::detail::DataLessProperty<
::sycl::detail::GraphAssumeDataOutlivesBuffer> {
public:
assume_data_outlives_buffer() = default;
};

} // namespace graph

namespace node {
Expand Down
7 changes: 0 additions & 7 deletions sycl/source/detail/graph_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,6 @@ graph_impl::add(sycl::detail::CG::CGTYPE CGType,
for (auto &Req : Requirements) {
// Track and mark the memory objects being used by the graph.
auto MemObj = static_cast<sycl::detail::SYCLMemObjT *>(Req->MSYCLMemObj);
if (MemObj->getUserPtr() && !MAllowBuffersHostPointers) {
throw sycl::exception(
make_error_code(errc::invalid),
"Cannot use a buffer which was created with a host pointer in a "
"graph without passing the assume_data_outlives_buffer property on "
"Graph construction.");
}
bool WasInserted = MMemObjs.insert(MemObj).second;
if (WasInserted) {
MemObj->markBeingUsedInGraph();
Expand Down
8 changes: 0 additions & 8 deletions sycl/source/detail/graph_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,6 @@ class graph_impl {
if (PropList.has_property<property::graph::no_cycle_check>()) {
MSkipCycleChecks = true;
}
if (PropList.has_property<property::graph::assume_data_outlives_buffer>()) {
MAllowBuffersHostPointers = true;
}
if (PropList
.has_property<property::graph::assume_buffer_outlives_graph>()) {
MAllowBuffers = true;
Expand Down Expand Up @@ -615,11 +612,6 @@ class graph_impl {
/// Unique set of SYCL Memory Objects which are currently in use in the graph.
std::set<sycl::detail::SYCLMemObjT *> MMemObjs;

/// Controls whether we allow buffers that are created with host pointers to
/// be used in the graph. Set by the presence of the
/// assume_data_outlives_buffer property.
bool MAllowBuffersHostPointers = false;

/// Controls whether we allow buffers to be used in the graph. Set by the
/// presence of the assume_buffer_outlives_graph property.
bool MAllowBuffers = false;
Expand Down

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/basic_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

// Add commands to graph
add_nodes(Graph, Queue, Size, BufferA, BufferB, BufferC);
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

// Copy from B to A
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

// Copy from B to A
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_host2target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access(CGH);
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_host2target_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access<access::mode::write>(CGH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access<access::mode::write>(CGH, range<1>(Size),
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_offsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

// Copy from A to B
auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_target2host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access<access::mode::read>(CGH);
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/buffer_copy_target2host_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access<access::mode::read>(CGH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeA = add_node(Graph, Queue, [&](handler &CGH) {
auto AccA = BufferA.get_access<access::mode::read>(
Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/dotp_buffer_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

auto NodeI = add_node(Graph, Queue, [&](handler &CGH) {
auto X = XBuf.get_access(CGH);
Expand Down
6 changes: 1 addition & 5 deletions sycl/test-e2e/Graph/Inputs/dotp_usm_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
int main() {
queue Queue;

exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};

float *Dotp = malloc_device<float>(1, Queue);

Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/event_status_querying.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

// Copy from B to A
auto Init = add_node(Graph, Queue, [&](handler &CGH) {
Expand Down
12 changes: 2 additions & 10 deletions sycl/test-e2e/Graph/Inputs/sub_graph_reduction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,8 @@
int main() {
queue Queue;

exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
exp_ext::command_graph SubGraph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
exp_ext::command_graph Graph{Queue.get_context(), Queue.get_device()};
exp_ext::command_graph SubGraph{Queue.get_context(), Queue.get_device()};

float *Dotp = malloc_device<float>(1, Queue);

Expand Down
3 changes: 1 addition & 2 deletions sycl/test-e2e/Graph/Inputs/temp_buffer_reinterpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ int main() {
exp_ext::command_graph Graph{
Queue.get_context(),
Queue.get_device(),
{exp_ext::property::graph::assume_buffer_outlives_graph{},
exp_ext::property::graph::assume_data_outlives_buffer{}}};
{exp_ext::property::graph::assume_buffer_outlives_graph{}}};

{
// Create some temporary buffers only for adding nodes
Expand Down

This file was deleted.