On Wed, Aug 14, 2024 at 12:25:23PM +0200, Jakub Jelinek wrote: > Now, at least in 5.2 I don't see a restriction that target_device trait > can't be used inside of selectors in a target region. > IMHO that is a bug in the standard. E.g. it says that > "The expression of a device_num trait must evaluate to a non-negative integer > value that is > less than or equal to the value returned by omp_get_num_devices." > but it is unspecified what happens when omp_get_num_devices is > called in the target region. > Not really sure if in the patch you actually support say metadirective > with target_device from inside of a target region querying properties of > say the host device or something similar.
I've filed https://github.com/OpenMP/spec/issues/4133 for this (only accessible to OpenMP language committee members unfortunately). Jakub