On Wed, 21 Oct 2015, Jakub Jelinek wrote:

> On Wed, Oct 21, 2015 at 12:16:35PM +0300, Alexander Monakov wrote:
> > > Of course that doesn't help the thread-limit-2.c testcase.
> > 
> > Why not?
> 
> Because the compiler can be configured for multiple offloading devices,
> and PTX might not be the first device.  So, you'd need to have a tcl
> test whether PTX is enabled at all rather than whether it is the default
> device.

My previous response was a bit confused so let me correct myself.

Checking whether PTX is enabled as an offload target is relatively easy in
libgomp DejaGNU harness: just inspect $offload_targets_s.  This helps to XFAIL
the test that would fail at compile time, but such XFAIL'ing is, like you
said, undesirable because it drops the test for all offload targets.  I'd
rather provide a dummy 'usleep' under #ifdef __nvptx__.  WDYT?

On the other hand, checking whether PTX will be the default device when
running the compiled test seems non-trivial.

Here's how OpenACC seems to handle it: they loop over all configured offload
targets (plus "disable"), and set a single offload target explicitely with
-foffload=$offload_target_openacc.  Thus each test is compiled once or twice
(for host-only, and for nvptx if applicable).  This allows to XFAIL OpenACC
tests on per-offload-target basis.

I've updated my patches locally in response to reviews to the last series,
except where shared memory is involved.  Should I resend?  

Thanks.
Alexander

Reply via email to