Hi!

On Wed, 23 Mar 2016 20:02:01 +0100, Jakub Jelinek <ja...@redhat.com> wrote:
> On Tue, Mar 22, 2016 at 11:23:43AM +0100, Thomas Schwinge wrote:
> > As discussed in
> > <http://news.gmane.org/find-root.php?message_id=%3C87oaj3z280.fsf%40schwinge.name%3E>
> > (and similar to what we're already doing for Fortran, and similar to what
> > recently got committed to libgomp/testsuite/libgomp.hsa.c/c.exp), it has
> > been helpful to also run C, C++ offloading test cases with -O0 in
> > addition to the -O2 default.  Making my earlier gomp-4_0-branch patch
> > conceptually simpler, I came up with the following; OK for trunk?
> 
> How big difference in make check-target-libgomp time is that?
> Without PTX offloading I bet zero, but with PTX offloading configured, is it
> 10% or 50% slower?

15 %.  The major part of the total time is still spent in Fortran
testing...  ;-/

Offloading compilation is slow; I suppose because of having to invoke
several tools (LTO streaming -> mkoffload -> offload compilers,
assemblers, linkers -> combine the resulting images; but I have not done
a detailed analysis on that).  I used the following patch to gather the
following numbers:

Baseline, without offloading:

    TIME 1458823399 START [...]/libgomp.c/c.exp
    TIME 1458823544 (145) END [...]/libgomp.c/c.exp
    TIME 1458823544 START [...]/libgomp.c++/c++.exp
    TIME 1458823672 (128) END [...]/libgomp.c++/c++.exp
    TIME 1458823672 START [...]/libgomp.fortran/fortran.exp
    TIME 1458824080 (408) END [...]/libgomp.fortran/fortran.exp
    TIME 1458824080 START [...]/libgomp.graphite/graphite.exp
    TIME 1458824083 (3) END [...]/libgomp.graphite/graphite.exp
    TIME 1458824083 START [...]/libgomp.hsa.c/c.exp
    TIME 1458824083 (0) END [...]/libgomp.hsa.c/c.exp
    TIME 1458824084 START [...]/libgomp.oacc-c/c.exp
    TIME 1458824109 (25) END [...]/libgomp.oacc-c/c.exp
    TIME 1458824109 START [...]/libgomp.oacc-c++/c++.exp
    TIME 1458824141 (32) END [...]/libgomp.oacc-c++/c++.exp
    TIME 1458824141 START [...]/libgomp.oacc-fortran/fortran.exp
    TIME 1458824215 (74) END [...]/libgomp.oacc-fortran/fortran.exp

Total: 680 s (OpenMP) + 130 s (OpenACC) = 810 s.

With OpenMP IntelMIC (emulated) and OpenACC nvptx offloading:

    TIME 1458824215 START [...]/libgomp.c/c.exp
    TIME 1458824461 (246) END [...]/libgomp.c/c.exp
    TIME 1458824461 START [...]/libgomp.c++/c++.exp
    TIME 1458824664 (203) END [...]/libgomp.c++/c++.exp
    TIME 1458824664 START [...]/libgomp.fortran/fortran.exp
    TIME 1458825269 (605) END [...]/libgomp.fortran/fortran.exp
    TIME 1458825269 START [...]/libgomp.graphite/graphite.exp
    TIME 1458825272 (3) END [...]/libgomp.graphite/graphite.exp
    TIME 1458825273 START [...]/libgomp.hsa.c/c.exp
    TIME 1458825273 (0) END [...]/libgomp.hsa.c/c.exp
    TIME 1458825273 START [...]/libgomp.oacc-c/c.exp
    TIME 1458825533 (260) END [...]/libgomp.oacc-c/c.exp
    TIME 1458825533 START [...]/libgomp.oacc-c++/c++.exp
    TIME 1458825860 (327) END [...]/libgomp.oacc-c++/c++.exp
    TIME 1458825860 START [...]/libgomp.oacc-fortran/fortran.exp
    TIME 1458826459 (599) END [...]/libgomp.oacc-fortran/fortran.exp

Total: 1050 s (OpenMP; + 54 %) + 1190 s (OpenACC; + 815 %) = 2240 s (+ 177 %).

Patched with "Also test -O0 for OpenACC C, C++ offloading test cases",
that results in the following changes (with offloading only):

    TIME 1458834409 START [...]/libgomp.oacc-c/c.exp
    TIME 1458834814 (405) END [...]/libgomp.oacc-c/c.exp
    TIME 1458834814 START [...]/libgomp.oacc-c++/c++.exp
    TIME 1458835338 (524) END [...]/libgomp.oacc-c++/c++.exp

Total: 1050 s (OpenMP) + 1530 s (OpenACC; + 29 %) = 2580 s (+ 15 %).

--- libgomp/testsuite/lib/libgomp-dg.exp
+++ libgomp/testsuite/lib/libgomp-dg.exp
@@ -1,3 +1,18 @@
+rename dg-init dg-init_
+proc dg-init { } {
+    dg-init_
+    global CLOCK_START
+    set CLOCK_START [clock seconds]
+    verbose "TIME $CLOCK_START START [info script]" 0
+}
+rename dg-finish dg-finish_
+proc dg-finish { } {
+    dg-finish_
+    set CLOCK [clock seconds]
+    global CLOCK_START
+    verbose "TIME $CLOCK ([expr $CLOCK - $CLOCK_START]) END [info script]" 0
+}
+
 proc libgomp-dg-test { prog do_what extra_tool_flags } {
     return [gcc-dg-test-1 libgomp_target_compile $prog $do_what 
$extra_tool_flags]
 }


Grüße
 Thomas

Reply via email to