mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Follows #127727 Pull Request resolved: https://github.com/pytorch/pytorch/pull/127764 Approved by: https://github.com/Skylion007
14 lines
170 B
C++
14 lines
170 B
C++
#pragma once
|
|
|
|
namespace torch::utils {
|
|
|
|
inline constexpr bool cuda_enabled() {
|
|
#ifdef USE_CUDA
|
|
return true;
|
|
#else
|
|
return false;
|
|
#endif
|
|
}
|
|
|
|
} // namespace torch::utils
|