llvm-c166/offload/test/api
Jan André Reuter 083d2c4b1f
[Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290)
In OpenMP v5.2, the constant `omp_initial_device` was introduced, which
was defined as a value of `-1`.
Support for this value was added to Clang and Flang in
09cd294482 and
3c14034c55.

However, runtime calls are not aware of this constant. As such,
execution of a runtime function, passing `omp_initial_device` as the
`device_num`, would abort with e.g.,:

```
omptarget fatal error -1: "invalid value" device number '-1' out of range, only 1 devices available
```

To fix this issue, also extend the host device checks in the API
functions to also check for `omp_initial_device`.
For testing, extend API tests using `omp_get_initial_device()` to also
test `omp_initial_device` and extend `omp_device_uid.c` to check if the
UID for `omp_initial_device` and `omp_get_initial_device()` matches.

Partially addresses https://github.com/llvm/llvm-project/issues/192980
(see
https://github.com/llvm/llvm-project/issues/192980#issuecomment-4404241994)

---------

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
Signed-off-by: Jan André Reuter <jan@zyten.de>
2026-06-30 17:01:01 +02:00
..
amdgpu_code_object.c
assert.c
is_initial_device.c
omp_device_alloc.c
omp_device_managed_memory.c
omp_device_managed_memory_alloc.c
omp_device_memory.c
omp_device_uid.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_dynamic_shared_memory_mixed.inc
omp_dynamic_shared_memory_mixed_amdgpu.c
omp_dynamic_shared_memory_mixed_nvptx.c
omp_env_vars.c
omp_get_device_num.c
omp_get_mapped_ptr.c
omp_get_num_devices.c
omp_get_num_devices_with_empty_target.c
omp_get_num_procs.c
omp_host_call.c
omp_host_pinned_memory.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_host_pinned_memory_alloc.c
omp_indirect_call.c
omp_indirect_call_table_manual.c
omp_indirect_func_array.c
omp_indirect_func_basic.c [offload][lit] Disable three more tests on Intel GPU (#201381) 2026-06-03 19:28:34 +00:00
omp_indirect_func_struct.c
omp_target_memcpy_async1.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_target_memcpy_async2.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_target_memcpy_rect_async1.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_target_memcpy_rect_async2.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_target_memset.c [Offload][OpenMP] Accept omp_initial_device for runtime calls (#205290) 2026-06-30 17:01:01 +02:00
omp_virtual_func.cpp
omp_virtual_func_multiple_inheritance_01.cpp
omp_virtual_func_multiple_inheritance_02.cpp
omp_virtual_func_reference.cpp
ompx_3d.c
ompx_3d.cpp
ompx_sync.c
ompx_sync.cpp