Skip to content

[SYCL] Ensure correct errc thrown for unassociated placeholder accessor (4.7.6.9) #5737

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 6 commits into from
Jun 18, 2022
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
8 changes: 5 additions & 3 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1884,9 +1884,11 @@ static pi_result SetKernelParamsAndLaunch(
break;
case kernel_param_kind_t::kind_accessor: {
Requirement *Req = (Requirement *)(Arg.MPtr);
assert(getMemAllocationFunc != nullptr &&
"The function should not be nullptr as we followed the path for "
"which accessors are used");
if (getMemAllocationFunc == nullptr)
throw sycl::exception(make_error_code(errc::kernel_argument),
"placeholder accessor must be bound by calling "
"handler::require() before it can be used.");

RT::PiMem MemArg = (RT::PiMem)getMemAllocationFunc(Req);
if (Plugin.getBackend() == backend::opencl) {
Plugin.call<PiApiKind::piKernelSetArg>(Kernel, NextTrueIndex,
Expand Down