Files
llvm-project/flang/module/cuda_runtime_api.f90
Valentin Clement (バレンタイン クレメン) 26b4c25b8b [flang][cuda] Add support for cudaStreamDestroy (#183648)
Add specific lowering and entry point for cudaStreamDestroy. Since we
keep associated stream for some allocation, we need to reset it when the
stream is destroy so we don't use it anymore.
2026-02-27 00:24:29 +00:00

48 lines
1.5 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 cudagetstreamdefaultnull()
import cuda_stream_kind
end function
end interface
interface cudaforsetdefaultstream
integer function cudasetstreamdefault(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
interface cudastreamdestroy
integer function cudastreamdestroy(stream)
import cuda_stream_kind
!DIR$ IGNORE_TKR (K) stream
integer(kind=cuda_stream_kind), value :: stream
end function
end interface
end module cuda_runtime_api