llvm-project/flang/module/cuda_runtime_api.f90
Valentin Clement (バレンタイン クレメン) c4170461d7
[flang][cuda] Lower set/get default stream for arrays (#181432)
2026-02-13 23:44:38 +00:00

40 lines
1.3 KiB
Fortran

!===-- module/cuda_runtime_api.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
!
!===------------------------------------------------------------------------===!
module cuda_runtime_api
implicit none
integer, parameter :: cuda_stream_kind = int_ptr_kind()
interface cudaforgetdefaultstream
integer(kind=cuda_stream_kind) function cudagetstreamdefaultarg(devptr)
import cuda_stream_kind
!DIR$ IGNORE_TKR (TKR) devptr
integer, device :: devptr(*)
end function
integer(kind=cuda_stream_kind) function cudastreamgetdefaultnull()
import cuda_stream_kind
end function
end interface
interface cudaforsetdefaultstream
integer function cudasetdefaultstream(stream)
import cuda_stream_kind
!DIR$ IGNORE_TKR (K) stream
integer(kind=cuda_stream_kind), value :: stream
end function
integer function cudasetstreamarray(devptr, stream)
import cuda_stream_kind
!DIR$ IGNORE_TKR (K) stream, (TKR) devptr
integer, device :: devptr(*)
integer(kind=cuda_stream_kind), value :: stream
end function
end interface
end module cuda_runtime_api