MCPcopy Create free account
hub / github.com/pytorch/pytorch / _join_cuda_home

Function _join_cuda_home

torch/utils/cpp_extension.py:2399–2409  ·  view source on GitHub ↗

Join paths with CUDA_HOME, or raises an error if it CUDA_HOME is not set. This is basically a lazy way of raising an error for missing $CUDA_HOME only once we need to get any CUDA-specific path.

(*paths)

Source from the content-addressed store, hash-verified

2397 _maybe_write(path, content)
2398
2399def _join_cuda_home(*paths) -> str:
2400 """
2401 Join paths with CUDA_HOME, or raises an error if it CUDA_HOME is not set.
2402
2403 This is basically a lazy way of raising an error for missing $CUDA_HOME
2404 only once we need to get any CUDA-specific path.
2405 """
2406 if CUDA_HOME is None:
2407 raise OSError('CUDA_HOME environment variable is not set. '
2408 'Please set it to your CUDA install root.')
2409 return os.path.join(CUDA_HOME, *paths)
2410
2411
2412def _is_cuda_file(path: str) -> bool:

Callers 6

spawnMethod · 0.85
include_pathsFunction · 0.85
library_pathsFunction · 0.85
_prepare_ldflagsFunction · 0.85
_write_ninja_fileFunction · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…