rowptr.cpp 352 Bytes
Newer Older
1
2
3
4
#include <torch/extension.h>

#define CHECK_CUDA(x) AT_ASSERTM(x.type().is_cuda(), #x " must be CUDA tensor")

rusty1s's avatar
rusty1s committed
5
at::Tensor rowptr_cuda(at::Tensor row, int64_t M);
6

rusty1s's avatar
rusty1s committed
7
at::Tensor rowptr(at::Tensor row, int64_t M) {
8
  CHECK_CUDA(row);
rusty1s's avatar
rusty1s committed
9
  return rowptr_cuda(row, M);
10
11
12
13
14
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
  m.def("rowptr", &rowptr, "Rowptr (CUDA)");
}