This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Also test -O0 for OpenACC C, C++ offloading test cases


On 03/23/2016 07:47 AM, Thomas Schwinge wrote:
Want me to re-word that?  :-| I thought it would be obvious from looking
at the test case code; will not be a problem in practice.  It's because
of constructs used in the test cases, like the following, for example:

           if (__builtin_acc_on_device (5))
             {
               int g = 0, w = 0, v = 0;

               __asm__ volatile ("mov.u32 %0,%%ctaid.x;" : "=r" (g));
               __asm__ volatile ("mov.u32 %0,%%tid.y;" : "=r" (w));
               __asm__ volatile ("mov.u32 %0,%%tid.x;" : "=r" (v));
               ary[ix] = (g << 16) | (w << 8) | v;

Ok, maybe write "This code uses nvptx assembly guarded with __builtin_acc_on_device, which fails to be optimized away at -O0."

Ok with something like that.


Bernd


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]