Skip to content

Commit 6b3b41d

Browse files
committed
[SYCL] Report an error message when "sycl::program::create_program_with_source"
is used with Level-Zero backend. Signed-off-by: rbegam <[email protected]>
1 parent b249099 commit 6b3b41d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sycl/source/detail/program_impl.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,15 @@ void program_impl::create_cl_program_with_source(const string_class &Source) {
358358
const char *Src = Source.c_str();
359359
size_t Size = Source.size();
360360
const detail::plugin &Plugin = getPlugin();
361-
Plugin.call<PiApiKind::piclProgramCreateWithSource>(
361+
RT::PiResult Err = Plugin.call_nocheck<PiApiKind::piclProgramCreateWithSource>(
362362
MContext->getHandleRef(), 1, &Src, &Size, &MProgram);
363+
364+
if (getPlugin().getBackend() == cl::sycl::backend::level_zero &&
365+
Err == PI_INVALID_OPERATION) {
366+
throw feature_not_supported(
367+
"piclProgramCreateWithSource: not supported in Level Zero",
368+
PI_INVALID_OPERATION);
369+
}
363370
}
364371

365372
void program_impl::compile(const string_class &Options) {

0 commit comments

Comments
 (0)