[Openmp-commits] [PATCH] D64626: [libomptarget] Handle offload policy in push_target_tripcount

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 22 13:20:25 PDT 2019

jdoerfert added a comment.

In D64626#1596246 <https://reviews.llvm.org/D64626#1596246>, @Hahnfeld wrote:

> In D64626#1596237 <https://reviews.llvm.org/D64626#1596237>, @jdoerfert wrote:
> > I do not understand what caused the error you linked. Which part of the push_tripcount call is problematic? I would have expected get_default_device to return the host id when offload is disabled and the code to not choke one the host device.
> According to the spec `omp_get_default_device` returns //default-device-var// and I couldn't find a paragraph that implies special handling when offloading is disabled.
> Consequently, `omp_get_default_device` always returns a "real" device and if `CheckDeviceAndCtors` fails (in the linked case, it was because the user didn't compile for the right architecture), the call to `HandleTargetOutcome(false)` will result in the error message as seen in the linked post.

So why not change `omp_get_default_device` to return the host device number if offloading is disabled? My reasoning is: Why should "offload disabled" be different from "no offload", e.g., because there are no devices available.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list