Skip to content

Commit 30e121e

Browse files
committed
Modify test to remove assert and return failure on incorrect results
1 parent d196c73 commit 30e121e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

sycl/test-e2e/Graph/RecordReplay/in_order_queue_event_dependency.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int main() {
1515
sycl::property::queue::in_order());
1616
exp_ext::command_graph Graph{Queue1};
1717

18-
std::vector<float> Data(Size, 0.0f);
18+
std::vector<float> Data(Size, 1.0f);
1919

2020
float *DevicePtr = sycl::malloc_device<float>(Size, Queue1);
2121

@@ -49,13 +49,18 @@ int main() {
4949
#endif
5050
});
5151

52-
std::vector<float> HostData(Size, 0.0f);
52+
std::vector<float> HostData(Size, 7.0f);
5353
Queue1.memcpy(HostData.data(), DevicePtr, Size * sizeof(float)).wait();
54+
bool IncorrectResult = false;
5455
for (size_t i = 0; i < Size; ++i) {
55-
assert(HostData[i] == 1.0f);
56+
IncorrectResult |= !(HostData[i] == 2.0f);
57+
if (IncorrectResult)
58+
{
59+
std::cout << "INCORRECT RESULT DETECTED! Value at " << i << " was " << HostData[i] << std::endl;
5660
}
57-
61+
}
62+
5863
sycl::free(DevicePtr, Queue1);
5964

60-
return 0;
65+
return IncorrectResult;
6166
}

0 commit comments

Comments
 (0)