Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
diff-gaussian-rasterization
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alan de Oliveira
diff-gaussian-rasterization
Commits
681c0f9e
Commit
681c0f9e
authored
Jun 20, 2023
by
Bernhard Kerbl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed bad conversions
parent
79cbd71d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
21 deletions
+22
-21
rasterizer.h
cuda_rasterizer/rasterizer.h
+3
-3
rasterizer_impl.cu
cuda_rasterizer/rasterizer_impl.cu
+7
-7
rasterizer_impl.h
cuda_rasterizer/rasterizer_impl.h
+6
-5
rasterize_points.cu
rasterize_points.cu
+6
-6
No files found.
cuda_rasterizer/rasterizer.h
View file @
681c0f9e
...
...
@@ -18,9 +18,9 @@ namespace CudaRasterizer
bool
*
present
);
static
int
forward
(
std
::
function
<
char
*
(
in
t
)
>
geometryBuffer
,
std
::
function
<
char
*
(
in
t
)
>
binningBuffer
,
std
::
function
<
char
*
(
in
t
)
>
imageBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
geometryBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
binningBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
imageBuffer
,
const
int
P
,
int
D
,
int
M
,
const
float
*
background
,
const
int
width
,
int
height
,
...
...
cuda_rasterizer/rasterizer_impl.cu
View file @
681c0f9e
...
...
@@ -141,7 +141,7 @@ void CudaRasterizer::Rasterizer::markVisible(
present);
}
CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& chunk,
in
t P)
CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& chunk,
size_
t P)
{
GeometryState geom;
obtain(chunk, geom.depths, P, 128);
...
...
@@ -158,7 +158,7 @@ CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& ch
return geom;
}
CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk,
in
t N)
CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk,
size_
t N)
{
ImageState img;
obtain(chunk, img.accum_alpha, N, 128);
...
...
@@ -167,7 +167,7 @@ CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk, i
return img;
}
CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chunk,
in
t P)
CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chunk,
size_
t P)
{
BinningState binning;
obtain(chunk, binning.point_list, P, 128);
...
...
@@ -185,9 +185,9 @@ CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chun
// Forward rendering procedure for differentiable rasterization
// of Gaussians.
int CudaRasterizer::Rasterizer::forward(
std::function<char*
(in
t)> geometryBuffer,
std::function<char* (
in
t)> binningBuffer,
std::function<char* (
in
t)> imageBuffer,
std::function<char*
(size_
t)> geometryBuffer,
std::function<char* (
size_
t)> binningBuffer,
std::function<char* (
size_
t)> imageBuffer,
const int P, int D, int M,
const float* background,
const int width, int height,
...
...
@@ -210,7 +210,7 @@ int CudaRasterizer::Rasterizer::forward(
const float focal_y = height / (2.0f * tan_fovy);
const float focal_x = width / (2.0f * tan_fovx);
in
t chunk_size = required<GeometryState>(P);
size_
t chunk_size = required<GeometryState>(P);
char* chunkptr = geometryBuffer(chunk_size);
GeometryState geomState = GeometryState::fromChunk(chunkptr, P);
...
...
cuda_rasterizer/rasterizer_impl.h
View file @
681c0f9e
...
...
@@ -29,7 +29,7 @@ namespace CudaRasterizer
uint32_t
*
point_offsets
;
uint32_t
*
tiles_touched
;
static
GeometryState
fromChunk
(
char
*&
chunk
,
in
t
P
);
static
GeometryState
fromChunk
(
char
*&
chunk
,
size_
t
P
);
};
struct
ImageState
...
...
@@ -38,7 +38,7 @@ namespace CudaRasterizer
uint32_t
*
n_contrib
;
float
*
accum_alpha
;
static
ImageState
fromChunk
(
char
*&
chunk
,
in
t
N
);
static
ImageState
fromChunk
(
char
*&
chunk
,
size_
t
N
);
};
struct
BinningState
...
...
@@ -50,14 +50,14 @@ namespace CudaRasterizer
uint32_t
*
point_list
;
char
*
list_sorting_space
;
static
BinningState
fromChunk
(
char
*&
chunk
,
in
t
P
);
static
BinningState
fromChunk
(
char
*&
chunk
,
size_
t
P
);
};
template
<
typename
T
>
int
required
(
in
t
P
)
size_t
required
(
size_
t
P
)
{
char
*
size
=
nullptr
;
T
::
fromChunk
(
size
,
P
);
return
((
in
t
)
size
)
+
128
;
return
((
size_
t
)
size
)
+
128
;
}
};
\ No newline at end of file
rasterize_points.cu
View file @
681c0f9e
...
...
@@ -15,9 +15,9 @@
#include <string>
#include <functional>
std::function<char*(
in
t N)> resizeFunctional(torch::Tensor& t) {
auto lambda = [&t](
in
t N) {
t.resize_({N});
std::function<char*(
size_
t N)> resizeFunctional(torch::Tensor& t) {
auto lambda = [&t](
size_
t N) {
t.resize_({
(long long)
N});
return reinterpret_cast<char*>(t.contiguous().data_ptr());
};
return lambda;
...
...
@@ -64,9 +64,9 @@ RasterizeGaussiansCUDA(
torch::Tensor geomBuffer = torch::empty({0}, options.device(device));
torch::Tensor binningBuffer = torch::empty({0}, options.device(device));
torch::Tensor imgBuffer = torch::empty({0}, options.device(device));
std::function<char*(
in
t)> geomFunc = resizeFunctional(geomBuffer);
std::function<char*(
in
t)> binningFunc = resizeFunctional(binningBuffer);
std::function<char*(
in
t)> imgFunc = resizeFunctional(imgBuffer);
std::function<char*(
size_
t)> geomFunc = resizeFunctional(geomBuffer);
std::function<char*(
size_
t)> binningFunc = resizeFunctional(binningBuffer);
std::function<char*(
size_
t)> imgFunc = resizeFunctional(imgBuffer);
int rendered = 0;
if(P != 0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment