PyTorchEMD/torchemd/cuda/emd.cpp

31 lines
754 B
C++
Raw Normal View History

2019-09-10 08:05:04 +00:00
#ifndef _EMD
#define _EMD
#include <vector>
#include <torch/extension.h>
2023-04-24 09:53:37 +00:00
// CUDA declarations
2019-09-10 08:05:04 +00:00
at::Tensor ApproxMatchForward(
const at::Tensor xyz1,
const at::Tensor xyz2);
at::Tensor MatchCostForward(
const at::Tensor xyz1,
const at::Tensor xyz2,
const at::Tensor match);
std::vector<at::Tensor> MatchCostBackward(
const at::Tensor grad_cost,
const at::Tensor xyz1,
const at::Tensor xyz2,
const at::Tensor match);
2023-04-24 09:53:37 +00:00
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
{
m.def("approxmatch_forward", &ApproxMatchForward, "ApproxMatch forward (CUDA)");
m.def("matchcost_forward", &MatchCostForward, "MatchCost forward (CUDA)");
m.def("matchcost_backward", &MatchCostBackward, "MatchCost backward (CUDA)");
2019-09-10 08:05:04 +00:00
}
#endif