utils.cpp 455 Bytes
Newer Older
1
#include <ATen/DynamicLibrary.h>
2
#include <libtorchaudio/utils.h>
Caroline Chen's avatar
Caroline Chen committed
3

hwangjeff's avatar
hwangjeff committed
4
5
6
7
#ifdef USE_CUDA
#include <cuda.h>
#endif

Caroline Chen's avatar
Caroline Chen committed
8
9
namespace torchaudio {

10
11
12
13
14
15
16
17
bool is_rir_available() {
#ifdef INCLUDE_RIR
  return true;
#else
  return false;
#endif
}

18
19
20
21
22
23
24
25
bool is_align_available() {
#ifdef INCLUDE_ALIGN
  return true;
#else
  return false;
#endif
}

26
std::optional<int64_t> cuda_version() {
hwangjeff's avatar
hwangjeff committed
27
28
29
30
31
32
#ifdef USE_CUDA
  return CUDA_VERSION;
#else
  return {};
#endif
}
Caroline Chen's avatar
Caroline Chen committed
33
34

} // namespace torchaudio