[libc++][Android] Allow testing libc++ with clang-r536225 (#116149)
[llvm-project.git] / flang / module / cudadevice.f90
blob0224ecfdde7c6097a4d4e32f3f6232e3b9fe01a4
1 !===-- module/cudedevice.f90 -----------------------------------------------===!
3 ! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 ! See https://llvm.org/LICENSE.txt for license information.
5 ! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 !===------------------------------------------------------------------------===!
9 ! CUDA Fortran procedures available in device subprogram
11 module cudadevice
12 implicit none
14 ! Set PRIVATE by default to explicitly only export what is meant
15 ! to be exported by this MODULE.
16 private
18 ! Synchronization Functions
20 interface
21 attributes(device) subroutine syncthreads() bind(c, name='__syncthreads')
22 end subroutine
23 end interface
24 public :: syncthreads
26 interface
27 attributes(device) integer function syncthreads_and(value) bind(c, name='__syncthreads_and')
28 integer :: value
29 end function
30 end interface
31 public :: syncthreads_and
33 interface
34 attributes(device) integer function syncthreads_count(value) bind(c, name='__syncthreads_count')
35 integer :: value
36 end function
37 end interface
38 public :: syncthreads_count
40 interface
41 attributes(device) integer function syncthreads_or(value) bind(c, name='__syncthreads_or')
42 integer :: value
43 end function
44 end interface
45 public :: syncthreads_or
47 interface
48 attributes(device) subroutine syncwarp(mask) bind(c, name='__syncwarp')
49 integer :: mask
50 end subroutine
51 end interface
52 public :: syncwarp
54 ! Memory Fences
56 interface
57 attributes(device) subroutine threadfence() bind(c, name='__threadfence')
58 end subroutine
59 end interface
60 public :: threadfence
62 interface
63 attributes(device) subroutine threadfence_block() bind(c, name='__threadfence_block')
64 end subroutine
65 end interface
66 public :: threadfence_block
68 interface
69 attributes(device) subroutine threadfence_system() bind(c, name='__threadfence_system')
70 end subroutine
71 end interface
72 public :: threadfence_system
74 end module