pytorch/torch/csrc/utils/cuda_enabled.h
2022-06-11 21:11:16 +00:00

16 lines
192 B
C++

#pragma once
namespace torch {
namespace utils {
static inline bool cuda_enabled() {
#ifdef USE_CUDA
return true;
#else
return false;
#endif
}
} // namespace utils
} // namespace torch