Skip to content
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

Kernel bundle tests warning: non-void function does not return a value in all control paths #846

Open
AlexeySachkov opened this issue Jan 9, 2024 · 0 comments

Comments

@AlexeySachkov
Copy link
Contributor

The following function triggers warning during CTS build:

template <typename KernelT>
inline sycl::kernel_bundle<sycl::bundle_state::executable> get_non_empty_bundle(
const sycl::context &ctx) {
auto kernel_id = sycl::get_kernel_id<KernelT>();
try {
auto k_bundle = sycl::get_kernel_bundle<sycl::bundle_state::executable>(
ctx, ctx.get_devices(), {kernel_id});
return k_bundle;
} catch (const sycl::exception &e) {
if (sycl::errc::invalid == e.code())
SKIP(
"Test skipped because no device is compatible with requested kernel");
}
}

Example of build log:

In file included from ../tests/kernel_bundle/use_kernel_bundle_call_set_spec_const_after_use_kb_no_second_queue.cpp:13:
../tests/kernel_bundle/use_kernel_bundle.h:115:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
  115 | }
      | ^
../tests/kernel_bundle/use_kernel_bundle_call_set_spec_const_after_use_kb_no_second_queue.cpp:73:9: note: in instantiation of function template specialization 'sycl_cts::tests::use_kernel_bundle::get_non_empty_bundle<sycl_cts::test
s::use_kernel_bundle::kernel_for_kernel_bundle>' requested here
   73 |         get_non_empty_bundle<kernel_for_kernel_bundle>(ctx);
      |         ^
1 warning generated.
[426/1195] Building CXX object tests/kernel_bundle/CMakeFiles/test_kernel_bundle_objects.dir/use_kernel_bundle_call_set_spec_const_after_use_kb_with_second_queue.cpp.o
In file included from ../tests/kernel_bundle/use_kernel_bundle_call_set_spec_const_after_use_kb_with_second_queue.cpp:13:
../tests/kernel_bundle/use_kernel_bundle.h:115:1: warning: non-void function does not return a value in all control paths [-Wreturn-type]
  115 | }
      | ^
../tests/kernel_bundle/use_kernel_bundle_call_set_spec_const_after_use_kb_with_second_queue.cpp:76:9: note: in instantiation of function template specialization 'sycl_cts::tests::use_kernel_bundle::get_non_empty_bundle<sycl_cts::te
sts::use_kernel_bundle::kernel_for_kernel_bundle>' requested here
   76 |         get_non_empty_bundle<kernel_for_kernel_bundle>(ctx);
      |         ^
1 warning generated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant