CUDA Graph in Cuda Fortran 2

Hi all,

From Mat has shown us how to create a CUDA Graph through Cuda Stream.

However, before call a kernel, I need to allocate device memory first. I am pretty sure that using CUDA Stream will not know that I need to allocate device memory first before calling a CUDA Kernel.

integer, managed, allocatable :: a(:)
cudaStreamBeginCapture(stream, 0)
call kernel <<<block, thread, 0, stream>>> (a) 
cudaStreamEndCapture(stream, graph)

Hi Phoon,

Correct. Device allocation is not associated with a stream and given Graph only captures the events on a stream, there’s not a way to capture allocation as part of a Graph.