-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrasterize_points.h
149 lines (136 loc) · 4.12 KB
/
rasterize_points.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* 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
*/
#pragma once
#include <torch/extension.h>
#include <cstdio>
#include <tuple>
#include <string>
std::tuple<int, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>
RasterizeGaussiansCUDA(
const torch::Tensor& background,
const torch::Tensor& means3D,
const torch::Tensor& colors,
const torch::Tensor& opacity,
const torch::Tensor& scales,
const torch::Tensor& rotations,
const float scale_modifier,
const torch::Tensor& cov3D_precomp,
const torch::Tensor& tile_mask,
const torch::Tensor& viewmatrix,
const torch::Tensor& projmatrix,
const float tan_fovx,
const float tan_fovy,
const int image_height,
const int image_width,
const torch::Tensor& sh,
const int degree,
const torch::Tensor& campos,
const bool prefiltered,
const bool debug);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor>
RasterizeGaussiansBackwardCUDA(
const torch::Tensor& background,
const torch::Tensor& means3D,
const torch::Tensor& radii,
const torch::Tensor& colors,
const torch::Tensor& scales,
const torch::Tensor& rotations,
const float scale_modifier,
const torch::Tensor& cov3D_precomp,
const torch::Tensor& viewmatrix,
const torch::Tensor& projmatrix,
const float tan_fovx,
const float tan_fovy,
const torch::Tensor& dL_dout_color,
const torch::Tensor& dL_dout_depth,
const torch::Tensor& dL_dout_alpha,
const torch::Tensor& sh,
const int degree,
const torch::Tensor& campos,
const torch::Tensor& geomBuffer,
const int R,
const torch::Tensor& binningBuffer,
const torch::Tensor& imageBuffer,
const torch::Tensor& out_alpha,
const bool debug);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor> fusedPreprocess4D(
const torch::Tensor& means3D,
const torch::Tensor& cov,
const torch::Tensor& ms,
const torch::Tensor& cov_t,
const torch::Tensor& opacities,
const torch::Tensor& t1,
const torch::Tensor& sh,
const torch::Tensor& t,
const torch::Tensor& viewmatrix,
const torch::Tensor& projmatrix,
const torch::Tensor& cam_pos,
const int deg,
const int deg_t,
const float duration
);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor, torch::Tensor> fusedPreprocess4DSparse(
const torch::Tensor& means3D,
const torch::Tensor& cov,
const torch::Tensor& ms,
const torch::Tensor& cov_t,
const torch::Tensor& opacities,
const torch::Tensor& t1,
const torch::Tensor& base,
const torch::Tensor& sh,
const torch::Tensor& t,
const torch::Tensor& inverse,
const torch::Tensor& viewmatrix,
const torch::Tensor& projmatrix,
const torch::Tensor& cam_pos,
const int deg,
const int deg_t,
const float duration
);
torch::Tensor markVisible(
torch::Tensor& means3D,
torch::Tensor& viewmatrix,
torch::Tensor& projmatrix);
torch::Tensor computeCov3D(
torch::Tensor& scaling_xyz,
torch::Tensor& rotation_l);
std::tuple<torch::Tensor, torch::Tensor> computeCov3DBackward(
torch::Tensor& scaling_xyz,
torch::Tensor& rotation_l,
torch::Tensor& dL_dcov);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> computeCov4D(
torch::Tensor& scaling_xyzt,
torch::Tensor& rotation_l,
torch::Tensor& rotation_r);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> computeCov4DBackward(
torch::Tensor& scaling_xyzt,
torch::Tensor& rotation_l,
torch::Tensor& rotation_r,
torch::Tensor& dL_dcov,
torch::Tensor& dL_dms,
torch::Tensor& dL_dcov_t);
torch::Tensor computeSH4D(
const int deg,
const int deg_t,
torch::Tensor& sh,
torch::Tensor& dir,
torch::Tensor& dir_t,
const float duration
);
std::tuple<torch::Tensor, torch::Tensor, torch::Tensor> computeSH4DBackward(
const int deg,
const int deg_t,
torch::Tensor& sh,
torch::Tensor& dir,
torch::Tensor& dir_t,
const float duration,
torch::Tensor& dL_drgb
);