[flang][cuda] Move interface to __cuda_device (#122771)
This commit is contained in:
committed by
GitHub
parent
ba4dc5a0d6
commit
c701c18bed
32
flang/module/__cuda_device.f90
Normal file
32
flang/module/__cuda_device.f90
Normal file
@@ -0,0 +1,32 @@
|
||||
!===-- module/__cuda_device.f90 --------------------------------------------===!
|
||||
!
|
||||
! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
! See https://llvm.org/LICENSE.txt for license information.
|
||||
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
!
|
||||
!===------------------------------------------------------------------------===!
|
||||
|
||||
! This module contains CUDA Fortran interfaces used in cudadevice.f90.
|
||||
|
||||
module __cuda_device
|
||||
implicit none
|
||||
|
||||
! Set PRIVATE by default to explicitly only export what is meant
|
||||
! to be exported by this MODULE.
|
||||
|
||||
interface
|
||||
attributes(device) function __fadd_rd(x, y) bind(c, name='__nv_fadd_rd')
|
||||
real, intent(in), value :: x, y
|
||||
real :: __fadd_rd
|
||||
end function
|
||||
end interface
|
||||
public :: __fadd_rd
|
||||
|
||||
interface
|
||||
attributes(device) function __fadd_ru(x, y) bind(c, name='__nv_fadd_ru')
|
||||
real, intent(in), value :: x, y
|
||||
real :: __fadd_ru
|
||||
end function
|
||||
end interface
|
||||
public :: __fadd_ru
|
||||
end module
|
||||
@@ -9,6 +9,7 @@
|
||||
! CUDA Fortran procedures available in device subprogram
|
||||
|
||||
module cudadevice
|
||||
use __cuda_device, only: __fadd_rd, __fadd_ru
|
||||
implicit none
|
||||
|
||||
! Set PRIVATE by default to explicitly only export what is meant
|
||||
@@ -71,20 +72,4 @@ implicit none
|
||||
end interface
|
||||
public :: threadfence_system
|
||||
|
||||
interface
|
||||
attributes(device) function __fadd_rd(x, y) bind(c, name='__nv_fadd_rd')
|
||||
real, intent(in) :: x, y
|
||||
real :: __fadd_rd
|
||||
end function
|
||||
end interface
|
||||
public :: __fadd_rd
|
||||
|
||||
interface
|
||||
attributes(device) function __fadd_ru(x, y) bind(c, name='__nv_fadd_ru')
|
||||
real, intent(in) :: x, y
|
||||
real :: __fadd_ru
|
||||
end function
|
||||
end interface
|
||||
public :: __fadd_ru
|
||||
|
||||
end module
|
||||
|
||||
Reference in New Issue
Block a user