[Openmp-commits] [llvm] [openmp] [Offload] Move `/openmp/libomptarget` to `/offload` (PR #75125)

Johannes Doerfert via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 18 15:48:20 PDT 2024


https://github.com/jdoerfert updated https://github.com/llvm/llvm-project/pull/75125

>From e24a5d145378b9903dffffc8a3da9ff342906200 Mon Sep 17 00:00:00 2001
From: Johannes Doerfert <johannes at jdoerfert.de>
Date: Mon, 11 Dec 2023 15:04:33 -0800
Subject: [PATCH 1/2] [Offload] Move `/openmp/libomptarget` to `/offload`

In a nutshell, this moves our libomptarget code to create the offload
subproject.

With this commit, users need to enable the new LLVM/Offload subproject
as a runtime in their cmake configuration. No further changes are
expected for downstream code.

Tests and other components still depend on OpenMP and have also not been
renamed. The results below are for a build in which OpenMP and Offload
are enabled runtimes. In addition to the pure git mv, I needed to adjust
some CMake files. Nothing is intended to change semantics.

```
ninja check-offload
```
Works with the X86 and AMDGPU offload tests

```
ninja check-openmp
```
Still works but doesn't build offload tests anymore.

```
ls install/lib
```
Shows all expected libraries, incl.
- `libomptarget.devicertl.a`
- `libomptarget-nvptx-sm_90.bc`
- `libomptarget.rtl.amdgpu.so` -> `libomptarget.rtl.amdgpu.so.19git`
- `libomptarget.so` -> `libomptarget.so.19git`

Fixes: https://github.com/llvm/llvm-project/issues/75124
---
 llvm/CMakeLists.txt                           |   2 +-
 .../libomptarget => offload}/CMakeLists.txt   | 102 +++++++-
 .../DeviceRTL/CMakeLists.txt                  |   4 +-
 .../DeviceRTL/include/Allocator.h             |   0
 .../DeviceRTL/include/Configuration.h         |   0
 .../DeviceRTL/include/Debug.h                 |   0
 .../DeviceRTL/include/Interface.h             |   0
 .../DeviceRTL/include/LibC.h                  |   0
 .../DeviceRTL/include/Mapping.h               |   0
 .../DeviceRTL/include/State.h                 |   0
 .../DeviceRTL/include/Synchronization.h       |   0
 .../DeviceRTL/include/Types.h                 |   0
 .../DeviceRTL/include/Utils.h                 |   0
 .../include/generated_microtask_cases.gen     |   0
 .../DeviceRTL/src/Allocator.cpp               |   0
 .../DeviceRTL/src/Configuration.cpp           |   0
 .../DeviceRTL/src/Debug.cpp                   |   0
 .../DeviceRTL/src/Kernel.cpp                  |   0
 .../DeviceRTL/src/LibC.cpp                    |   0
 .../DeviceRTL/src/Mapping.cpp                 |   0
 .../DeviceRTL/src/Misc.cpp                    |   0
 .../DeviceRTL/src/Parallelism.cpp             |   0
 .../DeviceRTL/src/Reduction.cpp               |   0
 .../DeviceRTL/src/State.cpp                   |   0
 .../DeviceRTL/src/Stub.cpp                    |   0
 .../DeviceRTL/src/Synchronization.cpp         |   0
 .../DeviceRTL/src/Tasking.cpp                 |   0
 .../DeviceRTL/src/Utils.cpp                   |   0
 .../DeviceRTL/src/Workshare.cpp               |   0
 .../DeviceRTL/src/exports                     |   0
 {openmp/libomptarget => offload}/README.txt   |   0
 .../Modules/LibomptargetGetDependencies.cmake |   0
 .../cmake/Modules/LibomptargetUtils.cmake     |   0
 offload/cmake/OpenMPTesting.cmake             | 238 ++++++++++++++++++
 .../docs/declare_target_indirect.md           |   0
 .../include/DeviceImage.h                     |   0
 .../include/ExclusiveAccess.h                 |   0
 .../include/OffloadEntry.h                    |   0
 .../include/OffloadPolicy.h                   |   0
 .../include/OpenMP/InternalTypes.h            |   0
 .../include/OpenMP/InteropAPI.h               |   0
 .../include/OpenMP/Mapping.h                  |   0
 .../include/OpenMP/OMPT/Callback.h            |   0
 .../include/OpenMP/OMPT/Connector.h           |   0
 .../include/OpenMP/OMPT/Interface.h           |   0
 .../include/OpenMP/omp.h                      |   0
 .../include/PluginManager.h                   |   0
 .../include/Shared/APITypes.h                 |   0
 .../include/Shared/Debug.h                    |   0
 .../include/Shared/Environment.h              |   0
 .../include/Shared/EnvironmentVar.h           |   0
 .../include/Shared/PluginAPI.h                |   0
 .../include/Shared/PluginAPI.inc              |   0
 .../include/Shared/Profile.h                  |   0
 .../include/Shared/Requirements.h             |   0
 .../include/Shared/SourceInfo.h               |   0
 .../include/Shared/Utils.h                    |   0
 .../include/Utils/ExponentialBackoff.h        |   0
 .../libomptarget => offload}/include/device.h |   0
 .../include/omptarget.h                       |   0
 .../libomptarget => offload}/include/rtl.h    |   0
 .../plugins-nextgen/CMakeLists.txt            |   0
 .../plugins-nextgen/amdgpu/CMakeLists.txt     |   2 +-
 .../amdgpu/dynamic_hsa/hsa.cpp                |   0
 .../plugins-nextgen/amdgpu/dynamic_hsa/hsa.h  |   0
 .../amdgpu/dynamic_hsa/hsa_ext_amd.h          |   0
 .../plugins-nextgen/amdgpu/src/rtl.cpp        |   0
 .../amdgpu/utils/UtilitiesRTL.h               |   0
 .../plugins-nextgen/common/CMakeLists.txt     |   0
 .../common/OMPT/OmptCallback.cpp              |   0
 .../plugins-nextgen/common/include/DLWrap.h   |   0
 .../common/include/GlobalHandler.h            |   0
 .../plugins-nextgen/common/include/JIT.h      |   0
 .../common/include/MemoryManager.h            |   0
 .../common/include/PluginInterface.h          |   0
 .../plugins-nextgen/common/include/RPC.h      |   0
 .../common/include/Utils/ELF.h                |   0
 .../common/src/GlobalHandler.cpp              |   0
 .../plugins-nextgen/common/src/JIT.cpp        |   0
 .../common/src/PluginInterface.cpp            |   0
 .../plugins-nextgen/common/src/RPC.cpp        |   0
 .../plugins-nextgen/common/src/Utils/ELF.cpp  |   0
 .../plugins-nextgen/cuda/CMakeLists.txt       |   2 +-
 .../cuda/dynamic_cuda/cuda.cpp                |   0
 .../plugins-nextgen/cuda/dynamic_cuda/cuda.h  |   0
 .../plugins-nextgen/cuda/src/rtl.cpp          |   0
 .../plugins-nextgen/exports                   |   0
 .../plugins-nextgen/host/CMakeLists.txt       |   0
 .../plugins-nextgen/host/dynamic_ffi/ffi.cpp  |   0
 .../plugins-nextgen/host/dynamic_ffi/ffi.h    |   0
 .../plugins-nextgen/host/src/rtl.cpp          |   0
 .../src/CMakeLists.txt                        |   2 +-
 .../src/DeviceImage.cpp                       |   0
 .../src/LegacyAPI.cpp                         |   0
 .../src/OffloadRTL.cpp                        |   0
 .../src/OpenMP/API.cpp                        |   0
 .../src/OpenMP/InteropAPI.cpp                 |   0
 .../src/OpenMP/Mapping.cpp                    |   0
 .../src/OpenMP/OMPT/Callback.cpp              |   0
 .../src/PluginManager.cpp                     |   0
 .../libomptarget => offload}/src/device.cpp   |   0
 {openmp/libomptarget => offload}/src/exports  |   0
 .../src/interface.cpp                         |   0
 .../src/omptarget.cpp                         |   0
 .../libomptarget => offload}/src/private.h    |   0
 .../test/CMakeLists.txt                       |  15 +-
 .../test/Inputs/basic_array.f90               |   0
 .../test/Inputs/declare_indirect_func.c       |   0
 .../test/api/assert.c                         |   0
 .../test/api/is_initial_device.c              |   0
 .../test/api/omp_device_managed_memory.c      |   0
 .../api/omp_device_managed_memory_alloc.c     |   0
 .../test/api/omp_device_memory.c              |   0
 .../test/api/omp_dynamic_shared_memory.c      |   0
 .../api/omp_dynamic_shared_memory_amdgpu.c    |   0
 .../api/omp_dynamic_shared_memory_mixed.inc   |   0
 .../omp_dynamic_shared_memory_mixed_amdgpu.c  |   0
 .../omp_dynamic_shared_memory_mixed_nvptx.c   |   0
 .../test/api/omp_env_vars.c                   |   0
 .../test/api/omp_get_device_num.c             |   0
 .../test/api/omp_get_mapped_ptr.c             |   0
 .../test/api/omp_get_num_devices.c            |   0
 .../omp_get_num_devices_with_empty_target.c   |   0
 .../test/api/omp_get_num_procs.c              |   0
 .../test/api/omp_host_pinned_memory.c         |   0
 .../test/api/omp_host_pinned_memory_alloc.c   |   0
 .../test/api/omp_indirect_call.c              |   0
 .../test/api/omp_target_memcpy_async1.c       |   0
 .../test/api/omp_target_memcpy_async2.c       |   0
 .../test/api/omp_target_memcpy_rect_async1.c  |   0
 .../test/api/omp_target_memcpy_rect_async2.c  |   0
 .../test/api/omp_target_memset.c              |   0
 .../test/api/ompx_3d.c                        |   0
 .../test/api/ompx_3d.cpp                      |   0
 .../test/api/ompx_sync.c                      |   0
 .../test/api/ompx_sync.cpp                    |   0
 .../test/env/base_ptr_ref_count.c             |   0
 .../test/env/omp_target_debug.c               |   0
 .../test/jit/empty_kernel.inc                 |   0
 .../test/jit/empty_kernel_lvl1.c              |   0
 .../test/jit/empty_kernel_lvl2.c              |   0
 .../test/jit/type_punning.c                   |   0
 .../test/libc/assert.c                        |   0
 .../test/libc/fwrite.c                        |   0
 .../test/libc/global_ctor_dtor.cpp            |   0
 .../test/libc/host_call.c                     |   0
 .../test/libc/malloc.c                        |   0
 .../libomptarget => offload}/test/libc/puts.c |   0
 {openmp/libomptarget => offload}/test/lit.cfg |   0
 .../test/lit.site.cfg.in                      |   0
 .../test/mapping/alloc_fail.c                 |   0
 .../mapping/array_section_implicit_capture.c  |   0
 .../mapping/array_section_use_device_ptr.c    |   0
 .../test/mapping/auto_zero_copy.cpp           |   0
 .../test/mapping/auto_zero_copy_apu.cpp       |   0
 .../test/mapping/auto_zero_copy_globals.cpp   |   0
 .../test/mapping/data_absent_at_exit.c        |   0
 .../test/mapping/data_member_ref.cpp          |   0
 .../test/mapping/declare_mapper_api.cpp       |   0
 .../declare_mapper_nested_default_mappers.cpp |   0
 ...re_mapper_nested_default_mappers_array.cpp |   0
 ...nested_default_mappers_array_subscript.cpp |   0
 ...sted_default_mappers_complex_structure.cpp |   0
 ...r_nested_default_mappers_ptr_subscript.cpp |   0
 ...lare_mapper_nested_default_mappers_var.cpp |   0
 .../mapping/declare_mapper_nested_mappers.cpp |   0
 .../test/mapping/declare_mapper_target.cpp    |   0
 .../mapping/declare_mapper_target_data.cpp    |   0
 .../declare_mapper_target_data_enter_exit.cpp |   0
 .../mapping/declare_mapper_target_update.cpp  |   0
 .../test/mapping/delete_inf_refcount.c        |   0
 .../test/mapping/device_ptr_update.c          |   0
 .../test/mapping/firstprivate_aligned.cpp     |   0
 .../test/mapping/has_device_addr.cpp          |   0
 .../test/mapping/implicit_device_ptr.c        |   0
 .../test/mapping/is_device_ptr.cpp            |   0
 .../test/mapping/lambda_by_value.cpp          |   0
 .../test/mapping/lambda_mapping.cpp           |   0
 .../test/mapping/low_alignment.c              |   0
 .../test/mapping/map_back_race.cpp            |   0
 .../ompx_hold/omp_target_disassociate_ptr.c   |   0
 .../test/mapping/ompx_hold/struct.c           |   0
 .../test/mapping/ompx_hold/target-data.c      |   0
 .../test/mapping/ompx_hold/target.c           |   0
 .../test/mapping/padding_not_mapped.c         |   0
 .../test/mapping/power_of_two_alignment.c     |   0
 .../test/mapping/pr38704.c                    |   0
 .../test/mapping/prelock.cpp                  |   0
 .../test/mapping/present/target.c             |   0
 .../mapping/present/target_array_extension.c  |   0
 .../test/mapping/present/target_data.c        |   0
 .../present/target_data_array_extension.c     |   0
 .../mapping/present/target_data_at_exit.c     |   0
 .../test/mapping/present/target_enter_data.c  |   0
 .../mapping/present/target_exit_data_delete.c |   0
 .../present/target_exit_data_release.c        |   0
 .../test/mapping/present/target_update.c      |   0
 .../present/target_update_array_extension.c   |   0
 .../mapping/present/unified_shared_memory.c   |   0
 .../present/zero_length_array_section.c       |   0
 .../present/zero_length_array_section_exit.c  |   0
 .../test/mapping/private_mapping.c            |   0
 .../test/mapping/ptr_and_obj_motion.c         |   0
 .../test/mapping/reduction_implicit_map.cpp   |   0
 .../target_data_array_extension_at_exit.c     |   0
 .../target_derefence_array_pointrs.cpp        |   0
 .../test/mapping/target_has_device_addr.c     |   0
 .../mapping/target_implicit_partial_map.c     |   0
 .../mapping/target_map_for_member_data.cpp    |   0
 .../mapping/target_pointers_members_map.cpp   |   0
 .../mapping/target_update_array_extension.c   |   0
 .../test/mapping/target_use_device_addr.c     |   0
 .../test/mapping/target_uses_allocator.c      |   0
 .../mapping/target_wrong_use_device_addr.c    |   0
 .../test/offloading/assert.cpp                |   0
 .../offloading/atomic-compare-signedness.c    |   0
 .../test/offloading/back2back_distribute.c    |   0
 .../test/offloading/barrier_fence.c           |   0
 .../test/offloading/bug47654.cpp              |   0
 .../test/offloading/bug49021.cpp              |   0
 .../test/offloading/bug49334.cpp              |   0
 .../test/offloading/bug49779.cpp              |   0
 .../test/offloading/bug50022.cpp              |   0
 .../test/offloading/bug51781.c                |   0
 .../test/offloading/bug51982.c                |   0
 .../test/offloading/bug53727.cpp              |   0
 .../test/offloading/bug64959.c                |   0
 .../test/offloading/bug64959_compile_only.c   |   0
 .../test/offloading/bug74582.c                |   0
 .../test/offloading/complex_reduction.cpp     |   0
 .../test/offloading/ctor_dtor.cpp             |   0
 .../test/offloading/cuda_no_devices.c         |   0
 .../test/offloading/d2d_memcpy.c              |   0
 .../test/offloading/d2d_memcpy_sync.c         |   0
 .../test/offloading/default_thread_limit.c    |   0
 .../test/offloading/dynamic_module.c          |   0
 .../test/offloading/dynamic_module_load.c     |   0
 .../test/offloading/extern.c                  |   0
 .../test/offloading/force-usm.cpp             |   0
 .../fortran/basic-target-parallel-do.f90      |   0
 .../fortran/basic-target-parallel-region.f90  |   0
 .../basic-target-region-1D-array-section.f90  |   0
 .../basic-target-region-3D-array-section.f90  |   0
 .../fortran/basic-target-region-3D-array.f90  |   0
 .../test/offloading/fortran/basic_array.c     |   0
 .../fortran/basic_target_region.f90           |   0
 .../offloading/fortran/constant-arr-index.f90 |   0
 .../declare-target-vars-in-target-region.f90  |   0
 ...double-target-call-with-declare-target.f90 |   0
 ...ap-allocatable-array-section-1d-bounds.f90 |   0
 ...ap-allocatable-array-section-3d-bounds.f90 |   0
 .../target-map-allocatable-map-scopes.f90     |   0
 .../target-map-enter-exit-allocatables.f90    |   0
 .../fortran/target-map-enter-exit-array-2.f90 |   0
 .../target-map-enter-exit-array-bounds.f90    |   0
 .../fortran/target-map-enter-exit-array.f90   |   0
 .../fortran/target-map-enter-exit-scalar.f90  |   0
 .../target-map-pointer-scopes-enter-exit.f90  |   0
 ...pointer-target-array-section-3d-bounds.f90 |   0
 .../target-map-pointer-target-scopes.f90      |   0
 .../fortran/target-nested-target-data.f90     |   0
 .../fortran/target-parallel-do-collapse.f90   |   0
 .../fortran/target-region-implicit-array.f90  |   0
 .../fortran/target_map_common_block.f90       |   0
 .../fortran/target_map_common_block1.f90      |   0
 .../fortran/target_map_common_block2.f90      |   0
 .../test/offloading/fortran/target_update.f90 |   0
 .../generic_multiple_parallel_regions.c       |   0
 .../test/offloading/global_constructor.cpp    |   0
 .../test/offloading/host_as_target.c          |   0
 .../test/offloading/indirect_fp_mapping.c     |   0
 .../test/offloading/info.c                    |   0
 .../test/offloading/interop.c                 |   0
 .../test/offloading/lone_target_exit_data.c   |   0
 .../test/offloading/looptripcnt.c             |   0
 .../test/offloading/malloc.c                  |   0
 .../test/offloading/malloc_parallel.c         |   0
 .../offloading/mandatory_but_no_devices.c     |   0
 .../test/offloading/memory_manager.cpp        |   0
 .../offloading/multiple_reductions_simple.c   |   0
 .../test/offloading/non_contiguous_update.cpp |   0
 .../test/offloading/offloading_success.c      |   0
 .../test/offloading/offloading_success.cpp    |   0
 .../test/offloading/ompx_bare.c               |   0
 .../test/offloading/ompx_coords.c             |   0
 .../test/offloading/ompx_saxpy_mixed.c        |   0
 .../offloading/parallel_offloading_map.cpp    |   0
 .../parallel_target_teams_reduction.cpp       |   0
 .../parallel_target_teams_reduction_max.cpp   |   0
 .../parallel_target_teams_reduction_min.cpp   |   0
 .../test/offloading/requires.c                |   0
 .../test/offloading/runtime_init.c            |   0
 .../test/offloading/shared_lib_fp_mapping.c   |   0
 .../test/offloading/small_trip_count.c        |   0
 .../small_trip_count_thread_limit.cpp         |   0
 .../test/offloading/spmdization.c             |   0
 .../test/offloading/static_linking.c          |   0
 .../offloading/std_complex_arithmetic.cpp     |   0
 .../struct_mapping_with_pointers.cpp          |   0
 .../test/offloading/target-teams-atomic.c     |   0
 .../test/offloading/target-tile.c             |   0
 .../offloading/target_constexpr_mapping.cpp   |   0
 .../offloading/target_critical_region.cpp     |   0
 .../test/offloading/target_depend_nowait.cpp  |   0
 .../offloading/target_map_for_member_data.cpp |   0
 .../test/offloading/target_nowait_target.cpp  |   0
 .../offloading/task_in_reduction_target.c     |   0
 .../offloading/taskloop_offload_nowait.cpp    |   0
 .../test/offloading/test_libc.cpp             |   0
 .../test/offloading/thread_limit.c            |   0
 .../test/offloading/thread_state_1.c          |   0
 .../test/offloading/thread_state_2.c          |   0
 .../test/offloading/weak.c                    |   0
 .../test/offloading/workshare_chunk.c         |   0
 .../test/offloading/wtime.c                   |   0
 .../test/ompt/callbacks.h                     |   0
 .../test/ompt/register_both.h                 |   0
 .../test/ompt/register_emi.h                  |   0
 .../test/ompt/register_emi_map.h              |   0
 .../test/ompt/register_no_device_init.h       |   0
 .../test/ompt/register_non_emi.h              |   0
 .../test/ompt/register_non_emi_map.h          |   0
 .../test/ompt/register_wrong_return.h         |   0
 .../test/ompt/target_memcpy.c                 |   0
 .../test/ompt/target_memcpy_emi.c             |   0
 .../test/ompt/veccopy.c                       |   0
 .../test/ompt/veccopy_data.c                  |   0
 .../test/ompt/veccopy_disallow_both.c         |   0
 .../test/ompt/veccopy_emi.c                   |   0
 .../test/ompt/veccopy_emi_map.c               |   0
 .../test/ompt/veccopy_map.c                   |   0
 .../test/ompt/veccopy_no_device_init.c        |   0
 .../test/ompt/veccopy_wrong_return.c          |   0
 .../test/unified_shared_memory/api.c          |   0
 .../unified_shared_memory/associate_ptr.c     |   0
 .../unified_shared_memory/close_enter_exit.c  |   0
 .../test/unified_shared_memory/close_manual.c |   0
 .../test/unified_shared_memory/close_member.c |   0
 .../unified_shared_memory/close_modifier.c    |   0
 .../unified_shared_memory/shared_update.c     |   0
 .../tools/CMakeLists.txt                      |   0
 .../tools/deviceinfo/CMakeLists.txt           |   0
 .../tools/deviceinfo/llvm-omp-device-info.cpp |   0
 .../tools/kernelreplay/CMakeLists.txt         |   0
 .../kernelreplay/llvm-omp-kernel-replay.cpp   |   0
 .../unittests/CMakeLists.txt                  |   0
 .../unittests/Plugins/CMakeLists.txt          |   0
 .../unittests/Plugins/NextgenPluginsTest.cpp  |   0
 .../utils/generate_microtask_cases.py         |   0
 openmp/CMakeLists.txt                         |  17 +-
 .../test/api/ompx_dump_mapping_tables.cpp     |  35 ---
 openmp/runtime/src/CMakeLists.txt             |   8 +-
 runtimes/CMakeLists.txt                       |   2 +-
 353 files changed, 360 insertions(+), 69 deletions(-)
 rename {openmp/libomptarget => offload}/CMakeLists.txt (64%)
 rename {openmp/libomptarget => offload}/DeviceRTL/CMakeLists.txt (99%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Allocator.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Configuration.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Debug.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Interface.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/LibC.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Mapping.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/State.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Synchronization.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Types.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/Utils.h (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/include/generated_microtask_cases.gen (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Allocator.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Configuration.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Debug.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Kernel.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/LibC.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Mapping.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Misc.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Parallelism.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Reduction.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/State.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Stub.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Synchronization.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Tasking.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Utils.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/Workshare.cpp (100%)
 rename {openmp/libomptarget => offload}/DeviceRTL/src/exports (100%)
 rename {openmp/libomptarget => offload}/README.txt (100%)
 rename {openmp/libomptarget => offload}/cmake/Modules/LibomptargetGetDependencies.cmake (100%)
 rename {openmp/libomptarget => offload}/cmake/Modules/LibomptargetUtils.cmake (100%)
 create mode 100644 offload/cmake/OpenMPTesting.cmake
 rename {openmp/libomptarget => offload}/docs/declare_target_indirect.md (100%)
 rename {openmp/libomptarget => offload}/include/DeviceImage.h (100%)
 rename {openmp/libomptarget => offload}/include/ExclusiveAccess.h (100%)
 rename {openmp/libomptarget => offload}/include/OffloadEntry.h (100%)
 rename {openmp/libomptarget => offload}/include/OffloadPolicy.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/InternalTypes.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/InteropAPI.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/Mapping.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/OMPT/Callback.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/OMPT/Connector.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/OMPT/Interface.h (100%)
 rename {openmp/libomptarget => offload}/include/OpenMP/omp.h (100%)
 rename {openmp/libomptarget => offload}/include/PluginManager.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/APITypes.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/Debug.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/Environment.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/EnvironmentVar.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/PluginAPI.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/PluginAPI.inc (100%)
 rename {openmp/libomptarget => offload}/include/Shared/Profile.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/Requirements.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/SourceInfo.h (100%)
 rename {openmp/libomptarget => offload}/include/Shared/Utils.h (100%)
 rename {openmp/libomptarget => offload}/include/Utils/ExponentialBackoff.h (100%)
 rename {openmp/libomptarget => offload}/include/device.h (100%)
 rename {openmp/libomptarget => offload}/include/omptarget.h (100%)
 rename {openmp/libomptarget => offload}/include/rtl.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/CMakeLists.txt (97%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/src/rtl.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/OMPT/OmptCallback.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/DLWrap.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/GlobalHandler.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/JIT.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/MemoryManager.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/PluginInterface.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/RPC.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/include/Utils/ELF.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/src/GlobalHandler.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/src/JIT.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/src/PluginInterface.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/src/RPC.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/common/src/Utils/ELF.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/cuda/CMakeLists.txt (96%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/cuda/dynamic_cuda/cuda.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/cuda/src/rtl.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/exports (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/host/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/host/dynamic_ffi/ffi.cpp (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/host/dynamic_ffi/ffi.h (100%)
 rename {openmp/libomptarget => offload}/plugins-nextgen/host/src/rtl.cpp (100%)
 rename {openmp/libomptarget => offload}/src/CMakeLists.txt (98%)
 rename {openmp/libomptarget => offload}/src/DeviceImage.cpp (100%)
 rename {openmp/libomptarget => offload}/src/LegacyAPI.cpp (100%)
 rename {openmp/libomptarget => offload}/src/OffloadRTL.cpp (100%)
 rename {openmp/libomptarget => offload}/src/OpenMP/API.cpp (100%)
 rename {openmp/libomptarget => offload}/src/OpenMP/InteropAPI.cpp (100%)
 rename {openmp/libomptarget => offload}/src/OpenMP/Mapping.cpp (100%)
 rename {openmp/libomptarget => offload}/src/OpenMP/OMPT/Callback.cpp (100%)
 rename {openmp/libomptarget => offload}/src/PluginManager.cpp (100%)
 rename {openmp/libomptarget => offload}/src/device.cpp (100%)
 rename {openmp/libomptarget => offload}/src/exports (100%)
 rename {openmp/libomptarget => offload}/src/interface.cpp (100%)
 rename {openmp/libomptarget => offload}/src/omptarget.cpp (100%)
 rename {openmp/libomptarget => offload}/src/private.h (100%)
 rename {openmp/libomptarget => offload}/test/CMakeLists.txt (78%)
 rename {openmp/libomptarget => offload}/test/Inputs/basic_array.f90 (100%)
 rename {openmp/libomptarget => offload}/test/Inputs/declare_indirect_func.c (100%)
 rename {openmp/libomptarget => offload}/test/api/assert.c (100%)
 rename {openmp/libomptarget => offload}/test/api/is_initial_device.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_device_managed_memory.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_device_managed_memory_alloc.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_device_memory.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_dynamic_shared_memory.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_dynamic_shared_memory_amdgpu.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_dynamic_shared_memory_mixed.inc (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_dynamic_shared_memory_mixed_amdgpu.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_dynamic_shared_memory_mixed_nvptx.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_env_vars.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_get_device_num.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_get_mapped_ptr.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_get_num_devices.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_get_num_devices_with_empty_target.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_get_num_procs.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_host_pinned_memory.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_host_pinned_memory_alloc.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_indirect_call.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_target_memcpy_async1.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_target_memcpy_async2.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_target_memcpy_rect_async1.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_target_memcpy_rect_async2.c (100%)
 rename {openmp/libomptarget => offload}/test/api/omp_target_memset.c (100%)
 rename {openmp/libomptarget => offload}/test/api/ompx_3d.c (100%)
 rename {openmp/libomptarget => offload}/test/api/ompx_3d.cpp (100%)
 rename {openmp/libomptarget => offload}/test/api/ompx_sync.c (100%)
 rename {openmp/libomptarget => offload}/test/api/ompx_sync.cpp (100%)
 rename {openmp/libomptarget => offload}/test/env/base_ptr_ref_count.c (100%)
 rename {openmp/libomptarget => offload}/test/env/omp_target_debug.c (100%)
 rename {openmp/libomptarget => offload}/test/jit/empty_kernel.inc (100%)
 rename {openmp/libomptarget => offload}/test/jit/empty_kernel_lvl1.c (100%)
 rename {openmp/libomptarget => offload}/test/jit/empty_kernel_lvl2.c (100%)
 rename {openmp/libomptarget => offload}/test/jit/type_punning.c (100%)
 rename {openmp/libomptarget => offload}/test/libc/assert.c (100%)
 rename {openmp/libomptarget => offload}/test/libc/fwrite.c (100%)
 rename {openmp/libomptarget => offload}/test/libc/global_ctor_dtor.cpp (100%)
 rename {openmp/libomptarget => offload}/test/libc/host_call.c (100%)
 rename {openmp/libomptarget => offload}/test/libc/malloc.c (100%)
 rename {openmp/libomptarget => offload}/test/libc/puts.c (100%)
 rename {openmp/libomptarget => offload}/test/lit.cfg (100%)
 rename {openmp/libomptarget => offload}/test/lit.site.cfg.in (100%)
 rename {openmp/libomptarget => offload}/test/mapping/alloc_fail.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/array_section_implicit_capture.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/array_section_use_device_ptr.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/auto_zero_copy.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/auto_zero_copy_apu.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/auto_zero_copy_globals.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/data_absent_at_exit.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/data_member_ref.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_api.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers_array.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_default_mappers_var.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_nested_mappers.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_target.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_target_data.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_target_data_enter_exit.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/declare_mapper_target_update.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/delete_inf_refcount.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/device_ptr_update.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/firstprivate_aligned.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/has_device_addr.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/implicit_device_ptr.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/is_device_ptr.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/lambda_by_value.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/lambda_mapping.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/low_alignment.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/map_back_race.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/ompx_hold/omp_target_disassociate_ptr.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/ompx_hold/struct.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/ompx_hold/target-data.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/ompx_hold/target.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/padding_not_mapped.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/power_of_two_alignment.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/pr38704.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/prelock.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_array_extension.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_data.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_data_array_extension.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_data_at_exit.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_enter_data.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_exit_data_delete.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_exit_data_release.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_update.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/target_update_array_extension.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/unified_shared_memory.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/zero_length_array_section.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/present/zero_length_array_section_exit.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/private_mapping.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/ptr_and_obj_motion.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/reduction_implicit_map.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_data_array_extension_at_exit.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_derefence_array_pointrs.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_has_device_addr.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_implicit_partial_map.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_map_for_member_data.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_pointers_members_map.cpp (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_update_array_extension.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_use_device_addr.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_uses_allocator.c (100%)
 rename {openmp/libomptarget => offload}/test/mapping/target_wrong_use_device_addr.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/assert.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/atomic-compare-signedness.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/back2back_distribute.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/barrier_fence.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug47654.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug49021.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug49334.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug49779.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug50022.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug51781.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug51982.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug53727.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug64959.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug64959_compile_only.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/bug74582.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/complex_reduction.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/ctor_dtor.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/cuda_no_devices.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/d2d_memcpy.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/d2d_memcpy_sync.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/default_thread_limit.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/dynamic_module.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/dynamic_module_load.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/extern.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/force-usm.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic-target-parallel-do.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic-target-parallel-region.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic-target-region-1D-array-section.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic-target-region-3D-array-section.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic-target-region-3D-array.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic_array.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/basic_target_region.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/constant-arr-index.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/declare-target-vars-in-target-region.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/double-target-call-with-declare-target.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-allocatable-array-section-1d-bounds.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-allocatable-array-section-3d-bounds.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-allocatable-map-scopes.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-enter-exit-allocatables.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-enter-exit-array-2.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-enter-exit-array-bounds.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-enter-exit-array.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-enter-exit-scalar.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-pointer-scopes-enter-exit.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-pointer-target-array-section-3d-bounds.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-map-pointer-target-scopes.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-nested-target-data.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-parallel-do-collapse.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target-region-implicit-array.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target_map_common_block.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target_map_common_block1.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target_map_common_block2.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/fortran/target_update.f90 (100%)
 rename {openmp/libomptarget => offload}/test/offloading/generic_multiple_parallel_regions.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/global_constructor.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/host_as_target.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/indirect_fp_mapping.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/info.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/interop.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/lone_target_exit_data.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/looptripcnt.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/malloc.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/malloc_parallel.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/mandatory_but_no_devices.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/memory_manager.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/multiple_reductions_simple.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/non_contiguous_update.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/offloading_success.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/offloading_success.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/ompx_bare.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/ompx_coords.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/ompx_saxpy_mixed.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/parallel_offloading_map.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/parallel_target_teams_reduction.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/parallel_target_teams_reduction_max.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/parallel_target_teams_reduction_min.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/requires.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/runtime_init.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/shared_lib_fp_mapping.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/small_trip_count.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/small_trip_count_thread_limit.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/spmdization.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/static_linking.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/std_complex_arithmetic.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/struct_mapping_with_pointers.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target-teams-atomic.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target-tile.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target_constexpr_mapping.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target_critical_region.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target_depend_nowait.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target_map_for_member_data.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/target_nowait_target.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/task_in_reduction_target.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/taskloop_offload_nowait.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/test_libc.cpp (100%)
 rename {openmp/libomptarget => offload}/test/offloading/thread_limit.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/thread_state_1.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/thread_state_2.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/weak.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/workshare_chunk.c (100%)
 rename {openmp/libomptarget => offload}/test/offloading/wtime.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/callbacks.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_both.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_emi.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_emi_map.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_no_device_init.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_non_emi.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_non_emi_map.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/register_wrong_return.h (100%)
 rename {openmp/libomptarget => offload}/test/ompt/target_memcpy.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/target_memcpy_emi.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_data.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_disallow_both.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_emi.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_emi_map.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_map.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_no_device_init.c (100%)
 rename {openmp/libomptarget => offload}/test/ompt/veccopy_wrong_return.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/api.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/associate_ptr.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/close_enter_exit.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/close_manual.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/close_member.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/close_modifier.c (100%)
 rename {openmp/libomptarget => offload}/test/unified_shared_memory/shared_update.c (100%)
 rename {openmp/libomptarget => offload}/tools/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/tools/deviceinfo/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/tools/deviceinfo/llvm-omp-device-info.cpp (100%)
 rename {openmp/libomptarget => offload}/tools/kernelreplay/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/tools/kernelreplay/llvm-omp-kernel-replay.cpp (100%)
 rename {openmp/libomptarget => offload}/unittests/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/unittests/Plugins/CMakeLists.txt (100%)
 rename {openmp/libomptarget => offload}/unittests/Plugins/NextgenPluginsTest.cpp (100%)
 rename {openmp/libomptarget => offload}/utils/generate_microtask_cases.py (100%)
 delete mode 100644 openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp

diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index d511376e18ba5e..43181af3bc1953 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -147,7 +147,7 @@ endif()
 # As we migrate runtimes to using the bootstrapping build, the set of default runtimes
 # should grow as we remove those runtimes from LLVM_ENABLE_PROJECTS above.
 set(LLVM_DEFAULT_RUNTIMES "libcxx;libcxxabi;libunwind")
-set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc")
+set(LLVM_SUPPORTED_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;llvm-libgcc;offload")
 set(LLVM_ENABLE_RUNTIMES "" CACHE STRING
   "Semicolon-separated list of runtimes to build, or \"all\" (${LLVM_DEFAULT_RUNTIMES}). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES}.")
 if(LLVM_ENABLE_RUNTIMES STREQUAL "all")
diff --git a/openmp/libomptarget/CMakeLists.txt b/offload/CMakeLists.txt
similarity index 64%
rename from openmp/libomptarget/CMakeLists.txt
rename to offload/CMakeLists.txt
index 531198fae01699..c90d2698aa0efd 100644
--- a/openmp/libomptarget/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -10,12 +10,98 @@
 #
 ##===----------------------------------------------------------------------===##
 
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
-  message(FATAL_ERROR "Direct configuration not supported, please use parent directory!")
+set(ENABLE_LIBOMPTARGET ON)
+# Currently libomptarget cannot be compiled on Windows or MacOS X.
+# Since the device plugins are only supported on Linux anyway,
+# there is no point in trying to compile libomptarget on other OSes.
+# 32-bit systems are not supported either.
+if (APPLE OR WIN32 OR NOT "cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES OR NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
+  set(ENABLE_LIBOMPTARGET OFF)
 endif()
 
-# Add cmake directory to search for custom cmake functions.
-set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})
+option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
+       ${ENABLE_LIBOMPTARGET})
+if (OPENMP_ENABLE_LIBOMPTARGET)
+  # Check that the library can actually be built.
+  if (APPLE OR WIN32)
+    message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!")
+  elseif (NOT "cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
+    message(FATAL_ERROR "Host compiler must support C++17 to build libomptarget!")
+  elseif (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
+    message(FATAL_ERROR "libomptarget on 32-bit systems are not supported!")
+  endif()
+endif()
+
+# TODO: Leftover from the move, could probably be just LLVM_LIBDIR_SUFFIX everywhere.
+set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+
+set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
+# Add path for custom modules
+list(INSERT CMAKE_MODULE_PATH 0
+  "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+  "${LLVM_COMMON_CMAKE_UTILS}/Modules"
+  )
+
+if (OPENMP_STANDALONE_BUILD)
+  # CMAKE_BUILD_TYPE was not set, default to Release.
+  if (NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE Release)
+  endif()
+
+  # Group common settings.
+  set(OPENMP_ENABLE_WERROR FALSE CACHE BOOL
+    "Enable -Werror flags to turn warnings into errors for supporting compilers.")
+  set(OPENMP_LIBDIR_SUFFIX "" CACHE STRING
+    "Suffix of lib installation directory, e.g. 64 => lib64")
+  # Do not use OPENMP_LIBDIR_SUFFIX directly, use OPENMP_INSTALL_LIBDIR.
+  set(OPENMP_INSTALL_LIBDIR "lib${OPENMP_LIBDIR_SUFFIX}")
+
+  # Group test settings.
+  set(OPENMP_TEST_C_COMPILER ${CMAKE_C_COMPILER} CACHE STRING
+    "C compiler to use for testing OpenMP runtime libraries.")
+  set(OPENMP_TEST_CXX_COMPILER ${CMAKE_CXX_COMPILER} CACHE STRING
+    "C++ compiler to use for testing OpenMP runtime libraries.")
+  set(OPENMP_TEST_Fortran_COMPILER ${CMAKE_Fortran_COMPILER} CACHE STRING
+    "FORTRAN compiler to use for testing OpenMP runtime libraries.")
+  set(OPENMP_LLVM_TOOLS_DIR "" CACHE PATH "Path to LLVM tools for testing.")
+
+  set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ standard to conform to")
+  set(CMAKE_CXX_STANDARD_REQUIRED NO)
+  set(CMAKE_CXX_EXTENSIONS NO)
+else()
+  set(OPENMP_ENABLE_WERROR ${LLVM_ENABLE_WERROR})
+  # If building in tree, we honor the same install suffix LLVM uses.
+  set(OPENMP_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
+
+  if (NOT MSVC)
+    set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang)
+    set(OPENMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++)
+  else()
+    set(OPENMP_TEST_C_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe)
+    set(OPENMP_TEST_CXX_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang++.exe)
+  endif()
+
+  # Check for flang
+  if (NOT MSVC)
+    set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new)
+  else()
+    set(OPENMP_TEST_Fortran_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang-new.exe)
+  endif()
+
+  # Set fortran test compiler if flang is found
+  if (EXISTS "${OPENMP_TEST_Fortran_COMPILER}")
+    message("Using local flang build at ${OPENMP_TEST_Fortran_COMPILER}")
+  else()
+    unset(OPENMP_TEST_Fortran_COMPILER)
+  endif()
+
+  # If not standalone, set CMAKE_CXX_STANDARD but don't set the global cache value,
+  # only set it locally for OpenMP.
+  set(CMAKE_CXX_STANDARD 17)
+  set(CMAKE_CXX_STANDARD_REQUIRED NO)
+  set(CMAKE_CXX_EXTENSIONS NO)
+endif()
 
 # Set the path of all resulting libraries to a unified location so that it can
 # be used for testing.
@@ -36,6 +122,9 @@ include(LibomptargetUtils)
 # Get dependencies for the different components of the project.
 include(LibomptargetGetDependencies)
 
+# Set up testing infrastructure.
+include(OpenMPTesting)
+
 # LLVM source tree is required at build time for libomptarget
 if (NOT LIBOMPTARGET_LLVM_INCLUDE_DIRS)
   message(FATAL_ERROR "Missing definition for LIBOMPTARGET_LLVM_INCLUDE_DIRS")
@@ -129,11 +218,6 @@ set(LIBOMPTARGET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
 message(STATUS "OpenMP tools dir in libomptarget: ${LIBOMP_OMP_TOOLS_INCLUDE_DIR}")
 include_directories(${LIBOMP_OMP_TOOLS_INCLUDE_DIR})
 
-# Definitions for testing, for reuse when testing libomptarget-nvptx.
-set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING
-  "Path to folder containing omp.h")
-set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING
-  "Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled")
 set(LIBOMPTARGET_LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE STRING
   "Path to folder containing llvm library libomptarget.so")
 set(LIBOMPTARGET_LLVM_LIBRARY_INTDIR "${LIBOMPTARGET_INTDIR}" CACHE STRING
diff --git a/openmp/libomptarget/DeviceRTL/CMakeLists.txt b/offload/DeviceRTL/CMakeLists.txt
similarity index 99%
rename from openmp/libomptarget/DeviceRTL/CMakeLists.txt
rename to offload/DeviceRTL/CMakeLists.txt
index 2e7f28df24d649..cbc859059100b6 100644
--- a/openmp/libomptarget/DeviceRTL/CMakeLists.txt
+++ b/offload/DeviceRTL/CMakeLists.txt
@@ -233,7 +233,7 @@ function(compileDeviceRTLLibrary target_cpu target_name target_triple)
   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${bclib_name} ${LIBOMPTARGET_LIBRARY_DIR}/${bclib_name})
 
   # Install bitcode library under the lib destination folder.
-  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${bclib_name} DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
 
   set(target_feature "")
   if("${target_triple}" STREQUAL "nvptx64-nvidia-cuda")
@@ -312,4 +312,4 @@ set_target_properties(omptarget.devicertl PROPERTIES
 )
 target_link_libraries(omptarget.devicertl PRIVATE omptarget.devicertl.all_objs)
 
-install(TARGETS omptarget.devicertl ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR})
+install(TARGETS omptarget.devicertl ARCHIVE DESTINATION ${OFFLOAD_INSTALL_LIBDIR})
diff --git a/openmp/libomptarget/DeviceRTL/include/Allocator.h b/offload/DeviceRTL/include/Allocator.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Allocator.h
rename to offload/DeviceRTL/include/Allocator.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Configuration.h b/offload/DeviceRTL/include/Configuration.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Configuration.h
rename to offload/DeviceRTL/include/Configuration.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Debug.h b/offload/DeviceRTL/include/Debug.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Debug.h
rename to offload/DeviceRTL/include/Debug.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Interface.h b/offload/DeviceRTL/include/Interface.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Interface.h
rename to offload/DeviceRTL/include/Interface.h
diff --git a/openmp/libomptarget/DeviceRTL/include/LibC.h b/offload/DeviceRTL/include/LibC.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/LibC.h
rename to offload/DeviceRTL/include/LibC.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Mapping.h b/offload/DeviceRTL/include/Mapping.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Mapping.h
rename to offload/DeviceRTL/include/Mapping.h
diff --git a/openmp/libomptarget/DeviceRTL/include/State.h b/offload/DeviceRTL/include/State.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/State.h
rename to offload/DeviceRTL/include/State.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Synchronization.h b/offload/DeviceRTL/include/Synchronization.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Synchronization.h
rename to offload/DeviceRTL/include/Synchronization.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Types.h b/offload/DeviceRTL/include/Types.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Types.h
rename to offload/DeviceRTL/include/Types.h
diff --git a/openmp/libomptarget/DeviceRTL/include/Utils.h b/offload/DeviceRTL/include/Utils.h
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/Utils.h
rename to offload/DeviceRTL/include/Utils.h
diff --git a/openmp/libomptarget/DeviceRTL/include/generated_microtask_cases.gen b/offload/DeviceRTL/include/generated_microtask_cases.gen
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/include/generated_microtask_cases.gen
rename to offload/DeviceRTL/include/generated_microtask_cases.gen
diff --git a/openmp/libomptarget/DeviceRTL/src/Allocator.cpp b/offload/DeviceRTL/src/Allocator.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Allocator.cpp
rename to offload/DeviceRTL/src/Allocator.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Configuration.cpp b/offload/DeviceRTL/src/Configuration.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Configuration.cpp
rename to offload/DeviceRTL/src/Configuration.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Debug.cpp b/offload/DeviceRTL/src/Debug.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Debug.cpp
rename to offload/DeviceRTL/src/Debug.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Kernel.cpp b/offload/DeviceRTL/src/Kernel.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Kernel.cpp
rename to offload/DeviceRTL/src/Kernel.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/LibC.cpp b/offload/DeviceRTL/src/LibC.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/LibC.cpp
rename to offload/DeviceRTL/src/LibC.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp b/offload/DeviceRTL/src/Mapping.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Mapping.cpp
rename to offload/DeviceRTL/src/Mapping.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Misc.cpp b/offload/DeviceRTL/src/Misc.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Misc.cpp
rename to offload/DeviceRTL/src/Misc.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Parallelism.cpp b/offload/DeviceRTL/src/Parallelism.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Parallelism.cpp
rename to offload/DeviceRTL/src/Parallelism.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Reduction.cpp b/offload/DeviceRTL/src/Reduction.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Reduction.cpp
rename to offload/DeviceRTL/src/Reduction.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/State.cpp b/offload/DeviceRTL/src/State.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/State.cpp
rename to offload/DeviceRTL/src/State.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Stub.cpp b/offload/DeviceRTL/src/Stub.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Stub.cpp
rename to offload/DeviceRTL/src/Stub.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Synchronization.cpp b/offload/DeviceRTL/src/Synchronization.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Synchronization.cpp
rename to offload/DeviceRTL/src/Synchronization.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Tasking.cpp b/offload/DeviceRTL/src/Tasking.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Tasking.cpp
rename to offload/DeviceRTL/src/Tasking.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Utils.cpp b/offload/DeviceRTL/src/Utils.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Utils.cpp
rename to offload/DeviceRTL/src/Utils.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/Workshare.cpp b/offload/DeviceRTL/src/Workshare.cpp
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/Workshare.cpp
rename to offload/DeviceRTL/src/Workshare.cpp
diff --git a/openmp/libomptarget/DeviceRTL/src/exports b/offload/DeviceRTL/src/exports
similarity index 100%
rename from openmp/libomptarget/DeviceRTL/src/exports
rename to offload/DeviceRTL/src/exports
diff --git a/openmp/libomptarget/README.txt b/offload/README.txt
similarity index 100%
rename from openmp/libomptarget/README.txt
rename to offload/README.txt
diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake b/offload/cmake/Modules/LibomptargetGetDependencies.cmake
similarity index 100%
rename from openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
rename to offload/cmake/Modules/LibomptargetGetDependencies.cmake
diff --git a/openmp/libomptarget/cmake/Modules/LibomptargetUtils.cmake b/offload/cmake/Modules/LibomptargetUtils.cmake
similarity index 100%
rename from openmp/libomptarget/cmake/Modules/LibomptargetUtils.cmake
rename to offload/cmake/Modules/LibomptargetUtils.cmake
diff --git a/offload/cmake/OpenMPTesting.cmake b/offload/cmake/OpenMPTesting.cmake
new file mode 100644
index 00000000000000..11eafeb764260f
--- /dev/null
+++ b/offload/cmake/OpenMPTesting.cmake
@@ -0,0 +1,238 @@
+# Keep track if we have all dependencies.
+set(ENABLE_CHECK_TARGETS TRUE)
+
+# Function to find required dependencies for testing.
+function(find_standalone_test_dependencies)
+  find_package (Python3 COMPONENTS Interpreter)
+
+  if (NOT Python3_Interpreter_FOUND)
+    message(STATUS "Could not find Python.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
+    return()
+  else()
+    set(Python3_EXECUTABLE ${Python3_EXECUTABLE} PARENT_SCOPE)
+  endif()
+
+  # Find executables.
+  find_program(OPENMP_LLVM_LIT_EXECUTABLE
+    NAMES llvm-lit.py llvm-lit lit.py lit
+    PATHS ${OPENMP_LLVM_TOOLS_DIR})
+  if (NOT OPENMP_LLVM_LIT_EXECUTABLE)
+    message(STATUS "Cannot find llvm-lit.")
+    message(STATUS "Please put llvm-lit in your PATH, set OPENMP_LLVM_LIT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
+    return()
+  endif()
+
+  find_program(OPENMP_FILECHECK_EXECUTABLE
+    NAMES FileCheck
+    PATHS ${OPENMP_LLVM_TOOLS_DIR})
+  if (NOT OPENMP_FILECHECK_EXECUTABLE)
+    message(STATUS "Cannot find FileCheck.")
+    message(STATUS "Please put FileCheck in your PATH, set OPENMP_FILECHECK_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
+    return()
+  endif()
+
+  find_program(OPENMP_NOT_EXECUTABLE
+    NAMES not
+    PATHS ${OPENMP_LLVM_TOOLS_DIR})
+  if (NOT OPENMP_NOT_EXECUTABLE)
+    message(STATUS "Cannot find 'not'.")
+    message(STATUS "Please put 'not' in your PATH, set OPENMP_NOT_EXECUTABLE to its full path, or point OPENMP_LLVM_TOOLS_DIR to its directory.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
+    return()
+  endif()
+endfunction()
+
+if (${OPENMP_STANDALONE_BUILD})
+  find_standalone_test_dependencies()
+
+  # Set lit arguments.
+  set(DEFAULT_LIT_ARGS "-sv --show-unsupported --show-xfail")
+  if (MSVC OR XCODE)
+    set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --no-progress-bar")
+  endif()
+  if (${CMAKE_SYSTEM_NAME} MATCHES "AIX")
+    set(DEFAULT_LIT_ARGS "${DEFAULT_LIT_ARGS} --time-tests --timeout=1800")
+  endif()
+  set(OPENMP_LIT_ARGS "${DEFAULT_LIT_ARGS}" CACHE STRING "Options for lit.")
+  separate_arguments(OPENMP_LIT_ARGS)
+else()
+  if (NOT TARGET "FileCheck")
+    message(STATUS "Cannot find 'FileCheck'.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE)
+  else()
+    set(OPENMP_FILECHECK_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/FileCheck)
+  endif()
+  set(OPENMP_NOT_EXECUTABLE ${LLVM_RUNTIME_OUTPUT_INTDIR}/not)
+endif()
+
+# Macro to extract information about compiler from file. (no own scope)
+macro(extract_test_compiler_information lang file)
+  file(READ ${file} information)
+  list(GET information 0 path)
+  list(GET information 1 id)
+  list(GET information 2 version)
+  list(GET information 3 openmp_flags)
+  list(GET information 4 has_tsan_flags)
+  list(GET information 5 has_omit_frame_pointer_flags)
+  list(GET information 6 has_omp_h)
+
+  set(OPENMP_TEST_${lang}_COMPILER_PATH ${path})
+  set(OPENMP_TEST_${lang}_COMPILER_ID ${id})
+  set(OPENMP_TEST_${lang}_COMPILER_VERSION ${version})
+  set(OPENMP_TEST_${lang}_COMPILER_OPENMP_FLAGS ${openmp_flags})
+  set(OPENMP_TEST_${lang}_COMPILER_HAS_TSAN_FLAGS ${has_tsan_flags})
+  set(OPENMP_TEST_${lang}_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS ${has_omit_frame_pointer_flags})
+  set(OPENMP_TEST_${lang}_COMPILER_HAS_OMP_H ${has_omp_h})
+endmacro()
+
+# Function to set variables with information about the test compiler.
+function(set_test_compiler_information dir)
+  extract_test_compiler_information(C ${dir}/CCompilerInformation.txt)
+  extract_test_compiler_information(CXX ${dir}/CXXCompilerInformation.txt)
+  if (NOT("${OPENMP_TEST_C_COMPILER_ID}" STREQUAL "${OPENMP_TEST_CXX_COMPILER_ID}" AND
+          "${OPENMP_TEST_C_COMPILER_VERSION}" STREQUAL "${OPENMP_TEST_CXX_COMPILER_VERSION}"))
+    message(STATUS "Test compilers for C and C++ don't match.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE PARENT_SCOPE)
+  else()
+    set(OPENMP_TEST_COMPILER_ID "${OPENMP_TEST_C_COMPILER_ID}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_VERSION "${OPENMP_TEST_C_COMPILER_VERSION}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "${OPENMP_TEST_C_COMPILER_OPENMP_FLAGS}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS "${OPENMP_TEST_C_COMPILER_HAS_TSAN_FLAGS}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS "${OPENMP_TEST_C_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_HAS_OMP_H "${OPENMP_TEST_C_COMPILER_HAS_OMP_H}" PARENT_SCOPE)
+
+    # Determine major version.
+    string(REGEX MATCH "[0-9]+" major "${OPENMP_TEST_C_COMPILER_VERSION}")
+    string(REGEX MATCH "[0-9]+\\.[0-9]+" majorminor "${OPENMP_TEST_C_COMPILER_VERSION}")
+    set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${major}" PARENT_SCOPE)
+    set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${majorminor}" PARENT_SCOPE)
+  endif()
+endfunction()
+
+if (${OPENMP_STANDALONE_BUILD})
+  # Detect compiler that should be used for testing.
+  # We cannot use ExternalProject_Add() because its configuration runs when this
+  # project is built which is too late for detecting the compiler...
+  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler)
+  execute_process(
+    COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${CMAKE_CURRENT_LIST_DIR}/DetectTestCompiler
+      -DCMAKE_C_COMPILER=${OPENMP_TEST_C_COMPILER}
+      -DCMAKE_CXX_COMPILER=${OPENMP_TEST_CXX_COMPILER}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler
+    OUTPUT_VARIABLE DETECT_COMPILER_OUT
+    ERROR_VARIABLE DETECT_COMPILER_ERR
+    RESULT_VARIABLE DETECT_COMPILER_RESULT)
+  if (DETECT_COMPILER_RESULT)
+    message(STATUS "Could not detect test compilers.")
+    message(WARNING "The check targets will not be available!")
+    set(ENABLE_CHECK_TARGETS FALSE)
+  else()
+    set_test_compiler_information(${CMAKE_CURRENT_BINARY_DIR}/DetectTestCompiler)
+  endif()
+else()
+  # Set the information that we know.
+  set(OPENMP_TEST_COMPILER_ID "Clang")
+  # Cannot use CLANG_VERSION because we are not guaranteed that this is already set.
+  set(OPENMP_TEST_COMPILER_VERSION "${LLVM_VERSION}")
+  set(OPENMP_TEST_COMPILER_VERSION_MAJOR "${LLVM_VERSION_MAJOR}")
+  set(OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}")
+  # Unfortunately the top-level cmake/config-ix.cmake file mangles CMake's
+  # CMAKE_THREAD_LIBS_INIT variable from the FindThreads package, so work
+  # around that, until it is fixed there.
+  if("${CMAKE_THREAD_LIBS_INIT}" STREQUAL "-lpthread")
+    set(OPENMP_TEST_COMPILER_THREAD_FLAGS "-pthread")
+  else()
+    set(OPENMP_TEST_COMPILER_THREAD_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
+  endif()
+  if(TARGET tsan)
+    set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 1)
+  else()
+    set(OPENMP_TEST_COMPILER_HAS_TSAN_FLAGS 0)
+  endif()
+  set(OPENMP_TEST_COMPILER_HAS_OMP_H 1)
+  set(OPENMP_TEST_COMPILER_OPENMP_FLAGS "-fopenmp ${OPENMP_TEST_COMPILER_THREAD_FLAGS}")
+  set(OPENMP_TEST_COMPILER_HAS_OMIT_FRAME_POINTER_FLAGS 1)
+endif()
+
+# Function to set compiler features for use in lit.
+function(update_test_compiler_features)
+  set(FEATURES "[")
+  set(first TRUE)
+  foreach(feat IN LISTS OPENMP_TEST_COMPILER_FEATURE_LIST)
+    if (NOT first)
+      string(APPEND FEATURES ", ")
+    endif()
+    set(first FALSE)
+    string(APPEND FEATURES "'${feat}'")
+  endforeach()
+  string(APPEND FEATURES "]")
+  set(OPENMP_TEST_COMPILER_FEATURES ${FEATURES} PARENT_SCOPE)
+endfunction()
+
+function(set_test_compiler_features)
+  if ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "GNU")
+    set(comp "gcc")
+  elseif ("${OPENMP_TEST_COMPILER_ID}" STREQUAL "Intel")
+    set(comp "icc")
+  else()
+    # Just use the lowercase of the compiler ID as fallback.
+    string(TOLOWER "${OPENMP_TEST_COMPILER_ID}" comp)
+  endif()
+  set(OPENMP_TEST_COMPILER_FEATURE_LIST ${comp} ${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR} ${comp}-${OPENMP_TEST_COMPILER_VERSION_MAJOR_MINOR} ${comp}-${OPENMP_TEST_COMPILER_VERSION} PARENT_SCOPE)
+endfunction()
+set_test_compiler_features()
+update_test_compiler_features()
+
+# Function to add a testsuite for an OpenMP runtime library.
+function(add_offload_testsuite target comment)
+  if (NOT ENABLE_CHECK_TARGETS)
+    add_custom_target(${target}
+      COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, dependencies not found.")
+    message(STATUS "${target} does nothing.")
+    return()
+  endif()
+
+  cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "DEPENDS;ARGS" ${ARGN})
+  # EXCLUDE_FROM_CHECK_ALL excludes the test ${target} out of check-offload.
+  if (NOT ARG_EXCLUDE_FROM_CHECK_ALL)
+    # Register the testsuites and depends for the check-offload rule.
+    set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
+    set_property(GLOBAL APPEND PROPERTY OPENMP_LIT_DEPENDS ${ARG_DEPENDS})
+  endif()
+
+  if (${OPENMP_STANDALONE_BUILD})
+    set(LIT_ARGS ${OPENMP_LIT_ARGS} ${ARG_ARGS})
+    add_custom_target(${target}
+      COMMAND ${Python3_EXECUTABLE} ${OPENMP_LLVM_LIT_EXECUTABLE} ${LIT_ARGS} ${ARG_UNPARSED_ARGUMENTS}
+      COMMENT ${comment}
+      DEPENDS ${ARG_DEPENDS}
+      USES_TERMINAL
+    )
+  else()
+    if (ARG_EXCLUDE_FROM_CHECK_ALL)
+      add_lit_testsuite(${target}
+        ${comment}
+        ${ARG_UNPARSED_ARGUMENTS}
+        EXCLUDE_FROM_CHECK_ALL
+        DEPENDS clang FileCheck not ${ARG_DEPENDS}
+        ARGS ${ARG_ARGS}
+      )
+    else()
+      add_lit_testsuite(${target}
+        ${comment}
+        ${ARG_UNPARSED_ARGUMENTS}
+        DEPENDS clang FileCheck not ${ARG_DEPENDS}
+        ARGS ${ARG_ARGS}
+      )
+    endif()
+  endif()
+endfunction()
diff --git a/openmp/libomptarget/docs/declare_target_indirect.md b/offload/docs/declare_target_indirect.md
similarity index 100%
rename from openmp/libomptarget/docs/declare_target_indirect.md
rename to offload/docs/declare_target_indirect.md
diff --git a/openmp/libomptarget/include/DeviceImage.h b/offload/include/DeviceImage.h
similarity index 100%
rename from openmp/libomptarget/include/DeviceImage.h
rename to offload/include/DeviceImage.h
diff --git a/openmp/libomptarget/include/ExclusiveAccess.h b/offload/include/ExclusiveAccess.h
similarity index 100%
rename from openmp/libomptarget/include/ExclusiveAccess.h
rename to offload/include/ExclusiveAccess.h
diff --git a/openmp/libomptarget/include/OffloadEntry.h b/offload/include/OffloadEntry.h
similarity index 100%
rename from openmp/libomptarget/include/OffloadEntry.h
rename to offload/include/OffloadEntry.h
diff --git a/openmp/libomptarget/include/OffloadPolicy.h b/offload/include/OffloadPolicy.h
similarity index 100%
rename from openmp/libomptarget/include/OffloadPolicy.h
rename to offload/include/OffloadPolicy.h
diff --git a/openmp/libomptarget/include/OpenMP/InternalTypes.h b/offload/include/OpenMP/InternalTypes.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/InternalTypes.h
rename to offload/include/OpenMP/InternalTypes.h
diff --git a/openmp/libomptarget/include/OpenMP/InteropAPI.h b/offload/include/OpenMP/InteropAPI.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/InteropAPI.h
rename to offload/include/OpenMP/InteropAPI.h
diff --git a/openmp/libomptarget/include/OpenMP/Mapping.h b/offload/include/OpenMP/Mapping.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/Mapping.h
rename to offload/include/OpenMP/Mapping.h
diff --git a/openmp/libomptarget/include/OpenMP/OMPT/Callback.h b/offload/include/OpenMP/OMPT/Callback.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/OMPT/Callback.h
rename to offload/include/OpenMP/OMPT/Callback.h
diff --git a/openmp/libomptarget/include/OpenMP/OMPT/Connector.h b/offload/include/OpenMP/OMPT/Connector.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/OMPT/Connector.h
rename to offload/include/OpenMP/OMPT/Connector.h
diff --git a/openmp/libomptarget/include/OpenMP/OMPT/Interface.h b/offload/include/OpenMP/OMPT/Interface.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/OMPT/Interface.h
rename to offload/include/OpenMP/OMPT/Interface.h
diff --git a/openmp/libomptarget/include/OpenMP/omp.h b/offload/include/OpenMP/omp.h
similarity index 100%
rename from openmp/libomptarget/include/OpenMP/omp.h
rename to offload/include/OpenMP/omp.h
diff --git a/openmp/libomptarget/include/PluginManager.h b/offload/include/PluginManager.h
similarity index 100%
rename from openmp/libomptarget/include/PluginManager.h
rename to offload/include/PluginManager.h
diff --git a/openmp/libomptarget/include/Shared/APITypes.h b/offload/include/Shared/APITypes.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/APITypes.h
rename to offload/include/Shared/APITypes.h
diff --git a/openmp/libomptarget/include/Shared/Debug.h b/offload/include/Shared/Debug.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/Debug.h
rename to offload/include/Shared/Debug.h
diff --git a/openmp/libomptarget/include/Shared/Environment.h b/offload/include/Shared/Environment.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/Environment.h
rename to offload/include/Shared/Environment.h
diff --git a/openmp/libomptarget/include/Shared/EnvironmentVar.h b/offload/include/Shared/EnvironmentVar.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/EnvironmentVar.h
rename to offload/include/Shared/EnvironmentVar.h
diff --git a/openmp/libomptarget/include/Shared/PluginAPI.h b/offload/include/Shared/PluginAPI.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/PluginAPI.h
rename to offload/include/Shared/PluginAPI.h
diff --git a/openmp/libomptarget/include/Shared/PluginAPI.inc b/offload/include/Shared/PluginAPI.inc
similarity index 100%
rename from openmp/libomptarget/include/Shared/PluginAPI.inc
rename to offload/include/Shared/PluginAPI.inc
diff --git a/openmp/libomptarget/include/Shared/Profile.h b/offload/include/Shared/Profile.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/Profile.h
rename to offload/include/Shared/Profile.h
diff --git a/openmp/libomptarget/include/Shared/Requirements.h b/offload/include/Shared/Requirements.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/Requirements.h
rename to offload/include/Shared/Requirements.h
diff --git a/openmp/libomptarget/include/Shared/SourceInfo.h b/offload/include/Shared/SourceInfo.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/SourceInfo.h
rename to offload/include/Shared/SourceInfo.h
diff --git a/openmp/libomptarget/include/Shared/Utils.h b/offload/include/Shared/Utils.h
similarity index 100%
rename from openmp/libomptarget/include/Shared/Utils.h
rename to offload/include/Shared/Utils.h
diff --git a/openmp/libomptarget/include/Utils/ExponentialBackoff.h b/offload/include/Utils/ExponentialBackoff.h
similarity index 100%
rename from openmp/libomptarget/include/Utils/ExponentialBackoff.h
rename to offload/include/Utils/ExponentialBackoff.h
diff --git a/openmp/libomptarget/include/device.h b/offload/include/device.h
similarity index 100%
rename from openmp/libomptarget/include/device.h
rename to offload/include/device.h
diff --git a/openmp/libomptarget/include/omptarget.h b/offload/include/omptarget.h
similarity index 100%
rename from openmp/libomptarget/include/omptarget.h
rename to offload/include/omptarget.h
diff --git a/openmp/libomptarget/include/rtl.h b/offload/include/rtl.h
similarity index 100%
rename from openmp/libomptarget/include/rtl.h
rename to offload/include/rtl.h
diff --git a/openmp/libomptarget/plugins-nextgen/CMakeLists.txt b/offload/plugins-nextgen/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/CMakeLists.txt
rename to offload/plugins-nextgen/CMakeLists.txt
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt b/offload/plugins-nextgen/amdgpu/CMakeLists.txt
similarity index 97%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
rename to offload/plugins-nextgen/amdgpu/CMakeLists.txt
index 40df77102c78fb..f5f7096137c20f 100644
--- a/openmp/libomptarget/plugins-nextgen/amdgpu/CMakeLists.txt
+++ b/offload/plugins-nextgen/amdgpu/CMakeLists.txt
@@ -59,6 +59,6 @@ else()
 endif()
 
 # Install plugin under the lib destination folder.
-install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+install(TARGETS omptarget.rtl.amdgpu LIBRARY DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
 set_target_properties(omptarget.rtl.amdgpu PROPERTIES
   INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp b/offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp
rename to offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h b/offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h
rename to offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa.h
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h b/offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h
rename to offload/plugins-nextgen/amdgpu/dynamic_hsa/hsa_ext_amd.h
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
rename to offload/plugins-nextgen/amdgpu/src/rtl.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h b/offload/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
rename to offload/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/CMakeLists.txt b/offload/plugins-nextgen/common/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/CMakeLists.txt
rename to offload/plugins-nextgen/common/CMakeLists.txt
diff --git a/openmp/libomptarget/plugins-nextgen/common/OMPT/OmptCallback.cpp b/offload/plugins-nextgen/common/OMPT/OmptCallback.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/OMPT/OmptCallback.cpp
rename to offload/plugins-nextgen/common/OMPT/OmptCallback.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/DLWrap.h b/offload/plugins-nextgen/common/include/DLWrap.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/DLWrap.h
rename to offload/plugins-nextgen/common/include/DLWrap.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/GlobalHandler.h b/offload/plugins-nextgen/common/include/GlobalHandler.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/GlobalHandler.h
rename to offload/plugins-nextgen/common/include/GlobalHandler.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/JIT.h b/offload/plugins-nextgen/common/include/JIT.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/JIT.h
rename to offload/plugins-nextgen/common/include/JIT.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/MemoryManager.h b/offload/plugins-nextgen/common/include/MemoryManager.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/MemoryManager.h
rename to offload/plugins-nextgen/common/include/MemoryManager.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/PluginInterface.h
rename to offload/plugins-nextgen/common/include/PluginInterface.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/RPC.h b/offload/plugins-nextgen/common/include/RPC.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/RPC.h
rename to offload/plugins-nextgen/common/include/RPC.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/include/Utils/ELF.h b/offload/plugins-nextgen/common/include/Utils/ELF.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/include/Utils/ELF.h
rename to offload/plugins-nextgen/common/include/Utils/ELF.h
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/GlobalHandler.cpp b/offload/plugins-nextgen/common/src/GlobalHandler.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/src/GlobalHandler.cpp
rename to offload/plugins-nextgen/common/src/GlobalHandler.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/JIT.cpp b/offload/plugins-nextgen/common/src/JIT.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/src/JIT.cpp
rename to offload/plugins-nextgen/common/src/JIT.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/src/PluginInterface.cpp
rename to offload/plugins-nextgen/common/src/PluginInterface.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp b/offload/plugins-nextgen/common/src/RPC.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/src/RPC.cpp
rename to offload/plugins-nextgen/common/src/RPC.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp b/offload/plugins-nextgen/common/src/Utils/ELF.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/common/src/Utils/ELF.cpp
rename to offload/plugins-nextgen/common/src/Utils/ELF.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt b/offload/plugins-nextgen/cuda/CMakeLists.txt
similarity index 96%
rename from openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
rename to offload/plugins-nextgen/cuda/CMakeLists.txt
index b3530462aa19ba..0284bd22d2a4df 100644
--- a/openmp/libomptarget/plugins-nextgen/cuda/CMakeLists.txt
+++ b/offload/plugins-nextgen/cuda/CMakeLists.txt
@@ -53,6 +53,6 @@ else()
 endif()
 
 # Install plugin under the lib destination folder.
-install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
 set_target_properties(omptarget.rtl.cuda PROPERTIES
   INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
diff --git a/openmp/libomptarget/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp b/offload/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp
rename to offload/plugins-nextgen/cuda/dynamic_cuda/cuda.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/cuda/dynamic_cuda/cuda.h b/offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/cuda/dynamic_cuda/cuda.h
rename to offload/plugins-nextgen/cuda/dynamic_cuda/cuda.h
diff --git a/openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
rename to offload/plugins-nextgen/cuda/src/rtl.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/exports b/offload/plugins-nextgen/exports
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/exports
rename to offload/plugins-nextgen/exports
diff --git a/openmp/libomptarget/plugins-nextgen/host/CMakeLists.txt b/offload/plugins-nextgen/host/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/host/CMakeLists.txt
rename to offload/plugins-nextgen/host/CMakeLists.txt
diff --git a/openmp/libomptarget/plugins-nextgen/host/dynamic_ffi/ffi.cpp b/offload/plugins-nextgen/host/dynamic_ffi/ffi.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/host/dynamic_ffi/ffi.cpp
rename to offload/plugins-nextgen/host/dynamic_ffi/ffi.cpp
diff --git a/openmp/libomptarget/plugins-nextgen/host/dynamic_ffi/ffi.h b/offload/plugins-nextgen/host/dynamic_ffi/ffi.h
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/host/dynamic_ffi/ffi.h
rename to offload/plugins-nextgen/host/dynamic_ffi/ffi.h
diff --git a/openmp/libomptarget/plugins-nextgen/host/src/rtl.cpp b/offload/plugins-nextgen/host/src/rtl.cpp
similarity index 100%
rename from openmp/libomptarget/plugins-nextgen/host/src/rtl.cpp
rename to offload/plugins-nextgen/host/src/rtl.cpp
diff --git a/openmp/libomptarget/src/CMakeLists.txt b/offload/src/CMakeLists.txt
similarity index 98%
rename from openmp/libomptarget/src/CMakeLists.txt
rename to offload/src/CMakeLists.txt
index d0971bd4ef079e..b0a740d477ca63 100644
--- a/openmp/libomptarget/src/CMakeLists.txt
+++ b/offload/src/CMakeLists.txt
@@ -87,4 +87,4 @@ set_target_properties(omptarget PROPERTIES
                       POSITION_INDEPENDENT_CODE ON
                       INSTALL_RPATH "$ORIGIN"
                       BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/..")
-install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+install(TARGETS omptarget LIBRARY COMPONENT omptarget DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
diff --git a/openmp/libomptarget/src/DeviceImage.cpp b/offload/src/DeviceImage.cpp
similarity index 100%
rename from openmp/libomptarget/src/DeviceImage.cpp
rename to offload/src/DeviceImage.cpp
diff --git a/openmp/libomptarget/src/LegacyAPI.cpp b/offload/src/LegacyAPI.cpp
similarity index 100%
rename from openmp/libomptarget/src/LegacyAPI.cpp
rename to offload/src/LegacyAPI.cpp
diff --git a/openmp/libomptarget/src/OffloadRTL.cpp b/offload/src/OffloadRTL.cpp
similarity index 100%
rename from openmp/libomptarget/src/OffloadRTL.cpp
rename to offload/src/OffloadRTL.cpp
diff --git a/openmp/libomptarget/src/OpenMP/API.cpp b/offload/src/OpenMP/API.cpp
similarity index 100%
rename from openmp/libomptarget/src/OpenMP/API.cpp
rename to offload/src/OpenMP/API.cpp
diff --git a/openmp/libomptarget/src/OpenMP/InteropAPI.cpp b/offload/src/OpenMP/InteropAPI.cpp
similarity index 100%
rename from openmp/libomptarget/src/OpenMP/InteropAPI.cpp
rename to offload/src/OpenMP/InteropAPI.cpp
diff --git a/openmp/libomptarget/src/OpenMP/Mapping.cpp b/offload/src/OpenMP/Mapping.cpp
similarity index 100%
rename from openmp/libomptarget/src/OpenMP/Mapping.cpp
rename to offload/src/OpenMP/Mapping.cpp
diff --git a/openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp b/offload/src/OpenMP/OMPT/Callback.cpp
similarity index 100%
rename from openmp/libomptarget/src/OpenMP/OMPT/Callback.cpp
rename to offload/src/OpenMP/OMPT/Callback.cpp
diff --git a/openmp/libomptarget/src/PluginManager.cpp b/offload/src/PluginManager.cpp
similarity index 100%
rename from openmp/libomptarget/src/PluginManager.cpp
rename to offload/src/PluginManager.cpp
diff --git a/openmp/libomptarget/src/device.cpp b/offload/src/device.cpp
similarity index 100%
rename from openmp/libomptarget/src/device.cpp
rename to offload/src/device.cpp
diff --git a/openmp/libomptarget/src/exports b/offload/src/exports
similarity index 100%
rename from openmp/libomptarget/src/exports
rename to offload/src/exports
diff --git a/openmp/libomptarget/src/interface.cpp b/offload/src/interface.cpp
similarity index 100%
rename from openmp/libomptarget/src/interface.cpp
rename to offload/src/interface.cpp
diff --git a/openmp/libomptarget/src/omptarget.cpp b/offload/src/omptarget.cpp
similarity index 100%
rename from openmp/libomptarget/src/omptarget.cpp
rename to offload/src/omptarget.cpp
diff --git a/openmp/libomptarget/src/private.h b/offload/src/private.h
similarity index 100%
rename from openmp/libomptarget/src/private.h
rename to offload/src/private.h
diff --git a/openmp/libomptarget/test/CMakeLists.txt b/offload/test/CMakeLists.txt
similarity index 78%
rename from openmp/libomptarget/test/CMakeLists.txt
rename to offload/test/CMakeLists.txt
index a0ba233eaa5726..59c9dd98f712ce 100644
--- a/openmp/libomptarget/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -1,6 +1,6 @@
 # CMakeLists.txt file for unit testing OpenMP offloading runtime library.
-if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
-   OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
+if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
+   CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0.0)
   libomptarget_say("Can only test with Clang compiler in version 6.0.0 or later.")
   libomptarget_warning_say("The check-libomptarget target will not be available!")
   return()
@@ -20,7 +20,7 @@ string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM
 foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
   string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
 
-  add_openmp_testsuite(check-libomptarget-${CURRENT_TARGET}
+  add_offload_testsuite(check-libomptarget-${CURRENT_TARGET}
     "Running libomptarget tests"
     ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
     DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
@@ -34,7 +34,14 @@ foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
 endforeach()
 
 
-add_openmp_testsuite(check-libomptarget
+add_offload_testsuite(check-libomptarget
+  "Running libomptarget tests"
+  ${LIBOMPTARGET_LIT_TESTSUITES}
+  EXCLUDE_FROM_CHECK_ALL
+  DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
+  ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
+
+add_offload_testsuite(check-offload
   "Running libomptarget tests"
   ${LIBOMPTARGET_LIT_TESTSUITES}
   EXCLUDE_FROM_CHECK_ALL
diff --git a/openmp/libomptarget/test/Inputs/basic_array.f90 b/offload/test/Inputs/basic_array.f90
similarity index 100%
rename from openmp/libomptarget/test/Inputs/basic_array.f90
rename to offload/test/Inputs/basic_array.f90
diff --git a/openmp/libomptarget/test/Inputs/declare_indirect_func.c b/offload/test/Inputs/declare_indirect_func.c
similarity index 100%
rename from openmp/libomptarget/test/Inputs/declare_indirect_func.c
rename to offload/test/Inputs/declare_indirect_func.c
diff --git a/openmp/libomptarget/test/api/assert.c b/offload/test/api/assert.c
similarity index 100%
rename from openmp/libomptarget/test/api/assert.c
rename to offload/test/api/assert.c
diff --git a/openmp/libomptarget/test/api/is_initial_device.c b/offload/test/api/is_initial_device.c
similarity index 100%
rename from openmp/libomptarget/test/api/is_initial_device.c
rename to offload/test/api/is_initial_device.c
diff --git a/openmp/libomptarget/test/api/omp_device_managed_memory.c b/offload/test/api/omp_device_managed_memory.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_device_managed_memory.c
rename to offload/test/api/omp_device_managed_memory.c
diff --git a/openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c b/offload/test/api/omp_device_managed_memory_alloc.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_device_managed_memory_alloc.c
rename to offload/test/api/omp_device_managed_memory_alloc.c
diff --git a/openmp/libomptarget/test/api/omp_device_memory.c b/offload/test/api/omp_device_memory.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_device_memory.c
rename to offload/test/api/omp_device_memory.c
diff --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory.c b/offload/test/api/omp_dynamic_shared_memory.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_dynamic_shared_memory.c
rename to offload/test/api/omp_dynamic_shared_memory.c
diff --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory_amdgpu.c b/offload/test/api/omp_dynamic_shared_memory_amdgpu.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_dynamic_shared_memory_amdgpu.c
rename to offload/test/api/omp_dynamic_shared_memory_amdgpu.c
diff --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed.inc b/offload/test/api/omp_dynamic_shared_memory_mixed.inc
similarity index 100%
rename from openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed.inc
rename to offload/test/api/omp_dynamic_shared_memory_mixed.inc
diff --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed_amdgpu.c b/offload/test/api/omp_dynamic_shared_memory_mixed_amdgpu.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed_amdgpu.c
rename to offload/test/api/omp_dynamic_shared_memory_mixed_amdgpu.c
diff --git a/openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed_nvptx.c b/offload/test/api/omp_dynamic_shared_memory_mixed_nvptx.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_dynamic_shared_memory_mixed_nvptx.c
rename to offload/test/api/omp_dynamic_shared_memory_mixed_nvptx.c
diff --git a/openmp/libomptarget/test/api/omp_env_vars.c b/offload/test/api/omp_env_vars.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_env_vars.c
rename to offload/test/api/omp_env_vars.c
diff --git a/openmp/libomptarget/test/api/omp_get_device_num.c b/offload/test/api/omp_get_device_num.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_get_device_num.c
rename to offload/test/api/omp_get_device_num.c
diff --git a/openmp/libomptarget/test/api/omp_get_mapped_ptr.c b/offload/test/api/omp_get_mapped_ptr.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_get_mapped_ptr.c
rename to offload/test/api/omp_get_mapped_ptr.c
diff --git a/openmp/libomptarget/test/api/omp_get_num_devices.c b/offload/test/api/omp_get_num_devices.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_get_num_devices.c
rename to offload/test/api/omp_get_num_devices.c
diff --git a/openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c b/offload/test/api/omp_get_num_devices_with_empty_target.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_get_num_devices_with_empty_target.c
rename to offload/test/api/omp_get_num_devices_with_empty_target.c
diff --git a/openmp/libomptarget/test/api/omp_get_num_procs.c b/offload/test/api/omp_get_num_procs.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_get_num_procs.c
rename to offload/test/api/omp_get_num_procs.c
diff --git a/openmp/libomptarget/test/api/omp_host_pinned_memory.c b/offload/test/api/omp_host_pinned_memory.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_host_pinned_memory.c
rename to offload/test/api/omp_host_pinned_memory.c
diff --git a/openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c b/offload/test/api/omp_host_pinned_memory_alloc.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_host_pinned_memory_alloc.c
rename to offload/test/api/omp_host_pinned_memory_alloc.c
diff --git a/openmp/libomptarget/test/api/omp_indirect_call.c b/offload/test/api/omp_indirect_call.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_indirect_call.c
rename to offload/test/api/omp_indirect_call.c
diff --git a/openmp/libomptarget/test/api/omp_target_memcpy_async1.c b/offload/test/api/omp_target_memcpy_async1.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_target_memcpy_async1.c
rename to offload/test/api/omp_target_memcpy_async1.c
diff --git a/openmp/libomptarget/test/api/omp_target_memcpy_async2.c b/offload/test/api/omp_target_memcpy_async2.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_target_memcpy_async2.c
rename to offload/test/api/omp_target_memcpy_async2.c
diff --git a/openmp/libomptarget/test/api/omp_target_memcpy_rect_async1.c b/offload/test/api/omp_target_memcpy_rect_async1.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_target_memcpy_rect_async1.c
rename to offload/test/api/omp_target_memcpy_rect_async1.c
diff --git a/openmp/libomptarget/test/api/omp_target_memcpy_rect_async2.c b/offload/test/api/omp_target_memcpy_rect_async2.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_target_memcpy_rect_async2.c
rename to offload/test/api/omp_target_memcpy_rect_async2.c
diff --git a/openmp/libomptarget/test/api/omp_target_memset.c b/offload/test/api/omp_target_memset.c
similarity index 100%
rename from openmp/libomptarget/test/api/omp_target_memset.c
rename to offload/test/api/omp_target_memset.c
diff --git a/openmp/libomptarget/test/api/ompx_3d.c b/offload/test/api/ompx_3d.c
similarity index 100%
rename from openmp/libomptarget/test/api/ompx_3d.c
rename to offload/test/api/ompx_3d.c
diff --git a/openmp/libomptarget/test/api/ompx_3d.cpp b/offload/test/api/ompx_3d.cpp
similarity index 100%
rename from openmp/libomptarget/test/api/ompx_3d.cpp
rename to offload/test/api/ompx_3d.cpp
diff --git a/openmp/libomptarget/test/api/ompx_sync.c b/offload/test/api/ompx_sync.c
similarity index 100%
rename from openmp/libomptarget/test/api/ompx_sync.c
rename to offload/test/api/ompx_sync.c
diff --git a/openmp/libomptarget/test/api/ompx_sync.cpp b/offload/test/api/ompx_sync.cpp
similarity index 100%
rename from openmp/libomptarget/test/api/ompx_sync.cpp
rename to offload/test/api/ompx_sync.cpp
diff --git a/openmp/libomptarget/test/env/base_ptr_ref_count.c b/offload/test/env/base_ptr_ref_count.c
similarity index 100%
rename from openmp/libomptarget/test/env/base_ptr_ref_count.c
rename to offload/test/env/base_ptr_ref_count.c
diff --git a/openmp/libomptarget/test/env/omp_target_debug.c b/offload/test/env/omp_target_debug.c
similarity index 100%
rename from openmp/libomptarget/test/env/omp_target_debug.c
rename to offload/test/env/omp_target_debug.c
diff --git a/openmp/libomptarget/test/jit/empty_kernel.inc b/offload/test/jit/empty_kernel.inc
similarity index 100%
rename from openmp/libomptarget/test/jit/empty_kernel.inc
rename to offload/test/jit/empty_kernel.inc
diff --git a/openmp/libomptarget/test/jit/empty_kernel_lvl1.c b/offload/test/jit/empty_kernel_lvl1.c
similarity index 100%
rename from openmp/libomptarget/test/jit/empty_kernel_lvl1.c
rename to offload/test/jit/empty_kernel_lvl1.c
diff --git a/openmp/libomptarget/test/jit/empty_kernel_lvl2.c b/offload/test/jit/empty_kernel_lvl2.c
similarity index 100%
rename from openmp/libomptarget/test/jit/empty_kernel_lvl2.c
rename to offload/test/jit/empty_kernel_lvl2.c
diff --git a/openmp/libomptarget/test/jit/type_punning.c b/offload/test/jit/type_punning.c
similarity index 100%
rename from openmp/libomptarget/test/jit/type_punning.c
rename to offload/test/jit/type_punning.c
diff --git a/openmp/libomptarget/test/libc/assert.c b/offload/test/libc/assert.c
similarity index 100%
rename from openmp/libomptarget/test/libc/assert.c
rename to offload/test/libc/assert.c
diff --git a/openmp/libomptarget/test/libc/fwrite.c b/offload/test/libc/fwrite.c
similarity index 100%
rename from openmp/libomptarget/test/libc/fwrite.c
rename to offload/test/libc/fwrite.c
diff --git a/openmp/libomptarget/test/libc/global_ctor_dtor.cpp b/offload/test/libc/global_ctor_dtor.cpp
similarity index 100%
rename from openmp/libomptarget/test/libc/global_ctor_dtor.cpp
rename to offload/test/libc/global_ctor_dtor.cpp
diff --git a/openmp/libomptarget/test/libc/host_call.c b/offload/test/libc/host_call.c
similarity index 100%
rename from openmp/libomptarget/test/libc/host_call.c
rename to offload/test/libc/host_call.c
diff --git a/openmp/libomptarget/test/libc/malloc.c b/offload/test/libc/malloc.c
similarity index 100%
rename from openmp/libomptarget/test/libc/malloc.c
rename to offload/test/libc/malloc.c
diff --git a/openmp/libomptarget/test/libc/puts.c b/offload/test/libc/puts.c
similarity index 100%
rename from openmp/libomptarget/test/libc/puts.c
rename to offload/test/libc/puts.c
diff --git a/openmp/libomptarget/test/lit.cfg b/offload/test/lit.cfg
similarity index 100%
rename from openmp/libomptarget/test/lit.cfg
rename to offload/test/lit.cfg
diff --git a/openmp/libomptarget/test/lit.site.cfg.in b/offload/test/lit.site.cfg.in
similarity index 100%
rename from openmp/libomptarget/test/lit.site.cfg.in
rename to offload/test/lit.site.cfg.in
diff --git a/openmp/libomptarget/test/mapping/alloc_fail.c b/offload/test/mapping/alloc_fail.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/alloc_fail.c
rename to offload/test/mapping/alloc_fail.c
diff --git a/openmp/libomptarget/test/mapping/array_section_implicit_capture.c b/offload/test/mapping/array_section_implicit_capture.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/array_section_implicit_capture.c
rename to offload/test/mapping/array_section_implicit_capture.c
diff --git a/openmp/libomptarget/test/mapping/array_section_use_device_ptr.c b/offload/test/mapping/array_section_use_device_ptr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/array_section_use_device_ptr.c
rename to offload/test/mapping/array_section_use_device_ptr.c
diff --git a/openmp/libomptarget/test/mapping/auto_zero_copy.cpp b/offload/test/mapping/auto_zero_copy.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/auto_zero_copy.cpp
rename to offload/test/mapping/auto_zero_copy.cpp
diff --git a/openmp/libomptarget/test/mapping/auto_zero_copy_apu.cpp b/offload/test/mapping/auto_zero_copy_apu.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/auto_zero_copy_apu.cpp
rename to offload/test/mapping/auto_zero_copy_apu.cpp
diff --git a/openmp/libomptarget/test/mapping/auto_zero_copy_globals.cpp b/offload/test/mapping/auto_zero_copy_globals.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/auto_zero_copy_globals.cpp
rename to offload/test/mapping/auto_zero_copy_globals.cpp
diff --git a/openmp/libomptarget/test/mapping/data_absent_at_exit.c b/offload/test/mapping/data_absent_at_exit.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/data_absent_at_exit.c
rename to offload/test/mapping/data_absent_at_exit.c
diff --git a/openmp/libomptarget/test/mapping/data_member_ref.cpp b/offload/test/mapping/data_member_ref.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/data_member_ref.cpp
rename to offload/test/mapping/data_member_ref.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_api.cpp b/offload/test/mapping/declare_mapper_api.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_api.cpp
rename to offload/test/mapping/declare_mapper_api.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers_array.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers_array.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers_array_subscript.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers_ptr_subscript.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_var.cpp b/offload/test/mapping/declare_mapper_nested_default_mappers_var.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_var.cpp
rename to offload/test/mapping/declare_mapper_nested_default_mappers_var.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_nested_mappers.cpp b/offload/test/mapping/declare_mapper_nested_mappers.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_nested_mappers.cpp
rename to offload/test/mapping/declare_mapper_nested_mappers.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_target.cpp b/offload/test/mapping/declare_mapper_target.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_target.cpp
rename to offload/test/mapping/declare_mapper_target.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_target_data.cpp b/offload/test/mapping/declare_mapper_target_data.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_target_data.cpp
rename to offload/test/mapping/declare_mapper_target_data.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp b/offload/test/mapping/declare_mapper_target_data_enter_exit.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_target_data_enter_exit.cpp
rename to offload/test/mapping/declare_mapper_target_data_enter_exit.cpp
diff --git a/openmp/libomptarget/test/mapping/declare_mapper_target_update.cpp b/offload/test/mapping/declare_mapper_target_update.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/declare_mapper_target_update.cpp
rename to offload/test/mapping/declare_mapper_target_update.cpp
diff --git a/openmp/libomptarget/test/mapping/delete_inf_refcount.c b/offload/test/mapping/delete_inf_refcount.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/delete_inf_refcount.c
rename to offload/test/mapping/delete_inf_refcount.c
diff --git a/openmp/libomptarget/test/mapping/device_ptr_update.c b/offload/test/mapping/device_ptr_update.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/device_ptr_update.c
rename to offload/test/mapping/device_ptr_update.c
diff --git a/openmp/libomptarget/test/mapping/firstprivate_aligned.cpp b/offload/test/mapping/firstprivate_aligned.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/firstprivate_aligned.cpp
rename to offload/test/mapping/firstprivate_aligned.cpp
diff --git a/openmp/libomptarget/test/mapping/has_device_addr.cpp b/offload/test/mapping/has_device_addr.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/has_device_addr.cpp
rename to offload/test/mapping/has_device_addr.cpp
diff --git a/openmp/libomptarget/test/mapping/implicit_device_ptr.c b/offload/test/mapping/implicit_device_ptr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/implicit_device_ptr.c
rename to offload/test/mapping/implicit_device_ptr.c
diff --git a/openmp/libomptarget/test/mapping/is_device_ptr.cpp b/offload/test/mapping/is_device_ptr.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/is_device_ptr.cpp
rename to offload/test/mapping/is_device_ptr.cpp
diff --git a/openmp/libomptarget/test/mapping/lambda_by_value.cpp b/offload/test/mapping/lambda_by_value.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/lambda_by_value.cpp
rename to offload/test/mapping/lambda_by_value.cpp
diff --git a/openmp/libomptarget/test/mapping/lambda_mapping.cpp b/offload/test/mapping/lambda_mapping.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/lambda_mapping.cpp
rename to offload/test/mapping/lambda_mapping.cpp
diff --git a/openmp/libomptarget/test/mapping/low_alignment.c b/offload/test/mapping/low_alignment.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/low_alignment.c
rename to offload/test/mapping/low_alignment.c
diff --git a/openmp/libomptarget/test/mapping/map_back_race.cpp b/offload/test/mapping/map_back_race.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/map_back_race.cpp
rename to offload/test/mapping/map_back_race.cpp
diff --git a/openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c b/offload/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
rename to offload/test/mapping/ompx_hold/omp_target_disassociate_ptr.c
diff --git a/openmp/libomptarget/test/mapping/ompx_hold/struct.c b/offload/test/mapping/ompx_hold/struct.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/ompx_hold/struct.c
rename to offload/test/mapping/ompx_hold/struct.c
diff --git a/openmp/libomptarget/test/mapping/ompx_hold/target-data.c b/offload/test/mapping/ompx_hold/target-data.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/ompx_hold/target-data.c
rename to offload/test/mapping/ompx_hold/target-data.c
diff --git a/openmp/libomptarget/test/mapping/ompx_hold/target.c b/offload/test/mapping/ompx_hold/target.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/ompx_hold/target.c
rename to offload/test/mapping/ompx_hold/target.c
diff --git a/openmp/libomptarget/test/mapping/padding_not_mapped.c b/offload/test/mapping/padding_not_mapped.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/padding_not_mapped.c
rename to offload/test/mapping/padding_not_mapped.c
diff --git a/openmp/libomptarget/test/mapping/power_of_two_alignment.c b/offload/test/mapping/power_of_two_alignment.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/power_of_two_alignment.c
rename to offload/test/mapping/power_of_two_alignment.c
diff --git a/openmp/libomptarget/test/mapping/pr38704.c b/offload/test/mapping/pr38704.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/pr38704.c
rename to offload/test/mapping/pr38704.c
diff --git a/openmp/libomptarget/test/mapping/prelock.cpp b/offload/test/mapping/prelock.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/prelock.cpp
rename to offload/test/mapping/prelock.cpp
diff --git a/openmp/libomptarget/test/mapping/present/target.c b/offload/test/mapping/present/target.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target.c
rename to offload/test/mapping/present/target.c
diff --git a/openmp/libomptarget/test/mapping/present/target_array_extension.c b/offload/test/mapping/present/target_array_extension.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_array_extension.c
rename to offload/test/mapping/present/target_array_extension.c
diff --git a/openmp/libomptarget/test/mapping/present/target_data.c b/offload/test/mapping/present/target_data.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_data.c
rename to offload/test/mapping/present/target_data.c
diff --git a/openmp/libomptarget/test/mapping/present/target_data_array_extension.c b/offload/test/mapping/present/target_data_array_extension.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_data_array_extension.c
rename to offload/test/mapping/present/target_data_array_extension.c
diff --git a/openmp/libomptarget/test/mapping/present/target_data_at_exit.c b/offload/test/mapping/present/target_data_at_exit.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_data_at_exit.c
rename to offload/test/mapping/present/target_data_at_exit.c
diff --git a/openmp/libomptarget/test/mapping/present/target_enter_data.c b/offload/test/mapping/present/target_enter_data.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_enter_data.c
rename to offload/test/mapping/present/target_enter_data.c
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_delete.c b/offload/test/mapping/present/target_exit_data_delete.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_exit_data_delete.c
rename to offload/test/mapping/present/target_exit_data_delete.c
diff --git a/openmp/libomptarget/test/mapping/present/target_exit_data_release.c b/offload/test/mapping/present/target_exit_data_release.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_exit_data_release.c
rename to offload/test/mapping/present/target_exit_data_release.c
diff --git a/openmp/libomptarget/test/mapping/present/target_update.c b/offload/test/mapping/present/target_update.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_update.c
rename to offload/test/mapping/present/target_update.c
diff --git a/openmp/libomptarget/test/mapping/present/target_update_array_extension.c b/offload/test/mapping/present/target_update_array_extension.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/target_update_array_extension.c
rename to offload/test/mapping/present/target_update_array_extension.c
diff --git a/openmp/libomptarget/test/mapping/present/unified_shared_memory.c b/offload/test/mapping/present/unified_shared_memory.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/unified_shared_memory.c
rename to offload/test/mapping/present/unified_shared_memory.c
diff --git a/openmp/libomptarget/test/mapping/present/zero_length_array_section.c b/offload/test/mapping/present/zero_length_array_section.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/zero_length_array_section.c
rename to offload/test/mapping/present/zero_length_array_section.c
diff --git a/openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c b/offload/test/mapping/present/zero_length_array_section_exit.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/present/zero_length_array_section_exit.c
rename to offload/test/mapping/present/zero_length_array_section_exit.c
diff --git a/openmp/libomptarget/test/mapping/private_mapping.c b/offload/test/mapping/private_mapping.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/private_mapping.c
rename to offload/test/mapping/private_mapping.c
diff --git a/openmp/libomptarget/test/mapping/ptr_and_obj_motion.c b/offload/test/mapping/ptr_and_obj_motion.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/ptr_and_obj_motion.c
rename to offload/test/mapping/ptr_and_obj_motion.c
diff --git a/openmp/libomptarget/test/mapping/reduction_implicit_map.cpp b/offload/test/mapping/reduction_implicit_map.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/reduction_implicit_map.cpp
rename to offload/test/mapping/reduction_implicit_map.cpp
diff --git a/openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c b/offload/test/mapping/target_data_array_extension_at_exit.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_data_array_extension_at_exit.c
rename to offload/test/mapping/target_data_array_extension_at_exit.c
diff --git a/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp b/offload/test/mapping/target_derefence_array_pointrs.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
rename to offload/test/mapping/target_derefence_array_pointrs.cpp
diff --git a/openmp/libomptarget/test/mapping/target_has_device_addr.c b/offload/test/mapping/target_has_device_addr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_has_device_addr.c
rename to offload/test/mapping/target_has_device_addr.c
diff --git a/openmp/libomptarget/test/mapping/target_implicit_partial_map.c b/offload/test/mapping/target_implicit_partial_map.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_implicit_partial_map.c
rename to offload/test/mapping/target_implicit_partial_map.c
diff --git a/openmp/libomptarget/test/mapping/target_map_for_member_data.cpp b/offload/test/mapping/target_map_for_member_data.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_map_for_member_data.cpp
rename to offload/test/mapping/target_map_for_member_data.cpp
diff --git a/openmp/libomptarget/test/mapping/target_pointers_members_map.cpp b/offload/test/mapping/target_pointers_members_map.cpp
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_pointers_members_map.cpp
rename to offload/test/mapping/target_pointers_members_map.cpp
diff --git a/openmp/libomptarget/test/mapping/target_update_array_extension.c b/offload/test/mapping/target_update_array_extension.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_update_array_extension.c
rename to offload/test/mapping/target_update_array_extension.c
diff --git a/openmp/libomptarget/test/mapping/target_use_device_addr.c b/offload/test/mapping/target_use_device_addr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_use_device_addr.c
rename to offload/test/mapping/target_use_device_addr.c
diff --git a/openmp/libomptarget/test/mapping/target_uses_allocator.c b/offload/test/mapping/target_uses_allocator.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_uses_allocator.c
rename to offload/test/mapping/target_uses_allocator.c
diff --git a/openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c b/offload/test/mapping/target_wrong_use_device_addr.c
similarity index 100%
rename from openmp/libomptarget/test/mapping/target_wrong_use_device_addr.c
rename to offload/test/mapping/target_wrong_use_device_addr.c
diff --git a/openmp/libomptarget/test/offloading/assert.cpp b/offload/test/offloading/assert.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/assert.cpp
rename to offload/test/offloading/assert.cpp
diff --git a/openmp/libomptarget/test/offloading/atomic-compare-signedness.c b/offload/test/offloading/atomic-compare-signedness.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/atomic-compare-signedness.c
rename to offload/test/offloading/atomic-compare-signedness.c
diff --git a/openmp/libomptarget/test/offloading/back2back_distribute.c b/offload/test/offloading/back2back_distribute.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/back2back_distribute.c
rename to offload/test/offloading/back2back_distribute.c
diff --git a/openmp/libomptarget/test/offloading/barrier_fence.c b/offload/test/offloading/barrier_fence.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/barrier_fence.c
rename to offload/test/offloading/barrier_fence.c
diff --git a/openmp/libomptarget/test/offloading/bug47654.cpp b/offload/test/offloading/bug47654.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug47654.cpp
rename to offload/test/offloading/bug47654.cpp
diff --git a/openmp/libomptarget/test/offloading/bug49021.cpp b/offload/test/offloading/bug49021.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug49021.cpp
rename to offload/test/offloading/bug49021.cpp
diff --git a/openmp/libomptarget/test/offloading/bug49334.cpp b/offload/test/offloading/bug49334.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug49334.cpp
rename to offload/test/offloading/bug49334.cpp
diff --git a/openmp/libomptarget/test/offloading/bug49779.cpp b/offload/test/offloading/bug49779.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug49779.cpp
rename to offload/test/offloading/bug49779.cpp
diff --git a/openmp/libomptarget/test/offloading/bug50022.cpp b/offload/test/offloading/bug50022.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug50022.cpp
rename to offload/test/offloading/bug50022.cpp
diff --git a/openmp/libomptarget/test/offloading/bug51781.c b/offload/test/offloading/bug51781.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug51781.c
rename to offload/test/offloading/bug51781.c
diff --git a/openmp/libomptarget/test/offloading/bug51982.c b/offload/test/offloading/bug51982.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug51982.c
rename to offload/test/offloading/bug51982.c
diff --git a/openmp/libomptarget/test/offloading/bug53727.cpp b/offload/test/offloading/bug53727.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug53727.cpp
rename to offload/test/offloading/bug53727.cpp
diff --git a/openmp/libomptarget/test/offloading/bug64959.c b/offload/test/offloading/bug64959.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug64959.c
rename to offload/test/offloading/bug64959.c
diff --git a/openmp/libomptarget/test/offloading/bug64959_compile_only.c b/offload/test/offloading/bug64959_compile_only.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug64959_compile_only.c
rename to offload/test/offloading/bug64959_compile_only.c
diff --git a/openmp/libomptarget/test/offloading/bug74582.c b/offload/test/offloading/bug74582.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/bug74582.c
rename to offload/test/offloading/bug74582.c
diff --git a/openmp/libomptarget/test/offloading/complex_reduction.cpp b/offload/test/offloading/complex_reduction.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/complex_reduction.cpp
rename to offload/test/offloading/complex_reduction.cpp
diff --git a/openmp/libomptarget/test/offloading/ctor_dtor.cpp b/offload/test/offloading/ctor_dtor.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/ctor_dtor.cpp
rename to offload/test/offloading/ctor_dtor.cpp
diff --git a/openmp/libomptarget/test/offloading/cuda_no_devices.c b/offload/test/offloading/cuda_no_devices.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/cuda_no_devices.c
rename to offload/test/offloading/cuda_no_devices.c
diff --git a/openmp/libomptarget/test/offloading/d2d_memcpy.c b/offload/test/offloading/d2d_memcpy.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/d2d_memcpy.c
rename to offload/test/offloading/d2d_memcpy.c
diff --git a/openmp/libomptarget/test/offloading/d2d_memcpy_sync.c b/offload/test/offloading/d2d_memcpy_sync.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/d2d_memcpy_sync.c
rename to offload/test/offloading/d2d_memcpy_sync.c
diff --git a/openmp/libomptarget/test/offloading/default_thread_limit.c b/offload/test/offloading/default_thread_limit.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/default_thread_limit.c
rename to offload/test/offloading/default_thread_limit.c
diff --git a/openmp/libomptarget/test/offloading/dynamic_module.c b/offload/test/offloading/dynamic_module.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/dynamic_module.c
rename to offload/test/offloading/dynamic_module.c
diff --git a/openmp/libomptarget/test/offloading/dynamic_module_load.c b/offload/test/offloading/dynamic_module_load.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/dynamic_module_load.c
rename to offload/test/offloading/dynamic_module_load.c
diff --git a/openmp/libomptarget/test/offloading/extern.c b/offload/test/offloading/extern.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/extern.c
rename to offload/test/offloading/extern.c
diff --git a/openmp/libomptarget/test/offloading/force-usm.cpp b/offload/test/offloading/force-usm.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/force-usm.cpp
rename to offload/test/offloading/force-usm.cpp
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-parallel-do.f90 b/offload/test/offloading/fortran/basic-target-parallel-do.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic-target-parallel-do.f90
rename to offload/test/offloading/fortran/basic-target-parallel-do.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90 b/offload/test/offloading/fortran/basic-target-parallel-region.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic-target-parallel-region.f90
rename to offload/test/offloading/fortran/basic-target-parallel-region.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-region-1D-array-section.f90 b/offload/test/offloading/fortran/basic-target-region-1D-array-section.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic-target-region-1D-array-section.f90
rename to offload/test/offloading/fortran/basic-target-region-1D-array-section.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-region-3D-array-section.f90 b/offload/test/offloading/fortran/basic-target-region-3D-array-section.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic-target-region-3D-array-section.f90
rename to offload/test/offloading/fortran/basic-target-region-3D-array-section.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic-target-region-3D-array.f90 b/offload/test/offloading/fortran/basic-target-region-3D-array.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic-target-region-3D-array.f90
rename to offload/test/offloading/fortran/basic-target-region-3D-array.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/basic_array.c b/offload/test/offloading/fortran/basic_array.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic_array.c
rename to offload/test/offloading/fortran/basic_array.c
diff --git a/openmp/libomptarget/test/offloading/fortran/basic_target_region.f90 b/offload/test/offloading/fortran/basic_target_region.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/basic_target_region.f90
rename to offload/test/offloading/fortran/basic_target_region.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/constant-arr-index.f90 b/offload/test/offloading/fortran/constant-arr-index.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/constant-arr-index.f90
rename to offload/test/offloading/fortran/constant-arr-index.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/declare-target-vars-in-target-region.f90 b/offload/test/offloading/fortran/declare-target-vars-in-target-region.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/declare-target-vars-in-target-region.f90
rename to offload/test/offloading/fortran/declare-target-vars-in-target-region.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/double-target-call-with-declare-target.f90 b/offload/test/offloading/fortran/double-target-call-with-declare-target.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/double-target-call-with-declare-target.f90
rename to offload/test/offloading/fortran/double-target-call-with-declare-target.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-allocatable-array-section-1d-bounds.f90 b/offload/test/offloading/fortran/target-map-allocatable-array-section-1d-bounds.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-allocatable-array-section-1d-bounds.f90
rename to offload/test/offloading/fortran/target-map-allocatable-array-section-1d-bounds.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-allocatable-array-section-3d-bounds.f90 b/offload/test/offloading/fortran/target-map-allocatable-array-section-3d-bounds.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-allocatable-array-section-3d-bounds.f90
rename to offload/test/offloading/fortran/target-map-allocatable-array-section-3d-bounds.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-allocatable-map-scopes.f90 b/offload/test/offloading/fortran/target-map-allocatable-map-scopes.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-allocatable-map-scopes.f90
rename to offload/test/offloading/fortran/target-map-allocatable-map-scopes.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-allocatables.f90 b/offload/test/offloading/fortran/target-map-enter-exit-allocatables.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-allocatables.f90
rename to offload/test/offloading/fortran/target-map-enter-exit-allocatables.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array-2.f90 b/offload/test/offloading/fortran/target-map-enter-exit-array-2.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array-2.f90
rename to offload/test/offloading/fortran/target-map-enter-exit-array-2.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array-bounds.f90 b/offload/test/offloading/fortran/target-map-enter-exit-array-bounds.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array-bounds.f90
rename to offload/test/offloading/fortran/target-map-enter-exit-array-bounds.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array.f90 b/offload/test/offloading/fortran/target-map-enter-exit-array.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-array.f90
rename to offload/test/offloading/fortran/target-map-enter-exit-array.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-scalar.f90 b/offload/test/offloading/fortran/target-map-enter-exit-scalar.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-enter-exit-scalar.f90
rename to offload/test/offloading/fortran/target-map-enter-exit-scalar.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-pointer-scopes-enter-exit.f90 b/offload/test/offloading/fortran/target-map-pointer-scopes-enter-exit.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-pointer-scopes-enter-exit.f90
rename to offload/test/offloading/fortran/target-map-pointer-scopes-enter-exit.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-pointer-target-array-section-3d-bounds.f90 b/offload/test/offloading/fortran/target-map-pointer-target-array-section-3d-bounds.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-pointer-target-array-section-3d-bounds.f90
rename to offload/test/offloading/fortran/target-map-pointer-target-array-section-3d-bounds.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-map-pointer-target-scopes.f90 b/offload/test/offloading/fortran/target-map-pointer-target-scopes.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-map-pointer-target-scopes.f90
rename to offload/test/offloading/fortran/target-map-pointer-target-scopes.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-nested-target-data.f90 b/offload/test/offloading/fortran/target-nested-target-data.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-nested-target-data.f90
rename to offload/test/offloading/fortran/target-nested-target-data.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-parallel-do-collapse.f90 b/offload/test/offloading/fortran/target-parallel-do-collapse.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-parallel-do-collapse.f90
rename to offload/test/offloading/fortran/target-parallel-do-collapse.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target-region-implicit-array.f90 b/offload/test/offloading/fortran/target-region-implicit-array.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target-region-implicit-array.f90
rename to offload/test/offloading/fortran/target-region-implicit-array.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target_map_common_block.f90 b/offload/test/offloading/fortran/target_map_common_block.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target_map_common_block.f90
rename to offload/test/offloading/fortran/target_map_common_block.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target_map_common_block1.f90 b/offload/test/offloading/fortran/target_map_common_block1.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target_map_common_block1.f90
rename to offload/test/offloading/fortran/target_map_common_block1.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target_map_common_block2.f90 b/offload/test/offloading/fortran/target_map_common_block2.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target_map_common_block2.f90
rename to offload/test/offloading/fortran/target_map_common_block2.f90
diff --git a/openmp/libomptarget/test/offloading/fortran/target_update.f90 b/offload/test/offloading/fortran/target_update.f90
similarity index 100%
rename from openmp/libomptarget/test/offloading/fortran/target_update.f90
rename to offload/test/offloading/fortran/target_update.f90
diff --git a/openmp/libomptarget/test/offloading/generic_multiple_parallel_regions.c b/offload/test/offloading/generic_multiple_parallel_regions.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/generic_multiple_parallel_regions.c
rename to offload/test/offloading/generic_multiple_parallel_regions.c
diff --git a/openmp/libomptarget/test/offloading/global_constructor.cpp b/offload/test/offloading/global_constructor.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/global_constructor.cpp
rename to offload/test/offloading/global_constructor.cpp
diff --git a/openmp/libomptarget/test/offloading/host_as_target.c b/offload/test/offloading/host_as_target.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/host_as_target.c
rename to offload/test/offloading/host_as_target.c
diff --git a/openmp/libomptarget/test/offloading/indirect_fp_mapping.c b/offload/test/offloading/indirect_fp_mapping.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/indirect_fp_mapping.c
rename to offload/test/offloading/indirect_fp_mapping.c
diff --git a/openmp/libomptarget/test/offloading/info.c b/offload/test/offloading/info.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/info.c
rename to offload/test/offloading/info.c
diff --git a/openmp/libomptarget/test/offloading/interop.c b/offload/test/offloading/interop.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/interop.c
rename to offload/test/offloading/interop.c
diff --git a/openmp/libomptarget/test/offloading/lone_target_exit_data.c b/offload/test/offloading/lone_target_exit_data.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/lone_target_exit_data.c
rename to offload/test/offloading/lone_target_exit_data.c
diff --git a/openmp/libomptarget/test/offloading/looptripcnt.c b/offload/test/offloading/looptripcnt.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/looptripcnt.c
rename to offload/test/offloading/looptripcnt.c
diff --git a/openmp/libomptarget/test/offloading/malloc.c b/offload/test/offloading/malloc.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/malloc.c
rename to offload/test/offloading/malloc.c
diff --git a/openmp/libomptarget/test/offloading/malloc_parallel.c b/offload/test/offloading/malloc_parallel.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/malloc_parallel.c
rename to offload/test/offloading/malloc_parallel.c
diff --git a/openmp/libomptarget/test/offloading/mandatory_but_no_devices.c b/offload/test/offloading/mandatory_but_no_devices.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/mandatory_but_no_devices.c
rename to offload/test/offloading/mandatory_but_no_devices.c
diff --git a/openmp/libomptarget/test/offloading/memory_manager.cpp b/offload/test/offloading/memory_manager.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/memory_manager.cpp
rename to offload/test/offloading/memory_manager.cpp
diff --git a/openmp/libomptarget/test/offloading/multiple_reductions_simple.c b/offload/test/offloading/multiple_reductions_simple.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/multiple_reductions_simple.c
rename to offload/test/offloading/multiple_reductions_simple.c
diff --git a/openmp/libomptarget/test/offloading/non_contiguous_update.cpp b/offload/test/offloading/non_contiguous_update.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/non_contiguous_update.cpp
rename to offload/test/offloading/non_contiguous_update.cpp
diff --git a/openmp/libomptarget/test/offloading/offloading_success.c b/offload/test/offloading/offloading_success.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/offloading_success.c
rename to offload/test/offloading/offloading_success.c
diff --git a/openmp/libomptarget/test/offloading/offloading_success.cpp b/offload/test/offloading/offloading_success.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/offloading_success.cpp
rename to offload/test/offloading/offloading_success.cpp
diff --git a/openmp/libomptarget/test/offloading/ompx_bare.c b/offload/test/offloading/ompx_bare.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/ompx_bare.c
rename to offload/test/offloading/ompx_bare.c
diff --git a/openmp/libomptarget/test/offloading/ompx_coords.c b/offload/test/offloading/ompx_coords.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/ompx_coords.c
rename to offload/test/offloading/ompx_coords.c
diff --git a/openmp/libomptarget/test/offloading/ompx_saxpy_mixed.c b/offload/test/offloading/ompx_saxpy_mixed.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/ompx_saxpy_mixed.c
rename to offload/test/offloading/ompx_saxpy_mixed.c
diff --git a/openmp/libomptarget/test/offloading/parallel_offloading_map.cpp b/offload/test/offloading/parallel_offloading_map.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/parallel_offloading_map.cpp
rename to offload/test/offloading/parallel_offloading_map.cpp
diff --git a/openmp/libomptarget/test/offloading/parallel_target_teams_reduction.cpp b/offload/test/offloading/parallel_target_teams_reduction.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/parallel_target_teams_reduction.cpp
rename to offload/test/offloading/parallel_target_teams_reduction.cpp
diff --git a/openmp/libomptarget/test/offloading/parallel_target_teams_reduction_max.cpp b/offload/test/offloading/parallel_target_teams_reduction_max.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/parallel_target_teams_reduction_max.cpp
rename to offload/test/offloading/parallel_target_teams_reduction_max.cpp
diff --git a/openmp/libomptarget/test/offloading/parallel_target_teams_reduction_min.cpp b/offload/test/offloading/parallel_target_teams_reduction_min.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/parallel_target_teams_reduction_min.cpp
rename to offload/test/offloading/parallel_target_teams_reduction_min.cpp
diff --git a/openmp/libomptarget/test/offloading/requires.c b/offload/test/offloading/requires.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/requires.c
rename to offload/test/offloading/requires.c
diff --git a/openmp/libomptarget/test/offloading/runtime_init.c b/offload/test/offloading/runtime_init.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/runtime_init.c
rename to offload/test/offloading/runtime_init.c
diff --git a/openmp/libomptarget/test/offloading/shared_lib_fp_mapping.c b/offload/test/offloading/shared_lib_fp_mapping.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/shared_lib_fp_mapping.c
rename to offload/test/offloading/shared_lib_fp_mapping.c
diff --git a/openmp/libomptarget/test/offloading/small_trip_count.c b/offload/test/offloading/small_trip_count.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/small_trip_count.c
rename to offload/test/offloading/small_trip_count.c
diff --git a/openmp/libomptarget/test/offloading/small_trip_count_thread_limit.cpp b/offload/test/offloading/small_trip_count_thread_limit.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/small_trip_count_thread_limit.cpp
rename to offload/test/offloading/small_trip_count_thread_limit.cpp
diff --git a/openmp/libomptarget/test/offloading/spmdization.c b/offload/test/offloading/spmdization.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/spmdization.c
rename to offload/test/offloading/spmdization.c
diff --git a/openmp/libomptarget/test/offloading/static_linking.c b/offload/test/offloading/static_linking.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/static_linking.c
rename to offload/test/offloading/static_linking.c
diff --git a/openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp b/offload/test/offloading/std_complex_arithmetic.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/std_complex_arithmetic.cpp
rename to offload/test/offloading/std_complex_arithmetic.cpp
diff --git a/openmp/libomptarget/test/offloading/struct_mapping_with_pointers.cpp b/offload/test/offloading/struct_mapping_with_pointers.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/struct_mapping_with_pointers.cpp
rename to offload/test/offloading/struct_mapping_with_pointers.cpp
diff --git a/openmp/libomptarget/test/offloading/target-teams-atomic.c b/offload/test/offloading/target-teams-atomic.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/target-teams-atomic.c
rename to offload/test/offloading/target-teams-atomic.c
diff --git a/openmp/libomptarget/test/offloading/target-tile.c b/offload/test/offloading/target-tile.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/target-tile.c
rename to offload/test/offloading/target-tile.c
diff --git a/openmp/libomptarget/test/offloading/target_constexpr_mapping.cpp b/offload/test/offloading/target_constexpr_mapping.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/target_constexpr_mapping.cpp
rename to offload/test/offloading/target_constexpr_mapping.cpp
diff --git a/openmp/libomptarget/test/offloading/target_critical_region.cpp b/offload/test/offloading/target_critical_region.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/target_critical_region.cpp
rename to offload/test/offloading/target_critical_region.cpp
diff --git a/openmp/libomptarget/test/offloading/target_depend_nowait.cpp b/offload/test/offloading/target_depend_nowait.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/target_depend_nowait.cpp
rename to offload/test/offloading/target_depend_nowait.cpp
diff --git a/openmp/libomptarget/test/offloading/target_map_for_member_data.cpp b/offload/test/offloading/target_map_for_member_data.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/target_map_for_member_data.cpp
rename to offload/test/offloading/target_map_for_member_data.cpp
diff --git a/openmp/libomptarget/test/offloading/target_nowait_target.cpp b/offload/test/offloading/target_nowait_target.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/target_nowait_target.cpp
rename to offload/test/offloading/target_nowait_target.cpp
diff --git a/openmp/libomptarget/test/offloading/task_in_reduction_target.c b/offload/test/offloading/task_in_reduction_target.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/task_in_reduction_target.c
rename to offload/test/offloading/task_in_reduction_target.c
diff --git a/openmp/libomptarget/test/offloading/taskloop_offload_nowait.cpp b/offload/test/offloading/taskloop_offload_nowait.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/taskloop_offload_nowait.cpp
rename to offload/test/offloading/taskloop_offload_nowait.cpp
diff --git a/openmp/libomptarget/test/offloading/test_libc.cpp b/offload/test/offloading/test_libc.cpp
similarity index 100%
rename from openmp/libomptarget/test/offloading/test_libc.cpp
rename to offload/test/offloading/test_libc.cpp
diff --git a/openmp/libomptarget/test/offloading/thread_limit.c b/offload/test/offloading/thread_limit.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/thread_limit.c
rename to offload/test/offloading/thread_limit.c
diff --git a/openmp/libomptarget/test/offloading/thread_state_1.c b/offload/test/offloading/thread_state_1.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/thread_state_1.c
rename to offload/test/offloading/thread_state_1.c
diff --git a/openmp/libomptarget/test/offloading/thread_state_2.c b/offload/test/offloading/thread_state_2.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/thread_state_2.c
rename to offload/test/offloading/thread_state_2.c
diff --git a/openmp/libomptarget/test/offloading/weak.c b/offload/test/offloading/weak.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/weak.c
rename to offload/test/offloading/weak.c
diff --git a/openmp/libomptarget/test/offloading/workshare_chunk.c b/offload/test/offloading/workshare_chunk.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/workshare_chunk.c
rename to offload/test/offloading/workshare_chunk.c
diff --git a/openmp/libomptarget/test/offloading/wtime.c b/offload/test/offloading/wtime.c
similarity index 100%
rename from openmp/libomptarget/test/offloading/wtime.c
rename to offload/test/offloading/wtime.c
diff --git a/openmp/libomptarget/test/ompt/callbacks.h b/offload/test/ompt/callbacks.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/callbacks.h
rename to offload/test/ompt/callbacks.h
diff --git a/openmp/libomptarget/test/ompt/register_both.h b/offload/test/ompt/register_both.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_both.h
rename to offload/test/ompt/register_both.h
diff --git a/openmp/libomptarget/test/ompt/register_emi.h b/offload/test/ompt/register_emi.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_emi.h
rename to offload/test/ompt/register_emi.h
diff --git a/openmp/libomptarget/test/ompt/register_emi_map.h b/offload/test/ompt/register_emi_map.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_emi_map.h
rename to offload/test/ompt/register_emi_map.h
diff --git a/openmp/libomptarget/test/ompt/register_no_device_init.h b/offload/test/ompt/register_no_device_init.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_no_device_init.h
rename to offload/test/ompt/register_no_device_init.h
diff --git a/openmp/libomptarget/test/ompt/register_non_emi.h b/offload/test/ompt/register_non_emi.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_non_emi.h
rename to offload/test/ompt/register_non_emi.h
diff --git a/openmp/libomptarget/test/ompt/register_non_emi_map.h b/offload/test/ompt/register_non_emi_map.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_non_emi_map.h
rename to offload/test/ompt/register_non_emi_map.h
diff --git a/openmp/libomptarget/test/ompt/register_wrong_return.h b/offload/test/ompt/register_wrong_return.h
similarity index 100%
rename from openmp/libomptarget/test/ompt/register_wrong_return.h
rename to offload/test/ompt/register_wrong_return.h
diff --git a/openmp/libomptarget/test/ompt/target_memcpy.c b/offload/test/ompt/target_memcpy.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/target_memcpy.c
rename to offload/test/ompt/target_memcpy.c
diff --git a/openmp/libomptarget/test/ompt/target_memcpy_emi.c b/offload/test/ompt/target_memcpy_emi.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/target_memcpy_emi.c
rename to offload/test/ompt/target_memcpy_emi.c
diff --git a/openmp/libomptarget/test/ompt/veccopy.c b/offload/test/ompt/veccopy.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy.c
rename to offload/test/ompt/veccopy.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_data.c b/offload/test/ompt/veccopy_data.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_data.c
rename to offload/test/ompt/veccopy_data.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_disallow_both.c b/offload/test/ompt/veccopy_disallow_both.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_disallow_both.c
rename to offload/test/ompt/veccopy_disallow_both.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_emi.c b/offload/test/ompt/veccopy_emi.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_emi.c
rename to offload/test/ompt/veccopy_emi.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_emi_map.c b/offload/test/ompt/veccopy_emi_map.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_emi_map.c
rename to offload/test/ompt/veccopy_emi_map.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_map.c b/offload/test/ompt/veccopy_map.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_map.c
rename to offload/test/ompt/veccopy_map.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_no_device_init.c b/offload/test/ompt/veccopy_no_device_init.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_no_device_init.c
rename to offload/test/ompt/veccopy_no_device_init.c
diff --git a/openmp/libomptarget/test/ompt/veccopy_wrong_return.c b/offload/test/ompt/veccopy_wrong_return.c
similarity index 100%
rename from openmp/libomptarget/test/ompt/veccopy_wrong_return.c
rename to offload/test/ompt/veccopy_wrong_return.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/api.c b/offload/test/unified_shared_memory/api.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/api.c
rename to offload/test/unified_shared_memory/api.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/associate_ptr.c b/offload/test/unified_shared_memory/associate_ptr.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/associate_ptr.c
rename to offload/test/unified_shared_memory/associate_ptr.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c b/offload/test/unified_shared_memory/close_enter_exit.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/close_enter_exit.c
rename to offload/test/unified_shared_memory/close_enter_exit.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_manual.c b/offload/test/unified_shared_memory/close_manual.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/close_manual.c
rename to offload/test/unified_shared_memory/close_manual.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_member.c b/offload/test/unified_shared_memory/close_member.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/close_member.c
rename to offload/test/unified_shared_memory/close_member.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/close_modifier.c b/offload/test/unified_shared_memory/close_modifier.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/close_modifier.c
rename to offload/test/unified_shared_memory/close_modifier.c
diff --git a/openmp/libomptarget/test/unified_shared_memory/shared_update.c b/offload/test/unified_shared_memory/shared_update.c
similarity index 100%
rename from openmp/libomptarget/test/unified_shared_memory/shared_update.c
rename to offload/test/unified_shared_memory/shared_update.c
diff --git a/openmp/libomptarget/tools/CMakeLists.txt b/offload/tools/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/tools/CMakeLists.txt
rename to offload/tools/CMakeLists.txt
diff --git a/openmp/libomptarget/tools/deviceinfo/CMakeLists.txt b/offload/tools/deviceinfo/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/tools/deviceinfo/CMakeLists.txt
rename to offload/tools/deviceinfo/CMakeLists.txt
diff --git a/openmp/libomptarget/tools/deviceinfo/llvm-omp-device-info.cpp b/offload/tools/deviceinfo/llvm-omp-device-info.cpp
similarity index 100%
rename from openmp/libomptarget/tools/deviceinfo/llvm-omp-device-info.cpp
rename to offload/tools/deviceinfo/llvm-omp-device-info.cpp
diff --git a/openmp/libomptarget/tools/kernelreplay/CMakeLists.txt b/offload/tools/kernelreplay/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/tools/kernelreplay/CMakeLists.txt
rename to offload/tools/kernelreplay/CMakeLists.txt
diff --git a/openmp/libomptarget/tools/kernelreplay/llvm-omp-kernel-replay.cpp b/offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
similarity index 100%
rename from openmp/libomptarget/tools/kernelreplay/llvm-omp-kernel-replay.cpp
rename to offload/tools/kernelreplay/llvm-omp-kernel-replay.cpp
diff --git a/openmp/libomptarget/unittests/CMakeLists.txt b/offload/unittests/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/unittests/CMakeLists.txt
rename to offload/unittests/CMakeLists.txt
diff --git a/openmp/libomptarget/unittests/Plugins/CMakeLists.txt b/offload/unittests/Plugins/CMakeLists.txt
similarity index 100%
rename from openmp/libomptarget/unittests/Plugins/CMakeLists.txt
rename to offload/unittests/Plugins/CMakeLists.txt
diff --git a/openmp/libomptarget/unittests/Plugins/NextgenPluginsTest.cpp b/offload/unittests/Plugins/NextgenPluginsTest.cpp
similarity index 100%
rename from openmp/libomptarget/unittests/Plugins/NextgenPluginsTest.cpp
rename to offload/unittests/Plugins/NextgenPluginsTest.cpp
diff --git a/openmp/libomptarget/utils/generate_microtask_cases.py b/offload/utils/generate_microtask_cases.py
similarity index 100%
rename from openmp/libomptarget/utils/generate_microtask_cases.py
rename to offload/utils/generate_microtask_cases.py
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 3c4ff76ad6d161..9097ca5623000c 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -123,19 +123,6 @@ endif()
 # to enable time profiling support in the OpenMP runtime.
 add_subdirectory(runtime)
 
-if (OPENMP_ENABLE_LIBOMPTARGET)
-  # Check that the library can actually be built.
-  if (APPLE OR WIN32)
-    message(FATAL_ERROR "libomptarget cannot be built on Windows and MacOS X!")
-  elseif (NOT "cxx_std_17" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
-    message(FATAL_ERROR "Host compiler must support C++17 to build libomptarget!")
-  elseif (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
-    message(FATAL_ERROR "libomptarget on 32-bit systems are not supported!")
-  endif()
-
-  add_subdirectory(libomptarget)
-endif()
-
 set(ENABLE_OMPT_TOOLS ON)
 # Currently tools are not tested well on Windows or MacOS X.
 if (APPLE OR WIN32)
@@ -148,6 +135,10 @@ if (OPENMP_ENABLE_OMPT_TOOLS)
   add_subdirectory(tools)
 endif()
 
+# Propagate OMPT support to offload
+set(LIBOMP_HAVE_OMPT_SUPPORT ${LIBOMP_HAVE_OMPT_SUPPORT} PARENT_SCOPE)
+set(LIBOMP_OMP_TOOLS_INCLUDE_DIR ${LIBOMP_OMP_TOOLS_INCLUDE_DIR} PARENT_SCOPE)
+
 option(OPENMP_MSVC_NAME_SCHEME "Build dll with MSVC naming scheme." OFF)
 
 # Build libompd.so
diff --git a/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp b/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
deleted file mode 100644
index c170c2d7387338..00000000000000
--- a/openmp/libomptarget/test/api/ompx_dump_mapping_tables.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// RUN: %libomptarget-compilexx-run-and-check-generic
-
-#include <cstdio>
-#include <omp.h>
-
-#define N 10
-
-int main() {
-  int *a = new __int32_t[N];     // mapped and released from device 0
-  int *b = new __int32_t[2 * N]; // mapped to device 0
-
-  // clang-format off
-  // CHECK: Mapping tables after target enter data:
-  // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
-  // CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
-  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
-  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} {{[48]}}0
-#pragma omp target enter data device(0) map(to : a[ : N])
-#pragma omp target enter data device(0) map(to : b[ : 2*N])
-  // clang-format on
-  printf("Mapping tables after target enter data:\n");
-  ompx_dump_mapping_tables();
-
-  // clang-format off
-  // CHECK: Mapping tables after target exit data for a:
-  // CHECK-NEXT: omptarget device 0 info: OpenMP Host-Device pointer mappings after block
-  // CHECK-NEXT: omptarget device 0 info: Host Ptr Target Ptr Size (B) DynRefCount HoldRefCount Declaration
-  // CHECK-NEXT: omptarget device 0 info: {{(0x[0-9a-f]{16})}} {{(0x[0-9a-f]{16})}} 80
-#pragma omp target exit data device(0) map(release : a[ : N])
-  // clang-format on
-  printf("\nMapping tables after target exit data for a:\n");
-  ompx_dump_mapping_tables();
-
-  return 0;
-}
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index 701c35150f3048..a2468d04e60af1 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -229,6 +229,7 @@ if(NOT LIBOMP_LIBRARY_DIR)
 else()
   set(LIBOMP_LIBRARY_DIR ${LIBOMP_LIBRARY_DIR} PARENT_SCOPE)
 endif()
+set(LIBOMP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBOMP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
 
 # Add symbolic links to libomp
@@ -241,7 +242,12 @@ if(NOT WIN32)
     WORKING_DIRECTORY ${LIBOMP_LIBRARY_DIR}
   )
 endif()
-set(LIBOMP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
+
+# Definitions for testing, for reuse when testing libomptarget-nvptx.
+set(LIBOMPTARGET_OPENMP_HEADER_FOLDER "${LIBOMP_INCLUDE_DIR}" CACHE STRING
+  "Path to folder containing omp.h")
+set(LIBOMPTARGET_OPENMP_HOST_RTL_FOLDER "${LIBOMP_LIBRARY_DIR}" CACHE STRING
+  "Path to folder containing libomp.so, and libLLVMSupport.so with profiling enabled")
 
 # Create *.inc before compiling any sources
 # objects depend on : .inc files
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 6f24fbcccec955..fcc59c8fa1c379 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -21,7 +21,7 @@ list(INSERT CMAKE_MODULE_PATH 0
 
 # We order libraries to mirror roughly how they are layered, except that compiler-rt can depend
 # on libc++, so we put it after.
-set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp")
+set(LLVM_DEFAULT_RUNTIMES "libc;libunwind;libcxxabi;pstl;libcxx;compiler-rt;openmp;offload")
 set(LLVM_SUPPORTED_RUNTIMES "${LLVM_DEFAULT_RUNTIMES};llvm-libgcc")
 set(LLVM_ENABLE_RUNTIMES "" CACHE STRING
   "Semicolon-separated list of runtimes to build, or \"all\" (${LLVM_DEFAULT_RUNTIMES}). Supported runtimes are ${LLVM_SUPPORTED_RUNTIMES}.")

>From c6a443db06e19ee114f74d847f52b1411df95833 Mon Sep 17 00:00:00 2001
From: Saiyedul Islam <Saiyedul.Islam at amd.com>
Date: Wed, 17 Apr 2024 03:09:01 -0500
Subject: [PATCH 2/2] [Offload] Support standalone build for OpenMP and Offload

The standalone offload build will just search for
the ompt header and if found then OMPT support will
be enabled. This caused the LIBOMP_HAVE_VERSION_SCRIPT_FLAG
detection and pythonize_bool to move into offload/CMakeLists.txt.

If the cmake compiler is clang, get the resource directory for
installation of openmp headers. find_package(LLVM) is already
called in LibomptargetGetDependencies.

Depends on #75125
---
 offload/CMakeLists.txt                      | 66 ++++++++++++++++++++-
 offload/plugins-nextgen/host/CMakeLists.txt |  2 +-
 offload/src/CMakeLists.txt                  |  8 ++-
 openmp/CMakeLists.txt                       | 12 +++-
 4 files changed, 83 insertions(+), 5 deletions(-)

diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index c90d2698aa0efd..b23ffdcbd5aa87 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -10,6 +10,13 @@
 #
 ##===----------------------------------------------------------------------===##
 
+cmake_minimum_required(VERSION 3.20.0)
+
+if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+  set(OPENMP_STANDALONE_BUILD TRUE)
+  project(offload C CXX ASM)
+endif()
+
 set(ENABLE_LIBOMPTARGET ON)
 # Currently libomptarget cannot be compiled on Windows or MacOS X.
 # Since the device plugins are only supported on Linux anyway,
@@ -35,11 +42,12 @@ endif()
 # TODO: Leftover from the move, could probably be just LLVM_LIBDIR_SUFFIX everywhere.
 set(OFFLOAD_INSTALL_LIBDIR "lib${LLVM_LIBDIR_SUFFIX}")
 
-set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
 
 # Add path for custom modules
 list(INSERT CMAKE_MODULE_PATH 0
   "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules"
   "${LLVM_COMMON_CMAKE_UTILS}/Modules"
   )
 
@@ -190,6 +198,58 @@ if (LIBOMPTARGET_USE_LTO)
   list(APPEND offload_link_flags ${CMAKE_CXX_COMPILE_OPTIONS_IPO})
 endif()
 
+if(OPENMP_STANDALONE_BUILD)
+  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    execute_process(
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      COMMAND ${CMAKE_CXX_COMPILER} --print-resource-dir
+      RESULT_VARIABLE COMMAND_RETURN_CODE
+      OUTPUT_VARIABLE COMPILER_RESOURCE_DIR
+    )
+  endif()
+
+  set(LIBOMP_HAVE_OMPT_SUPPORT FALSE)
+  set(LIBOMP_OMPT_SUPPORT FALSE)
+
+  find_path (
+    LIBOMP_OMP_TOOLS_INCLUDE_DIR
+    NAMES
+      omp-tools.h
+    HINTS
+    ${COMPILER_RESOURCE_DIR}/include
+    ${CMAKE_INSTALL_PREFIX}/include
+  )
+
+  if(LIBOMP_OMP_TOOLS_INCLUDE_DIR)
+    set(LIBOMP_HAVE_OMPT_SUPPORT TRUE)
+    set(LIBOMP_OMPT_SUPPORT TRUE)
+  endif()
+
+  # LLVM_LIBRARY_DIRS set by find_package(LLVM) in LibomptargetGetDependencies
+  find_library (
+    LIBOMP_STANDALONE
+    NAMES
+      omp
+    HINTS
+      ${CMAKE_INSTALL_PREFIX}/lib
+      ${LLVM_LIBRARY_DIRS}
+    REQUIRED
+  )
+# Check LIBOMP_HAVE_VERSION_SCRIPT_FLAG
+  include(LLVMCheckCompilerLinkerFlag)
+  if(NOT APPLE)
+    llvm_check_compiler_linker_flag(C "-Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/../openmp/runtime/src/exports_test_so.txt" LIBOMP_HAVE_VERSION_SCRIPT_FLAG)
+  endif()
+
+  macro(pythonize_bool var)
+  if (${var})
+    set(${var} True)
+  else()
+    set(${var} False)
+  endif()
+  endmacro()
+endif()
+
 # OMPT support for libomptarget
 # Follow host OMPT support and check if host support has been requested.
 # LIBOMP_HAVE_OMPT_SUPPORT indicates whether host OMPT support has been implemented.
@@ -216,7 +276,9 @@ pythonize_bool(LIBOMPTARGET_GPU_LIBC_SUPPORT)
 
 set(LIBOMPTARGET_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
 message(STATUS "OpenMP tools dir in libomptarget: ${LIBOMP_OMP_TOOLS_INCLUDE_DIR}")
-include_directories(${LIBOMP_OMP_TOOLS_INCLUDE_DIR})
+if(LIBOMP_OMP_TOOLS_INCLUDE_DIR)
+  include_directories(${LIBOMP_OMP_TOOLS_INCLUDE_DIR})
+endif()
 
 set(LIBOMPTARGET_LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE STRING
   "Path to folder containing llvm library libomptarget.so")
diff --git a/offload/plugins-nextgen/host/CMakeLists.txt b/offload/plugins-nextgen/host/CMakeLists.txt
index c1493d293d30e5..7da18ee278d498 100644
--- a/offload/plugins-nextgen/host/CMakeLists.txt
+++ b/offload/plugins-nextgen/host/CMakeLists.txt
@@ -33,7 +33,7 @@ endif()
 
 # Install plugin under the lib destination folder.
 install(TARGETS omptarget.rtl.${machine}
-        LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}")
+        LIBRARY DESTINATION "${OFFLOAD_INSTALL_LIBDIR}")
 set_target_properties(omptarget.rtl.${machine} PROPERTIES
   INSTALL_RPATH "$ORIGIN" BUILD_RPATH "$ORIGIN:${CMAKE_CURRENT_BINARY_DIR}/.."
   POSITION_INDEPENDENT_CODE ON
diff --git a/offload/src/CMakeLists.txt b/offload/src/CMakeLists.txt
index b0a740d477ca63..fb1ad3d7ae7098 100644
--- a/offload/src/CMakeLists.txt
+++ b/offload/src/CMakeLists.txt
@@ -12,6 +12,12 @@
 
 libomptarget_say("Building offloading runtime library libomptarget.")
 
+if(LIBOMP_STANDALONE)
+  set(LIBOMP ${LIBOMP_STANDALONE})
+else()
+  set(LIBOMP omp)
+endif()
+
 add_llvm_library(omptarget
   SHARED
 
@@ -38,7 +44,7 @@ add_llvm_library(omptarget
 
   LINK_LIBS
   PUBLIC
-  omp
+  ${LIBOMP}
 
   NO_INSTALL_RPATH
   BUILDTREE_ONLY
diff --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index 9097ca5623000c..95f2425db3ee6b 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -113,7 +113,17 @@ option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
 
 # Header install location
 if(${OPENMP_STANDALONE_BUILD})
-  set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
+  if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+    execute_process(
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      COMMAND ${CMAKE_CXX_COMPILER} --print-resource-dir
+      RESULT_VARIABLE COMMAND_RETURN_CODE
+      OUTPUT_VARIABLE COMPILER_RESOURCE_DIR
+    )
+    set(LIBOMP_HEADERS_INSTALL_PATH "${COMPILER_RESOURCE_DIR}/include")
+  else()
+    set(LIBOMP_HEADERS_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}")
+  endif()
 else()
   include(GetClangResourceDir)
   get_clang_resource_dir(LIBOMP_HEADERS_INSTALL_PATH SUBDIR include)



More information about the Openmp-commits mailing list