Hi Thomas,

On 06.07.22 14:38, Thomas Schwinge wrote:
:-) Haha, that's actually *exactly* what I had implemented first!  But
then I realized that 'target offloading_enabled' is doing exactly that:
check that offloading compilation is configured -- not that "there is an
offloading device available or not" as you seem to understand?  Or am I
confused there?

I think as you mentioned below – there is a difference. And that difference,
I explicitly maked use of:
 - libgomp.c-c++-common/requires-{1,5,7}.c test the device lto1 compiler,
   which requires that it is actually available. Thus, I used:
   /* { dg-do link { target { offload_target_nvptx || offload_target_amdgcn } } 
} */
while
 - libgomp.c-c++-common/requires-2.c checks that ENABLE_OFFLOADING == true, i.e.
   the host lto1 compiler is configured to create the offload tables and, thus,
   can diagnose the omp-requires mismatch. Hence, the testcase has:
   /* { dg-do link { target offloading_enabled } } */
   /* { dg-additional-options "-foffload=disable -flto" } */

Granted, as the other files do not use -foffload=..., it should not
make a difference - but, still, replacing it unconditionally
with 'target offloading_enabled' feels wrong.

I was about to write again about --enable-offload-defaulted and
having no offloading compilers installed. But that comes too late.
gcc.cc (the driver) will set
  OFFLOAD_TARGET_NAMES=
to the configured offload-target compilers (after -foffload= filtering),
but the is-available check is only done in lto-wrapper.cc, which comes
too late. But I admit it is unlikely that someone configures + builds
offload compilers and, then, for testing have no offload compilers
available.

I do however agree that (generally) replacing 'target offloading_enabled'
with a new 'target offload_target_any' would seem appropriate (as a
separate patch), because that would also do the right thing when running
libgomp testing with non-default '-foffload=[...]', including
'-foffload=disable'.

I concur – but I would prefer to have that lib/libgomp.exp patch committed
before the testsuite-part of this patch is committed. Albeit, I do not feel
very strong about this.

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955

Reply via email to