CUDAMiscFunctions.h 682 B

1234567891011121314151617181920
  1. #if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
  2. #pragma once
  3. // this file is to avoid circular dependency between CUDAFunctions.h and
  4. // CUDAExceptions.h
  5. #include <c10/cuda/CUDAMacros.h>
  6. #include <cuda_runtime.h>
  7. #include <mutex>
  8. #include <string>
  9. namespace c10::cuda {
  10. C10_CUDA_API std::string get_cuda_error_help(cudaError_t /*error*/) noexcept;
  11. C10_CUDA_API const char* get_cuda_check_suffix() noexcept;
  12. C10_CUDA_API std::mutex* getFreeMutex();
  13. } // namespace c10::cuda
  14. #else
  15. #error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
  16. #endif // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)