Skip to content

Update record & replay tests #105

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
Mar 21, 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
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-dotp.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-node-ordering.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-queue-shortcuts.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-reduction.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
11 changes: 3 additions & 8 deletions sycl/test/graph/graph-explicit-repeated-exec.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down Expand Up @@ -27,24 +26,20 @@ int main() {
});
});

bool check = true;
for (int i = 0; i < n; i++) {
if (arr[i] != 0)
check = false;
assert(arr[i] == 0);
}

auto executable_graph = g.finalize(q.get_context());

for (int i = 0; i < n; i++) {
if (arr[i] != 0)
check = false;
assert(arr[i] == 0);
}

q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(executable_graph); });

for (int i = 0; i < n; i++) {
if (arr[i] != 1)
check = false;
assert(arr[i] == 1);
}

q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(executable_graph); });
Expand Down
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-saxpy.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
7 changes: 2 additions & 5 deletions sycl/test/graph/graph-explicit-single-node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,14 @@ int main() {
});
});

bool check = true;
for (int i = 0; i < n; i++) {
if (arr[i] != 0)
check = false;
assert(arr[i] == 0);
}

auto executable_graph = g.finalize(q.get_context());

for (int i = 0; i < n; i++) {
if (arr[i] != 0)
check = false;
assert(arr[i] == 0);
}

q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(executable_graph); });
Expand Down
1 change: 0 additions & 1 deletion sycl/test/graph/graph-explicit-subgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

// Modified version of the dotp example which submits part of the graph as a
// sub-graph
#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down
10 changes: 2 additions & 8 deletions sycl/test/graph/graph-record-dotp-buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <CL/sycl.hpp>
#include <iostream>
#include <thread>

#include <sycl/ext/oneapi/experimental/graph.hpp>

Expand Down Expand Up @@ -102,11 +100,7 @@ int main() {
q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(exec_graph); });
}

if (dotpData != host_gold_result()) {
std::cout << "Test failed: Error unexpected result!\n";
} else {
std::cout << "Test passed successfuly.";
}
assert(dotpData == host_gold_result());

return 0;
}
}
12 changes: 2 additions & 10 deletions sycl/test/graph/graph-record-dotp.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
#include <CL/sycl.hpp>
#include <iostream>
#include <thread>

#include <sycl/ext/oneapi/experimental/graph.hpp>

Expand Down Expand Up @@ -85,18 +83,12 @@ int main() {

q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(exec_graph); });

if (dotp[0] != host_gold_result()) {
std::cout << "Test failed: Error unexpected result!\n";
} else {
std::cout << "Test passed successfuly.";
}
assert(dotp[0] == host_gold_result());

sycl::free(dotp, q);
sycl::free(x, q);
sycl::free(y, q);
sycl::free(z, q);

std::cout << "done.\n";

return 0;
}
}
19 changes: 3 additions & 16 deletions sycl/test/graph/graph-record-simple.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out

#include <iostream>
#include <sycl/sycl.hpp>

#include <sycl/ext/oneapi/experimental/graph.hpp>
Expand Down Expand Up @@ -36,24 +35,12 @@ int main() {

q.submit([&](sycl::handler &h) { h.ext_oneapi_graph(exec_graph); });

int errors = 0;
// Verify results
for (size_t i = 0; i < n; i++) {
if (arr[i] != expectedValue) {
std::cout << "Test failed: Unexpected result at index: " << i
<< ", expected: " << expectedValue << " actual: " << arr[i]
<< "\n";
errors++;
}
assert(arr[i] == expectedValue);
}

if (errors == 0) {
std::cout << "Test passed successfuly.";
}

std::cout << "done.\n";

sycl::free(arr, q.get_context());

return errors;
}
return 0;
}