You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+84-44Lines changed: 84 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@
13
13
*[**Structures**](#structures)
14
14
*[**Computation**](#computation)
15
15
*[**Viewer**](#viewer)
16
+
*[**Matrices and Vectors**](#matrices-and-vectors)
16
17
-[**Replicability**](#replicability)
17
18
-[**Bibtex**](#bibtex)
18
19
@@ -25,16 +26,23 @@ RXMesh is a surface triangle mesh data structure and programming model for proce
25
26
26
27
-*[RXMesh: A High-performance Mesh Data Structure and Programming Model on the GPU [S41051]](https://www.nvidia.com/gtc/session-catalog/?tab.scheduledorondemand=1583520458947001NJiE&search=rxmesh#/session/1633891051385001Q9SE)—NVIDIA GTC 2022*
27
28
28
-
This repository provides 1) source code to reproduce the results presented in the paper (git tag [`v0.1.0`](https://github.com/owensgroup/RXMesh/tree/v0.1.0)) and 2) ongoing development of RXMesh. For 1), all input models used in the paper can be found [here](https://ucdavis365-my.sharepoint.com/:f:/g/personal/ahmahmoud_ucdavis_edu/En-vEpIdSGBHqvCIa-MVXRQBg5g7GfM3P3RwZBHL4Hby3w?e=2EVnJd). Models were collected from [Thingi10K](https://ten-thousand-models.appspot.com/) and [Smithsonian 3D](https://3d.si.edu/explore) repository.
29
+
The library also features a sparse and dense matrix infrastructure that is tightly coupled with the mesh data structure. We expose various [cuSolver](https://docs.nvidia.com/cuda/cusolver/index.html), [cuSparse](https://docs.nvidia.com/cuda/cusparse/), and [cuBlas](https://docs.nvidia.com/cuda/cublas/) operations through the sparse and dense matrices, tailored for geometry processing applications.
30
+
31
+
This repository provides 1) source code to reproduce the results presented in the paper (git tag [`v0.1.0`](https://github.com/owensgroup/RXMesh/tree/v0.1.0)) and 2) ongoing development of RXMesh.
29
32
30
33
## **Compilation**
31
-
The code can be compiled on Ubuntu (GCC 9) and Windows (Visual Studio 2019) providing that CUDA (>=11.1.0) is installed. To run the executable(s), an NVIDIA GPU should be installed on the machine.
34
+
The code can be compiled on Ubuntu, Windows, and WSL providing that CUDA (>=11.1.0) is installed. To run the executable(s), an NVIDIA GPU should be installed on the machine.
32
35
33
36
### **Dependencies**
34
37
-[OpenMesh](https://www.graphics.rwth-aachen.de:9000/OpenMesh/OpenMesh) to verify the applications against reference CPU implementation
35
38
-[RapidJson](https://github.com/Tencent/rapidjson) to report the results in JSON file(s)
36
39
-[GoogleTest](https://github.com/google/googletest) for unit tests
37
40
-[spdlog](https://github.com/gabime/spdlog) for logging
41
+
-[glm](https://github.com/g-truc/glm.git) for small vectors and matrices operations
42
+
-[Eigen](https://gitlab.com/libeigen/eigen) for small vectors and matrices operations
43
+
-[Polyscope ](https://github.com/nmwsharp/polyscope) for visualization
44
+
-[cereal](https://github.com/USCiLab/cereal.git) for serialization
45
+
38
46
39
47
All the dependencies are installed automatically! To compile the code:
40
48
@@ -109,7 +117,7 @@ The goal of defining a programming model is to make it easy to write applicatio
109
117
vertex_color(vh, 2) = 0.6;
110
118
```
111
119
112
-
-**Iterators** are used during query operations to iterate over the output of the query operation. The type of iterator defines the type of mesh element iterated on e.g., `VertexIterator` iterates over vertices which is the output of `VV`, `EV`, or `FV` query operations. Since query operations are only supported on the device, iterators can be only used inside the kernel. Iterators are usually populated internally.
120
+
-**Iterators** are used during query operations to iterate over the output of the query operation. The type of iterator defines the type of mesh element iterated on e.g., `VertexIterator` iterates over vertices which is the output of `VV`, `EV`, or `FV` query operations. Since query operations are only supported on the device, iterators can be only used inside the GPU kernel. Iterators are usually populated internally.
113
121
114
122
- Example: Iterating over faces
115
123
```c++
@@ -140,7 +148,7 @@ The goal of defining a programming model is to make it easy to write applicatio
140
148
vertex_color(vh, 2) = 0.9;
141
149
});
142
150
```
143
-
Alternatively, `for_each` operations could be written the same way as Queries operations (see below) using `for_each_dispatcher()`. This might be useful if the user would like to combine a `for_each` with queries operations in the same kernel. For more examples, checkout [`ForEach`](/tests/RXMesh_test/test_for_each.cuh) unit test.
151
+
Alternatively, `for_each` operations could be written the same way as Queries operations (see below). This might be useful if the user would like to combine a `for_each` with queries operations in the same kernel. For more examples, checkout [`ForEach`](/tests/RXMesh_test/test_for_each.cuh) unit test.
144
152
145
153
-**Queries** operations supported by RXMesh with description are listed below
146
154
@@ -161,30 +169,39 @@ The goal of defining a programming model is to make it easy to write applicatio
161
169
```cpp
162
170
template<uint32_t blockSize>
163
171
__global__ voidvertex_normal (Context context){
164
-
auto compute_vn = [&](FaceHandle face_id, VertexIterator& fv) {
172
+
auto compute_vn = [&](const FaceHandle face_id, const VertexIterator& fv) {
To save computation, `query_block_dispatcher` could be run on a subset of the input mesh element i.e., _active set_. The user can define the active set using a lambda function that returns true if the input mesh element is in the active set.
204
+
To save computation, `query.dispatch` could be run on a subset of the input mesh element i.e., _active set_. The user can define the active set using a lambda function that returns true if the input mesh element is in the active set.
188
205
189
206
- Example: defining active set
190
207
```cpp
@@ -194,11 +211,11 @@ The goal of defining a programming model is to make it easy to write applicatio
194
211
// ....
195
212
};
196
213
197
-
auto computation = [&](FaceHandle face_id, VertexIterator& fv) {
214
+
auto computation = [&](const FaceHandle face_id, const VertexIterator& fv) {
@@ -242,13 +259,10 @@ Starting v0.2.1, RXMesh integrates [Polyscope](https://polyscope.run) as a mesh
242
259
> cd build
243
260
> cmake -DUSE_POLYSCOPE=True ../
244
261
```
245
-
By default, the parameter is set to True on Windows and False on Linux machines. RXMesh implements the necessary functionalities to pass attributes to Polyscope—thanks to its [data adaptors](https://polyscope.run/data_adaptors/). However, this needs attributes to be moved to the host first before passing it to Polyscope. For more information about Polyscope's different visualization options, please checkout Polyscope's [Surface Mesh documentation](https://polyscope.run/structures/surface_mesh/basics/).
262
+
By default, the parameter is set to True. RXMesh implements the necessary functionalities to pass attributes to Polyscope—thanks to its [data adaptors](https://polyscope.run/data_adaptors/). However, this needs attributes to be moved to the host first before passing it to Polyscope. For more information about Polyscope's different visualization options, please checkout Polyscope's [Surface Mesh documentation](https://polyscope.run/structures/surface_mesh/basics/).
-**Large Matrices:** RXMesh has built-in support for large sparse and dense matrices built on top of [cuSparse](https://docs.nvidia.com/cuda/cusparse/) and [cuBlas](https://docs.nvidia.com/cuda/cublas/), respectively. For example, attributes can be converted to dense matrices as follows
276
292
277
-
## **Replicability**
278
-
This repo was awarded the [replicability stamp](http://www.replicabilitystamp.org#https-github-com-owensgroup-rxmesh) by the Graphics Replicability Stamp Initiative (GRSI) :tada:
293
+
```cpp
294
+
295
+
RXMeshStatic rx("input.obj");
296
+
297
+
//Input mesh coordinates as VertexAttribute
298
+
std::shared_ptr<VertexAttribute<float>> x = rx.get_input_vertex_coordinates();
299
+
300
+
//Convert the attributes to a (#vertices x 3) dense matrix
//Populate the VertexAttribute coordinates back with the content of the dense matrix
307
+
x->from_matrix(x_mat.get());
286
308
287
-
Each script should be run from the script's containing directory after compiling the code in the `build/` directory. The only input parameter needed is the path to the input OBJ files. The resulting JSON files will be written to the `output/` directory.
309
+
```
310
+
Dense matrices can be accessed using the usual row and column indices or via the mesh element handle (Vertex/Edge/FaceHandle) as a row index. This allows for easy access to the correct row associated with a specific vertex, edge, or face. Dense matrices support various operations such as absolute sum, AXPY, dot products, norm2, scaling, and swapping.
311
+
312
+
RXMesh supports sparse matrices, where the sparsity pattern matches the query operations. For example, it is often necessary to build a sparse matrix of size #V x #V with non-zero values at (i, j) only if the vertex corresponding to row i is connected by an edge to the vertex corresponding to column j. Currently, we only support the VV sparsity pattern, but we are working on expanding to all other types of queries.
313
+
314
+
The sparse matrix can be used to solve a linear system via Cholesky, LU, or QR factorization (relying on [cuSolver](https://docs.nvidia.com/cuda/cusolver/index.html))). The solver offers two APIs. The high-level API reorders the input sparse matrix (to reduce non-zero fill-in after matrix factorization) and allocates the additional memory needed to solve the system. Repeated calls to this API will reorder the matrix and allocate/deallocate the temporary memory with each call. For scenarios where the matrix remains unchanged but multiple right-hand sides need to be solved, users can utilize the low-level API, which splits the solve method into pre_solve() and solve(). The former reorders the matrix and allocates temporary memory only once. The low-level API is currently only supported for Cholesky-based factorization. Check out the MCF application for an example of how to set up and use the solver.
315
+
316
+
Similar to dense matrices, sparse matrices also support accessing the matrix using the VertexHandle and multiplication by dense matrices.
317
+
318
+
- **Small Matrices:**
319
+
It is often necessary to perform operations on small matrices as part of geometry processing applications, such as computing the SVD of a 3x3 matrix or normalizing a 1x3 vector. For this purpose, RXMesh attributes can be converted into glm or Eigen matrices, as demonstrated in the vertex_normal example above. Both glm and Eigen support small matrix operations inside the GPU kernel.
320
+
321
+
322
+
323
+
## **Replicability**
324
+
This repo was awarded the [replicability stamp](http://www.replicabilitystamp.org#https-github-com-owensgroup-rxmesh) by the Graphics Replicability Stamp Initiative (GRSI) :tada:. Visit git tag [`v0.1.0`](https://github.com/owensgroup/RXMesh/tree/v0.1.0) for more information about replicability scripts.
288
325
289
326
## **Bibtex**
290
327
```
291
328
@article{Mahmoud:2021:RAG,
292
-
author = {Mahmoud, Ahmed H. and Porumbescu, Serban D. and Owens, John D.},
0 commit comments