[libc] Add single threaded kernel attributes to AMDGPU startup utility (#104651)
Summary: I fixed the errors here recently so I can actually use these. This shouldn't impact much, just should hopefully make the code generated slightly better.
This commit is contained in:
parent
caa1070b1c
commit
5c13f9aea2
@ -41,7 +41,9 @@ static void call_fini_array_callbacks() {
|
||||
|
||||
} // namespace LIBC_NAMESPACE_DECL
|
||||
|
||||
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel]] void
|
||||
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel,
|
||||
clang::amdgpu_flat_work_group_size(1, 1),
|
||||
clang::amdgpu_max_num_work_groups(1)]] void
|
||||
_begin(int argc, char **argv, char **env) {
|
||||
__atomic_store_n(&LIBC_NAMESPACE::app.env_ptr,
|
||||
reinterpret_cast<uintptr_t *>(env), __ATOMIC_RELAXED);
|
||||
@ -60,7 +62,9 @@ _start(int argc, char **argv, char **envp, int *ret) {
|
||||
__atomic_fetch_or(ret, main(argc, argv, envp), __ATOMIC_RELAXED);
|
||||
}
|
||||
|
||||
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel]] void
|
||||
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel,
|
||||
clang::amdgpu_flat_work_group_size(1, 1),
|
||||
clang::amdgpu_max_num_work_groups(1)]] void
|
||||
_end(int retval) {
|
||||
// Only a single thread should call `exit` here, the rest should gracefully
|
||||
// return from the kernel. This is so only one thread calls the destructors
|
||||
|
Loading…
x
Reference in New Issue
Block a user