"vscode:/vscode.git/clone" did not exist on "abb89da4de3b9196933d9a885db822d60da18cac"
version.cpp 363 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <Python.h>
#include <torch/script.h>

#ifdef WITH_CUDA
#include <cuda.h>
#endif

#ifdef _WIN32
PyMODINIT_FUNC PyInit__version(void) { return NULL; }
#endif

int64_t cuda_version() {
#ifdef WITH_CUDA
  return CUDA_VERSION;
#else
  return -1;
#endif
}

static auto registry =
rusty1s's avatar
rusty1s committed
21
    torch::RegisterOperators().op("torch_sparse::cuda_version", &cuda_version);