The following issue came up / was mentioned elsewhere: It can be useful do disable host fallback and generate only device/nonhost versions for (OpenMP) target / (OpenACC) compute regions. Some other closed-source compilers have this feature and Clang recently got that feature. Some users seem to interested in this to avoid creating separate functions – and then using 'omp declare variant' / OpenACC's 'bind' clause for them. Additionally, some might prefer it to effectively force mandatory on-device calculation and to save some bytes from the generated binary. However, I note that the (main) reason that Clang got it was a different one according to the reasoning given in the commit: https://github.com/llvm/llvm-project/commit/47d66255701a5cfeab6c05e3642a2cccf7a4c09f Date: Thu Apr 21 20:13:33 2022 -0400 [OpenMP] Add options to only compile the host or device when offloading OpenMP recently moved to the new offloading driver, this had the effect of making it more difficult to inspect intermediate code for the device. This patch adds `-foffload-host-only` and `-foffload-device-only` to control which sides get compiled. This will allow users to more easily inspect output without needing the temp files. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D124220 It uses: def offload_device_only : Flag<["--"], "offload-device-only">, HelpText<"Only compile for the offloading device.">; def offload_host_only : Flag<["--"], "offload-host-only">, HelpText<"Only compile for the offloading host.">; def offload_host_device : Flag<["--"], "offload-host-device">, HelpText<"Only compile for the offloading host.">;
I think that first of all controlling this per OMP/OACC region would be more useful (as for the "mandatory on-device" case). Shouldn't there be sth in the respective specs for this?