Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
impl/ | H | 25-Apr-2025 | - | 306 | 244 | |
test/ | H | 25-Apr-2025 | - | 746 | 568 | |
BUILD.bazel | H A D | 25-Apr-2025 | 104 | 5 | 3 | |
CMakeLists.txt | H A D | 25-Apr-2025 | 3.1 KiB | 101 | 86 | |
CUDAAlgorithm.h | H A D | 25-Apr-2025 | 1 KiB | 32 | 28 | |
CUDAAllocatorConfig.cpp | H A D | 25-Apr-2025 | 12.3 KiB | 372 | 332 | |
CUDAAllocatorConfig.h | H A D | 25-Apr-2025 | 3.7 KiB | 125 | 95 | |
CUDACachingAllocator.cpp | H A D | 25-Apr-2025 | 134.7 KiB | 3,844 | 2,773 | |
CUDACachingAllocator.h | H A D | 25-Apr-2025 | 15.6 KiB | 500 | 359 | |
CUDADeviceAssertion.h | H A D | 25-Apr-2025 | 4 KiB | 97 | 64 | |
CUDADeviceAssertionHost.cpp | H A D | 25-Apr-2025 | 12.4 KiB | 345 | 245 | |
CUDADeviceAssertionHost.h | H A D | 25-Apr-2025 | 6.5 KiB | 165 | 80 | |
CUDAException.cpp | H A D | 25-Apr-2025 | 1.3 KiB | 47 | 37 | |
CUDAException.h | H A D | 25-Apr-2025 | 4.4 KiB | 101 | 68 | |
CUDAFunctions.cpp | H A D | 25-Apr-2025 | 10.8 KiB | 343 | 274 | |
CUDAFunctions.h | H A D | 25-Apr-2025 | 3.8 KiB | 117 | 73 | |
CUDAGraphsC10Utils.h | H A D | 25-Apr-2025 | 2.6 KiB | 78 | 56 | |
CUDAGuard.h | H A D | 25-Apr-2025 | 11 KiB | 302 | 142 | |
CUDAMacros.h | H A D | 25-Apr-2025 | 1.4 KiB | 52 | 32 | |
CUDAMallocAsyncAllocator.cpp | H A D | 25-Apr-2025 | 34.4 KiB | 913 | 547 | |
CUDAMathCompat.h | H A D | 25-Apr-2025 | 3.5 KiB | 153 | 122 | |
CUDAMiscFunctions.cpp | H A D | 25-Apr-2025 | 691 | 24 | 20 | |
CUDAMiscFunctions.h | H A D | 25-Apr-2025 | 306 | 13 | 7 | |
CUDAStream.cpp | H A D | 25-Apr-2025 | 12.8 KiB | 383 | 248 | |
CUDAStream.h | H A D | 25-Apr-2025 | 9.4 KiB | 269 | 114 | |
README.md | H A D | 25-Apr-2025 | 1.3 KiB | 44 | 31 | |
build.bzl | H A D | 25-Apr-2025 | 1.6 KiB | 67 | 63 | |
driver_api.cpp | H A D | 25-Apr-2025 | 1.5 KiB | 53 | 42 | |
driver_api.h | H A D | 25-Apr-2025 | 2.4 KiB | 64 | 56 |
README.md
1c10/cuda is a core library with CUDA functionality. It is distinguished 2from c10 in that it links against the CUDA library, but like c10 it doesn't 3contain any kernels, and consists solely of core functionality that is generally 4useful when writing CUDA code; for example, C++ wrappers for the CUDA C API. 5 6**Important notes for developers.** If you want to add files or functionality 7to this folder, TAKE NOTE. The code in this folder is very special, 8because on our AMD GPU build, we transpile it into c10/hip to provide a 9ROCm environment. Thus, if you write: 10 11``` 12// c10/cuda/CUDAFoo.h 13namespace c10 { namespace cuda { 14 15void my_func(); 16 17}} 18``` 19 20this will get transpiled into: 21 22 23``` 24// c10/hip/HIPFoo.h 25namespace c10 { namespace hip { 26 27void my_func(); 28 29}} 30``` 31 32Thus, if you add new functionality to c10, you must also update `C10_MAPPINGS` 33`torch/utils/hipify/cuda_to_hip_mappings.py` to transpile 34occurrences of `cuda::my_func` to `hip::my_func`. (At the moment, 35we do NOT have a catch all `cuda::` to `hip::` namespace conversion, 36as not all `cuda` namespaces are converted to `hip::`, even though 37c10's are.) 38 39Transpilation inside this folder is controlled by `CAFFE2_SPECIFIC_MAPPINGS` 40(oddly enough.) `C10_MAPPINGS` apply to ALL source files. 41 42If you add a new directory to this folder, you MUST update both 43c10/cuda/CMakeLists.txt and c10/hip/CMakeLists.txt 44