{"id":17127596,"url":"https://github.com/cmazakas/cuda-stuff","last_synced_at":"2025-03-24T04:17:33.299Z","repository":{"id":80344144,"uuid":"59968786","full_name":"cmazakas/cuda-stuff","owner":"cmazakas","description":"A CUDA-based playground","archived":false,"fork":false,"pushed_at":"2018-01-09T05:07:27.000Z","size":9053,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T10:18:25.620Z","etag":null,"topics":["cmake","cuda","delaunay-triangulation","vscode"],"latest_commit_sha":null,"homepage":null,"language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cmazakas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-29T23:50:22.000Z","updated_at":"2017-10-14T18:39:46.000Z","dependencies_parsed_at":"2023-06-06T00:00:25.525Z","dependency_job_id":null,"html_url":"https://github.com/cmazakas/cuda-stuff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmazakas%2Fcuda-stuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmazakas%2Fcuda-stuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmazakas%2Fcuda-stuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cmazakas%2Fcuda-stuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cmazakas","download_url":"https://codeload.github.com/cmazakas/cuda-stuff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245206837,"owners_count":20577583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cmake","cuda","delaunay-triangulation","vscode"],"created_at":"2024-10-14T19:04:58.058Z","updated_at":"2025-03-24T04:17:33.276Z","avatar_url":"https://github.com/cmazakas.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA Stuff\n\nThis is a much better attempt at degenerate [Delaunay](https://en.wikipedia.org/wiki/Delaunay_triangulation) on the GPU.\n\nI'm currently taking a sledge hammer to the project so it'll be unusable\nfor quite some time.\n\nCurrently, the build process is Windows-centric (all the various `.bat` files) but\nthey should be readily convertible to Bash scripts as well.\n\n## Introduction\n\nTetrahedral meshing has many uses, most of which are in the realm of physics and engineering where they can be used to accurately represent solids or fluid flows.\n\nThey can also be used to generate images and can be refined to exhibit desirable properties like spatial proximity.\n\nDelaunay refinement is an overall goal of the project but first the goal is a working tetrahedralization routine.\n\n## Algorithm\n\nA summary of the algorithm is as follows:\n\n### Preliminaries\n\n1. Store all points and tetrahedra in linear buffers\n\n   Points are simple `{x, y, z}` types and tetrahedra are\n   a collection of 4 vertices, each vertex representing an index into the point buffer.\n\n1. Use incremental construction\n\n   Points are inserted into the current mesh, fracturing\n   individual tetrahedra into a set of children\n\n   What makes this project unique is how the insertion\n   algorithm handles the case where a point is on the edge\n   or face of a tetrahedron. We handle this case directly\n   in the insertion routine which adds notable complexity\n   but eschews the usage of perturbative schemes found in\n   the Simulation of Simplicity.\n\n1. Represent uninserted points using 3 arrays:\n   1. `pa`, point associations (which point in point buffer)\n   2. `ta`, tetrahedral assocation (which tetrahedon in mesh)\n   3. `la`, location association (how is the point `p`\n   spatially related to the tetrahedron `t`)\n\n### Pipeline for Triangulation\n\n1. Nominate points for insertion (nomination of points is constrained by how many points share tetrahedra)\n3. Insert all nominated points and write new tetrahedra to the mesh buffer\n4. Calculate new assocation relations for all points effected by the round of insertion\n\nA full pipeline example can be found in the `redistribute_pts_test.cu` test file. It contains several intermediate routines and allocations that would detract from the overall explanation of the algorithm.\n\n### Immediate TODOs\n\n* Add Delaunay refinement\n* Use arbitrary-precision orienation/insphere routines\n\n## Project Dependencies\n\nThis project requires CUDA 9.0 and above. It also relies on the\n[Catch testing framework](https://github.com/philsquared/Catch)\nand [CMake](https://cmake.org/) 3.8 or higher.\n\n### Building and Testing on Windows\n\nFor Windows, the only sane way of dealing with building CUDA is the [Ninja](https://ninja-build.org/) build tool\nso you will need to download and install that as well. The reasons for this are, MSBuild doesn't extend well to the CUDA ecosystem (no parallel building, interface libs in CMake break header dependencies).\n\nYou can customize some of the top level parameters in the `vars.bat` file to control\nthe CMake build process (configuration type, build directory, toolchain file location).\nWe recommend that you use [vcpkg](https://github.com/Microsoft/vcpkg) for your Windows\ndevelopment as it easily manages packages and generates a usable `CMAKE_TOOLCHAIN_FILE`.\n\nWorking with the code should be fairly simple. Open up an instance of the Developer Command\nPrompt for VS2015 and you can use `...\\cuda-stuff\u003eclean \u0026\u0026 build \u0026\u0026 test` to either purge\nthe currently built instance of the project, build the project or run the generated test binary\nthrough `cuda-memcheck`.\n\n### VSCode and CMake Tools Support\n\nI couldn't get Visual Studio 2017 to manage CUDA and CMake all at the same time so\nI fell back to VSCode and installed the CMake Tools extension by vector-of-bool.\n\nWe can have the IDE mirror our normal CLI build process by updating our `./.vscode/settings.json`\nwith:\n```\n    \"cmake.configureSettings\": {\n        \"CMAKE_TOOLCHAIN_FILE\": \"/vcpkg/scripts/buildsystems/vcpkg.cmake\"\n    },\n    \"cmake.buildDirectory\": \"${workspaceRoot}/build_${buildType}\",\n    \"cmake.generator\": \"Ninja\",\n    \"cmake.environment\": {\n        \"CC\": \"cl\",\n        \"CXX\": \"cl\"\n    }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmazakas%2Fcuda-stuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcmazakas%2Fcuda-stuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcmazakas%2Fcuda-stuff/lists"}