| 1 |
!===-- module/cudedevice.f90 -----------------------------------------------===! |
| 2 |
! |
| 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 |
| 6 |
! |
| 7 |
!===------------------------------------------------------------------------===! |
| 8 |
|
| 9 |
! CUDA Fortran procedures available in device subprogram |
| 10 |
|
| 11 |
module cudadevice |
| 12 |
implicit none |
| 13 |
|
| 14 |
! Set PRIVATE by default to explicitly only export what is meant |
| 15 |
! to be exported by this MODULE. |
| 16 |
private |
| 17 |
|
| 18 |
! Synchronization Functions |
| 19 |
|
| 20 |
interface |
| 21 |
attributes(device) subroutine syncthreads() bind(c, name='__syncthreads') |
| 22 |
end subroutine |
| 23 |
end interface |
| 24 |
public :: syncthreads |
| 25 |
|
| 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 |
| 32 |
|
| 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 |
| 39 |
|
| 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 |
| 46 |
|
| 47 |
interface |
| 48 |
attributes(device) subroutine syncwarp(mask) bind(c, name='__syncwarp') |
| 49 |
integer :: mask |
| 50 |
end subroutine |
| 51 |
end interface |
| 52 |
public :: syncwarp |
| 53 |
|
| 54 |
! Memory Fences |
| 55 |
|
| 56 |
interface |
| 57 |
attributes(device) subroutine threadfence() bind(c, name='__threadfence') |
| 58 |
end subroutine |
| 59 |
end interface |
| 60 |
public :: threadfence |
| 61 |
|
| 62 |
interface |
| 63 |
attributes(device) subroutine threadfence_block() bind(c, name='__threadfence_block') |
| 64 |
end subroutine |
| 65 |
end interface |
| 66 |
public :: threadfence_block |
| 67 |
|
| 68 |
interface |
| 69 |
attributes(device) subroutine threadfence_system() bind(c, name='__threadfence_system') |
| 70 |
end subroutine |
| 71 |
end interface |
| 72 |
public :: threadfence_system |
| 73 |
|
| 74 |
end module |