forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SYCL][Graph] Regression Test for in-order queue submission
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
sycl/test-e2e/Graph/Explicit/in_order_queue_event_dependency.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
// Extra run to check for immediate-command-list in Level Zero | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_EXPLICIT | ||
|
||
#include "../Inputs/in_order_queue_event_dependency.cpp" |
46 changes: 46 additions & 0 deletions
46
sycl/test-e2e/Graph/Inputs/in_order_queue_event_dependency.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "../graph_common.hpp" | ||
|
||
#include <sycl/properties/all_properties.hpp> | ||
|
||
int main() { | ||
queue Queue1{sycl::property::queue::in_order{}}; | ||
queue Queue2(Queue1.get_context(), Queue1.get_device(), | ||
sycl::property::queue::in_order()); | ||
exp_ext::command_graph Graph{Queue1}; | ||
|
||
std::vector<float> Data(Size, 0.0f); | ||
|
||
float *DevicePtr = sycl::malloc_device<float>(Size, Queue1); | ||
|
||
add_node(Graph, Queue1, [&](handler &CGH) { | ||
CGH.memcpy(DevicePtr, Data.data(), Size * sizeof(float)); | ||
}); | ||
|
||
add_node(Graph, Queue1, [&](handler &CGH) { | ||
CGH.parallel_for(sycl::range<1>(Size), [=](sycl::id<1> Id) { | ||
DevicePtr[Id] += 1.0f; | ||
}); | ||
}); | ||
|
||
auto GraphExec = Graph.finalize(); | ||
|
||
auto Event = Queue1.ext_oneapi_graph(GraphExec); | ||
|
||
/* | ||
Queue2.submit([&](sycl::handler &CGH) { | ||
CGH.depends_on({Event}); | ||
CGH.host_task([=]() { volatile float b = 3.0; }); | ||
}); | ||
*/ | ||
|
||
std::vector<float> HostData(Size, 0.0f); | ||
Queue1.memcpy(HostData.data(), DevicePtr, Size * sizeof(float)).wait(); | ||
for (size_t i = 0; i < Size; ++i) { | ||
std::cout << i << ": " << HostData[i] << std::endl; | ||
assert(HostData[i] == 1.0f); | ||
} | ||
|
||
sycl::free(DevicePtr, Queue1); | ||
|
||
return 0; | ||
} |
10 changes: 10 additions & 0 deletions
10
sycl/test-e2e/Graph/RecordReplay/in_order_queue_event_dependency.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// RUN: %{build} -o %t.out | ||
// RUN: %{run} %t.out | ||
// Extra run to check for leaks in Level Zero using UR_L0_LEAKS_DEBUG | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=0 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
// Extra run to check for immediate-command-list in Level Zero | ||
// RUN: %if level_zero %{env SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 %{l0_leak_check} %{run} %t.out 2>&1 | FileCheck %s --implicit-check-not=LEAK %} | ||
|
||
#define GRAPH_E2E_RECORD_REPLAY | ||
|
||
#include "../Inputs/in_order_queue_event_dependency.cpp" |