libgomp/testsuite/libgomp.oacc-c-c++-common/routine-nohost-2_2.c
raw| 1 | /* { dg-skip-if "" { *-*-* } } */ |
| 2 | |
| 3 | #pragma acc routine nohost |
| 4 | int f1(int x) |
| 5 | { |
| 6 | /* Make sure this fails host compilation. */ |
| 7 | #if defined ACC_DEVICE_TYPE_host |
| 8 | asm ("IT'S A TRAP"); |
| 9 | #elif defined ACC_DEVICE_TYPE_nvidia |
| 10 | asm ("{\n\t .reg .u32 %tid_x;\n\t mov.u32 %tid_x, %tid.x;\n\t}"); |
| 11 | #elif defined ACC_DEVICE_TYPE_radeon |
| 12 | asm ("s_nop 0"); |
| 13 | #else |
| 14 | # error Not ported to this ACC_DEVICE_TYPE |
| 15 | #endif |
| 16 | |
| 17 | return 2 * x; |
| 18 | } |