This function initializes the CUDA runtime environment if it is not already
initialized and returns the CUDA runtime API module (_cudart). The CUDA
runtime API module provides access to various CUDA runtime functions.
Parameters:
None –
Returns:
The CUDA runtime API module (_cudart).
Return type
:
module
Raises:
RuntimeError – If CUDA cannot be re-initialized in a forked subprocess.
AssertionError – If PyTorch is not compiled with CUDA support or if libcudart functions are unavailable.
This command profiles the CUDA operations in the provided script and saves
the profiling information to a file named trace_name.prof.
The –profile-from-start off option ensures that profiling starts only
after the cudaProfilerStart call in the script.
The –csv and –print-summary options format the profiling output as a
CSV file and print a summary, respectively.
The -o option specifies the output file name, and the -f option forces the
overwrite of the output file if it already exists.