The main contribution of this patch is the new CMakeLists.txt which
shows how we can compile the device runtime as C++ for various targets
and subtargets. Running ninja omptarget-device-rtl results in
libomptarget-device-rtl-nvptx64-sm35-ptx50.bc libomptarget-device-rtl-nvptx64-sm35-ptx60.bc libomptarget-device-rtl-nvptx64-sm35-ptx61.bc libomptarget-device-rtl-nvptx64-sm35-ptx62.bc libomptarget-device-rtl-nvptx64-sm35-ptx63.bc libomptarget-device-rtl-nvptx64-sm35-ptx64.bc libomptarget-device-rtl-nvptx64-sm35-ptx65.bc libomptarget-device-rtl-nvptx64-sm35-ptx70.bc libomptarget-device-rtl-nvptx64-sm35-ptx71.bc libomptarget-device-rtl-nvptx-sm35-ptx50.bc libomptarget-device-rtl-nvptx-sm35-ptx60.bc libomptarget-device-rtl-nvptx-sm35-ptx61.bc libomptarget-device-rtl-nvptx-sm35-ptx62.bc libomptarget-device-rtl-nvptx-sm35-ptx63.bc libomptarget-device-rtl-nvptx-sm35-ptx64.bc libomptarget-device-rtl-nvptx-sm35-ptx65.bc libomptarget-device-rtl-nvptx-sm35-ptx70.bc libomptarget-device-rtl-nvptx-sm35-ptx71.bc libomptarget-device-rtl-x86_64-unknown-linux-gnu.bc
As part of this we should remove most of the source annotations, e.g.
INLINE, and EXTERN, as long as they are not strictly needed. SHARED
will be replaced by the macro used in D93135 or D77472.
For lanemask and similar target dependent functions we should have a
begin/end declare variant file:
// I'm gussing here: using kmpc_lanemask = uint64_t; void some_target_specific_function_decl(...); void __kmpc_some_target_specific_function_impl(...) { some_target_specific_function_decl(...); }
All of this seems totally broken. As far as I can tell, OMPTARGET_NVPTX_TEST and some other macros are always set and later we check if they are set. It's odd.