xref: /aosp_15_r20/external/pytorch/torch/csrc/utils/cuda_enabled.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 namespace torch::utils {
4 
cuda_enabled()5 inline constexpr bool cuda_enabled() {
6 #ifdef USE_CUDA
7   return true;
8 #else
9   return false;
10 #endif
11 }
12 
13 } // namespace torch::utils
14