pytorch/c10/cuda
Jeff Moe b8fc24e092 Upstream v2.1.0 2023-11-08 09:13:36 -07:00
..
impl Upstream v2.1.0 2023-11-08 09:13:36 -07:00
test Upstream v2.1.0 2023-11-08 09:13:36 -07:00
BUILD.bazel Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CMakeLists.txt Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDAAlgorithm.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDACachingAllocator.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDACachingAllocator.h Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDADeviceAssertion.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDADeviceAssertionHost.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDADeviceAssertionHost.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAException.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAException.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAFunctions.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDAFunctions.h Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDAGraphsC10Utils.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAGuard.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAMacros.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAMallocAsyncAllocator.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDAMathCompat.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAMiscFunctions.cpp Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAMiscFunctions.h Forklet of Pytorch 2023-11-08 09:01:59 -07:00
CUDAStream.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
CUDAStream.h Upstream v2.1.0 2023-11-08 09:13:36 -07:00
README.md Forklet of Pytorch 2023-11-08 09:01:59 -07:00
build.bzl Upstream v2.1.0 2023-11-08 09:13:36 -07:00
driver_api.cpp Upstream v2.1.0 2023-11-08 09:13:36 -07:00
driver_api.h Upstream v2.1.0 2023-11-08 09:13:36 -07:00

README.md

c10/cuda is a core library with CUDA functionality. It is distinguished from c10 in that it links against the CUDA library, but like c10 it doesn't contain any kernels, and consists solely of core functionality that is generally useful when writing CUDA code; for example, C++ wrappers for the CUDA C API.

Important notes for developers. If you want to add files or functionality to this folder, TAKE NOTE. The code in this folder is very special, because on our AMD GPU build, we transpile it into c10/hip to provide a ROCm environment. Thus, if you write:

// c10/cuda/CUDAFoo.h
namespace c10 { namespace cuda {

void my_func();

}}

this will get transpiled into:

// c10/hip/HIPFoo.h
namespace c10 { namespace hip {

void my_func();

}}

Thus, if you add new functionality to c10, you must also update C10_MAPPINGS torch/utils/hipify/cuda_to_hip_mappings.py to transpile occurrences of cuda::my_func to hip::my_func. (At the moment, we do NOT have a catch all cuda:: to hip:: namespace conversion, as not all cuda namespaces are converted to hip::, even though c10's are.)

Transpilation inside this folder is controlled by CAFFE2_SPECIFIC_MAPPINGS (oddly enough.) C10_MAPPINGS apply to ALL source files.

If you add a new directory to this folder, you MUST update both c10/cuda/CMakeLists.txt and c10/hip/CMakeLists.txt