Files
MrForExample-ComfyUI-3D-Pack/Libs/simple-knn/spatial.cu
T
Mr. For Example 4e317c8d31 Replace torchmcubes with PyMCubes
torchmcubes dependencies is archived on github, so for better maintenance, I replace it with PyMCubes inside TripoSR
2024-07-03 17:52:40 -06:00

26 lines
671 B
Plaintext

/*
* Copyright (C) 2023, Inria
* GRAPHDECO research group, https://team.inria.fr/graphdeco
* All rights reserved.
*
* This software is free for non-commercial, research and evaluation use
* under the terms of the LICENSE.md file.
*
* For inquiries contact george.drettakis@inria.fr
*/
#include "spatial.h"
#include "simple_knn.h"
torch::Tensor
distCUDA2(const torch::Tensor& points)
{
const int P = points.size(0);
auto float_opts = points.options().dtype(torch::kFloat32);
torch::Tensor means = torch::full({P}, 0.0, float_opts);
SimpleKNN::knn(P, (float3*)points.contiguous().data<float>(), means.contiguous().data<float>());
return means;
}