On 4/1/22 17:57, Tom de Vries wrote: > On 4/1/22 17:38, Jakub Jelinek wrote: >> On Fri, Apr 01, 2022 at 05:34:50PM +0200, Tom de Vries wrote: >>> Do you perhaps have an idea why it's failing? >> >> Because you call on_device_arch_nvptx () outside of >> !$omp target region, so unless the host device is NVPTX, >> it will not be true. >> > > That bit does works because on_device_arch_nvptx calls on_device_arch > which contains the omp target bit: > ... > static int > on_device_arch (int d) > { >   int d_cur; >   #pragma omp target map(from:d_cur) >   d_cur = device_arch (); > >   return d_cur == d; > } > > int > on_device_arch_nvptx () > { >   return on_device_arch (GOMP_DEVICE_NVIDIA_PTX); > } > ... > > So I realized that I didn't do a good job of specifying the problem I > encountered, and went looking at it, at which point I realized the error > message had changed, and knew how to fix it ... So, my apologies, some > confusion on my part. > > Anyway, attached patch avoids any nvptx-related tcl directives (just for > once test-case for now).  To me, this seems the most robust solution. > > It this approach acceptable? I intend to commit this in a few days, unless there are objections. Thanks, - Tom