Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Remove test case using host accessor in interop_handle::get_na… #269

Merged
Merged
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
30 changes: 0 additions & 30 deletions SYCL/HostInteropTask/interop-task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,43 +221,13 @@ void test5() {
checkBufferValues(Buffer2, static_cast<int>(123));
}

// The test checks that an exception which is thrown from host_task body
// is reported as asynchronous.
void test6() {
queue Queue([](sycl::exception_list ExceptionList) {
if (ExceptionList.size() != 1) {
std::cerr << "Should be one exception in exception list" << std::endl;
std::abort();
}
std::rethrow_exception(*ExceptionList.begin());
});

try {
size_t size = 1;
buffer<int, 1> Buf{size};
Queue.submit([&](sycl::handler &CGH) {
auto acc = Buf.get_access<mode::write, target::host_buffer>(CGH);
CGH.codeplay_host_task(
[=](interop_handle IH) { (void)IH.get_native_mem(acc); });
});
Queue.wait_and_throw();
assert(!"Expected exception was not caught");
} catch (sycl::exception &ExpectedException) {
assert(std::string(ExpectedException.what())
.find("memory object out of accessor for specified target "
"is not allowed") != std::string::npos &&
"Unexpected error was caught!");
}
}

int main() {
test1();
test2();
test2_1();
test3();
test4();
test5();
test6();
std::cout << "Test PASSED" << std::endl;
return 0;
}