| 1 |
!===-- module/__cuda_builtins.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 |
! These CUDA predefined variables are automatically available in device |
| 10 |
! subprograms. |
| 11 |
|
| 12 |
module __CUDA_builtins |
| 13 |
use __fortran_builtins, only: & |
| 14 |
threadIdx => __builtin_threadIdx, & |
| 15 |
blockDim => __builtin_blockDim, & |
| 16 |
blockIdx => __builtin_blockIdx, & |
| 17 |
gridDim => __builtin_gridDim, & |
| 18 |
warpsize => __builtin_warpsize |
| 19 |
|
| 20 |
implicit none |
| 21 |
|
| 22 |
! Set PRIVATE by default to explicitly only export what is meant |
| 23 |
! to be exported by this MODULE. |
| 24 |
private |
| 25 |
|
| 26 |
public :: threadIdx, & |
| 27 |
blockDim, & |
| 28 |
blockIdx, & |
| 29 |
gridDim, & |
| 30 |
warpsize |
| 31 |
end module |