|
| 1 | +! RUN: %flang_fc1 -fdebug-dump-symbols %s | FileCheck %s |
| 2 | + |
| 3 | +! Test CUDA Fortran intrinsic can pass semantic |
| 4 | + |
| 5 | +attributes(global) subroutine devsub() |
| 6 | + implicit none |
| 7 | + integer :: ret |
| 8 | + |
| 9 | + ! 3.6.4. Synchronization Functions |
| 10 | + call syncthreads() |
| 11 | + call syncwarp(1) |
| 12 | + call threadfence() |
| 13 | + call threadfence_block() |
| 14 | + call threadfence_system() |
| 15 | + ret = syncthreads_and(1) |
| 16 | + ret = syncthreads_count(1) |
| 17 | + ret = syncthreads_or(1) |
| 18 | +end |
| 19 | + |
| 20 | +! CHECK-LABEL: Subprogram scope: devsub |
| 21 | +! CHECK: syncthreads, EXTERNAL, PUBLIC (Subroutine): Use from __cuda_device_builtins_syncthreads in __cuda_device_builtins |
| 22 | +! CHECK: syncthreads_and, EXTERNAL, PUBLIC (Function): Use from __cuda_device_builtins_syncthreads_and in __cuda_device_builtins |
| 23 | +! CHECK: syncthreads_count, EXTERNAL, PUBLIC (Function): Use from __cuda_device_builtins_syncthreads_count in __cuda_device_builtins |
| 24 | +! CHECK: syncthreads_or, EXTERNAL, PUBLIC (Function): Use from __cuda_device_builtins_syncthreads_or in __cuda_device_builtins |
| 25 | +! CHECK: syncwarp, EXTERNAL, PUBLIC (Subroutine): Use from __cuda_device_builtins_syncwarp in __cuda_device_builtins |
| 26 | +! CHECK: threadfence, EXTERNAL, PUBLIC (Subroutine): Use from __cuda_device_builtins_threadfence in __cuda_device_builtins |
| 27 | +! CHECK: threadfence_block, EXTERNAL, PUBLIC (Subroutine): Use from __cuda_device_builtins_threadfence_block in __cuda_device_builtins |
| 28 | +! CHECK: threadfence_system, EXTERNAL, PUBLIC (Subroutine): Use from __cuda_device_builtins_threadfence_system in __cuda_device_builtins |
| 29 | + |
| 30 | +subroutine host() |
| 31 | + call syncthreads() |
| 32 | +end subroutine |
| 33 | + |
| 34 | +! CHECK-LABEL: Subprogram scope: host |
| 35 | +! CHECK: syncthreads, EXTERNAL: HostAssoc{{$}} |
0 commit comments