CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
96 lines
3.7 KiB
C++
96 lines
3.7 KiB
C++
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -fcxx-exceptions -fexceptions -fsycl-is-host -emit-llvm -o - %s | FileCheck %s
|
|
|
|
// Validate generation of exception handling code for functions declared
|
|
// with the sycl_kernel_entry_point attribute that implicitly call a
|
|
// sycl_kernel_launch function that may throw an exception. Exception
|
|
// handling is not relevant for the generated offload kernel entry point
|
|
// function, so device compilation is intentionally not exercised.
|
|
|
|
// A unique kernel name type is required for each declared kernel entry point.
|
|
template<int> struct KN;
|
|
|
|
// A generic kernel object type.
|
|
template<int, int = 0>
|
|
struct KT {
|
|
void operator()() const;
|
|
};
|
|
|
|
|
|
// Validate that exception handling instructions are omitted when a
|
|
// potentially throwing sycl_kernel_entry_point attributed function
|
|
// calls a potentially throwing sycl_kernel_launch function (a thrown
|
|
// exception will propagate with no explicit handling required).
|
|
namespace ns1 {
|
|
template<typename KN, typename... Ts>
|
|
void sycl_kernel_launch(const char *, Ts...);
|
|
[[clang::sycl_kernel_entry_point(KN<1>)]]
|
|
void skep(KT<1> k) {
|
|
k();
|
|
}
|
|
}
|
|
// CHECK: ; Function Attrs: mustprogress noinline optnone
|
|
// CHECK: define dso_local void @_ZN3ns14skepE2KTILi1ELi0EE() #{{[0-9]+}} {
|
|
// CHECK: call void @_ZN3ns118sycl_kernel_launchI2KNILi1EEJ2KTILi1ELi0EEEEEvPKcDpT0_(ptr noundef @.str)
|
|
// CHECK: ret void
|
|
// CHECK: }
|
|
|
|
|
|
// Validate that exception handling instructions are emitted when a
|
|
// non-throwing sycl_kernel_entry_point attributed function calls
|
|
// a potentially throwing sycl_kernel_launch function.
|
|
namespace ns2 {
|
|
template<typename KN, typename... Ts>
|
|
void sycl_kernel_launch(const char *, Ts...);
|
|
[[clang::sycl_kernel_entry_point(KN<2>)]]
|
|
void skep(KT<2> k) noexcept {
|
|
k();
|
|
}
|
|
}
|
|
// CHECK: ; Function Attrs: mustprogress noinline nounwind optnone
|
|
// CHECK: define dso_local void @_ZN3ns24skepE2KTILi2ELi0EE() #{{[0-9]+}} personality ptr @__gxx_personality_v0 {
|
|
// CHECK: invoke void @_ZN3ns218sycl_kernel_launchI2KNILi2EEJ2KTILi2ELi0EEEEEvPKcDpT0_(ptr noundef @.str.1)
|
|
// CHECK: to label %invoke.cont unwind label %terminate.lpad
|
|
// CHECK: invoke.cont:
|
|
// CHECK: ret void
|
|
// CHECK: terminate.lpad:
|
|
// CHECK: call void @__clang_call_terminate(ptr %1) #{{[0-9]+}}
|
|
// CHECK: unreachable
|
|
// CHECK: }
|
|
|
|
|
|
// Validate that exception handling instructions are omitted when a
|
|
// potentially throwing sycl_kernel_entry_point attributed function
|
|
// calls a non-throwing sycl_kernel_launch function (a thrown
|
|
// exception will terminate within sycl_kernel_launch).
|
|
namespace ns3 {
|
|
template<typename KN, typename... Ts>
|
|
void sycl_kernel_launch(const char *, Ts...) noexcept;
|
|
[[clang::sycl_kernel_entry_point(KN<3>)]]
|
|
void skep(KT<3> k) {
|
|
k();
|
|
}
|
|
}
|
|
// CHECK: ; Function Attrs: mustprogress noinline nounwind optnone
|
|
// CHECK: define dso_local void @_ZN3ns34skepE2KTILi3ELi0EE() #{{[0-9]+}} {
|
|
// CHECK: call void @_ZN3ns318sycl_kernel_launchI2KNILi3EEJ2KTILi3ELi0EEEEEvPKcDpT0_(ptr noundef @.str.2)
|
|
// CHECK: ret void
|
|
// CHECK: }
|
|
|
|
|
|
// Validate that exception handling instructions are omitted when a
|
|
// non-throwing sycl_kernel_entry_point attributed function calls a
|
|
// non-throwing sycl_kernel_launch function.
|
|
namespace ns4 {
|
|
template<typename KN, typename... Ts>
|
|
void sycl_kernel_launch(const char *, Ts...) noexcept;
|
|
[[clang::sycl_kernel_entry_point(KN<4>)]]
|
|
void skep(KT<4> k) noexcept {
|
|
k();
|
|
}
|
|
}
|
|
// CHECK: ; Function Attrs: mustprogress noinline nounwind optnone
|
|
// CHECK: define dso_local void @_ZN3ns44skepE2KTILi4ELi0EE() #{{[0-9]+}} {
|
|
// CHECK: call void @_ZN3ns418sycl_kernel_launchI2KNILi4EEJ2KTILi4ELi0EEEEEvPKcDpT0_(ptr noundef @.str.3)
|
|
// CHECK: ret void
|
|
// CHECK: }
|