Compare commits

..
Author SHA1 Message Date
Jonathan Swartz 2563cd3118 Attempting to fix secretes manager access error
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 10:35:02 +12:00
Jonathan Swartz 0510e49968 Improving buildspec logging
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 10:23:53 +12:00
Jonathan Swartz 1363171185 Build fixes and printing URLs for monitoring
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 10:18:03 +12:00
Jonathan Swartz 5cfdc69063 Trying to retrieve codebuild log info
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 09:52:32 +12:00
Jonathan Swartz 9e0d18504b Better testing
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 09:31:01 +12:00
Jonathan Swartz 3f1a6c851c Fix condition
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 09:28:46 +12:00
Jonathan Swartz 16ce308e76 Print if credentialas are configured
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 09:27:07 +12:00
Jonathan Swartz de4c6c89f7 Attempting to set permissions
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-25 09:23:33 +12:00
Jonathan Swartz 2ad5811297 Switch back to v4 because credentials action requires later version
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-19 10:34:47 +12:00
Jonathan Swartz 705e6d79c5 Merge remote-tracking branch 'origin/feature/fvdb' into fvdb_codebuild
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-19 10:32:56 +12:00
Jonathan Swartz af0fc1e7ec Merge remote-tracking branch 'origin/feature/fvdb' into fvdb_codebuild
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-19 10:30:08 +12:00
Jonathan Swartz 46d8f3c26c Change configure-aws-credentials action version to test
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-19 10:26:29 +12:00
Jonathan Swartz 3fad26296f Merge pull request #2052 from swahtz/feature/fvdb
Update feature/fvdb
2025-06-17 11:34:07 +12:00
Jonathan Swartz a41e9319aa Merge remote-tracking branch 'downstream/feature/fvdb' into feature/fvdb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-17 11:32:37 +12:00
Jonathan SwartzandMark Harris 1563730c0a GaussianRasterizeForward shared memory calculation fix (#539)
* Fix for shared memory calculation to account for Gaussian2D alignment

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Mark Harris <mharris@nvidia.com>
2025-06-17 11:27:07 +12:00
Andrew 6fd95083d4 Unify editor shaders. 2025-06-16 10:10:18 -05:00
Petra Hapalova 3cc26291ca NanoVDB editor - track shader includes changes (#540)
* track shader includes changes
* clear shader cache button
2025-06-16 14:13:24 +00:00
Petra HapalovaandAndrew Reidmeyer 9f08f33fe6 Merge NanoVDB editor into fVDB (#534)
* adding NanoVDB Editor
---------

Co-authored-by: Andrew Reidmeyer <areidmeyer@nvidia.com>
2025-06-13 22:32:43 +02:00
Jonathan Swartz 0741614991 Merge pull request #2050 from swahtz/feature/fvdb
feature/fvdb update
2025-06-13 18:01:58 +12:00
Jonathan Swartz 0de6bf111a Merge remote-tracking branch 'downstream/feature/fvdb' into feature/fvdb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-13 17:57:56 +12:00
Jonathan Swartz 216ef435fc Improve launch_bounds coverage (#530)
* Improve launch_bounds coverage everywhere there's an easily inferred number of threads
* Add a global DEFAULT_NUM_THREADS_PER_BLOCK and made sure all kernels use GET_BLOCKS

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-13 17:54:36 +12:00
Jonathan Swartz 07a099136c Fix an issue where the PCA performed by the ColmapDataset in 3dgs was non-deterministic when using numpy built with OpenBLAS. Substitute for MKL blas. (#531)
Fix README error

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-12 16:55:30 +12:00
Jonathan Swartz 504fa0fcdf Added up_axis controls to 3dgs Viser viewer (#532)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-12 16:55:21 +12:00
Matthew Cong 3a260e0374 Remove compile_commands.json symlink and add to .gitignore (#520)
* Remove compile_commands.json
* Add compile_commands.json symlink to .gitignore

Signed-off-by: Mark Harris mharris@nvidia.com
2025-06-11 10:40:59 +10:00
Mark Harris 4963380b23 Store image dims in input data sets, use in gtests (#518)
Adds image dims to the test data generation for forward gsplat rasterization. uses this in gtests. Adds a new script for inspecting generated datasets. Updates test data commit hash in cmake.

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-11 10:36:33 +10:00
Jonathan Swartz 8ad3e9ba75 Add camera images to gsplat viser viewer (#514)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-10 19:15:19 +12:00
Mark Harris 8ce1fca72e Add debug build option to build.sh (#515)
* build.sh: add debug build option

* Auto update compile_commands.json symlink
2025-06-10 19:03:59 +12:00
Mark Harris d871dc46d3 Move implementation of tensor loading utilities to .cpp file, inline other utilities in headers. (#516)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-10 19:01:08 +12:00
Mark Harris 9e3b691e2a Seaube clang-format extension requries env.VAR rather than env:VAR (#517)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-10 18:58:00 +12:00
Matthew Cong 74581cdc6b Use PIMPL idiom for GridBatch/GridBatchImpl (#513)
* WIP: Use PIMPL idiom for GridBatch/GridBatchImpl

* Expose remaining sparse conv functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove variants of GridBatch::to(...)

* Remove address()

* Refactor Python bindings

* Restore address

* Remove implementations from header files

* Clean up API more

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-06-09 16:09:19 -07:00
Matthew Cong 9c537c776e Remove unused RAIIDeviceBuffer includes (#511) 2025-06-05 08:45:28 -07:00
Matthew Cong 938e02b5d6 Remove RAIIDeviceGuard (#510) 2025-06-05 08:45:19 -07:00
Matthew Cong d51a25714f Remove NanoVDBFileGridIdentifier union type (#505)
* Remove NanoVDBFileGridIdentifier from Python API

* Format

* Remove NanoVDBFileGridIdentifier from C++ API

* Expose parseDeviceString

* Centralize device string overloads to Python bindings
2025-06-05 07:01:16 -04:00
Mark Harris 24aa6d706b Use unique_ptr in RAIIDeviceGuard (#509)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-05 06:55:17 -04:00
Jonathan Swartz 010cbd9b5c Merge pull request #2049 from swahtz/feature/fvdb
feature/fvdb update
2025-06-05 21:44:57 +12:00
Mark Harris d6b2f243d3 Use Seaube.clangFormat vscode extension for clang-format (#508)
We have been getting intermittent crashes of clangd, and since we have been using the clang-format that is built into the clangd server, when clangd crashes we lose the format-on-save capability of vscode for C++ and CUDA C++ files.

This PR adds settings and recommendation for the vscode extension Seaube.clangFormat which allows specifying a clang-format executable to be used for formatting C++ and CUDA C++ files. This is a fork of the more widely used xaver.clang-format vscode extension because the latter has not released an update in years, in spite of having merged NVIDIA pull requests to support the cuda-cpp language.

After merging, you will need to make sure to install the vscode extension Seaube.clangFormat. VSCode will prompt to install it.

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-05 18:13:48 +12:00
Matthew Cong 32aac9e6e4 Remove JaggedTensorIndex union type (#503)
* Remove JaggedTensorIndex union type

* Fix error type

* Fix error type again

* Restore accidentally commented import
2025-06-04 21:58:27 -07:00
Mark Harris 7e0e66645d Add verbose option to build.sh, use it in CI workflow, add build.sh help (#507)
Add `verbose` option to build.sh and use it in CI.  Add -h/--help
---------
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-05 12:42:11 +10:00
Francis Williams 6221f03a83 Move voxel size and bounding box functions into GridBatchImpl (#500)
* more gridbatch slimming

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more slimming

Signed-off-by: Francis Williams <francis@fwilliams.info>

* even more slimming

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more deviceguard cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more deviceguard

Signed-off-by: Francis Williams <francis@fwilliams.info>

* naming convention

Signed-off-by: Francis Williams <francis@fwilliams.info>

* address more comments

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more thinning

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more lean, and commetns

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-06-04 21:10:44 -04:00
Jonathan Swartz 64ceb23374 Merge remote-tracking branch 'downstream/feature/fvdb' into feature/fvdb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-06-05 11:18:44 +12:00
Mark Harris ca9ff4a4ee Add CUDA attribute formatting and kernel launch bounds improvements (#498)
* Add AttributeMacros to .clang-format for CUDA attributes

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Reformat source for CUDA attributes, add launch bounds to some 3DGS kernels

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Update script for running clang-format

Signed-off-by: Mark Harris <mharris@nvidia.com>

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-04 13:06:48 -04:00
Matthew Cong 278a3ae8c9 Remove unused definitions which have moved into GridBatchImpl (#502) 2025-06-04 13:06:17 -04:00
Matthew Cong c95e422243 Remove Tensor -> JaggedTensor typecaster in favor of implicit conversion (#501) 2025-06-04 13:06:07 -04:00
Eftychios Sifakis 3d36ec7e99 Added grid merging functionality to fVDB (#494)
* Initial steps for grid merging routine

* cleanup and completion of root node merge

* completed enumeration of nodes on merge operation

* finished MergeGrids operation; cleanup

* Exposed MergeGrids in fVDB

* formatting fixes

* formatting fixes

* formatting fixes
2025-06-04 10:13:38 -04:00
Mark Harris 64c8d65333 Fix spherical harmonic tensor shapes in test data generation script (#497)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-04 15:08:00 +12:00
Mark Harris bb8dda8987 Update VSCode settings for CUDA support and clean up C++ file associations (#496)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-06-04 13:57:58 +12:00
Matthew Cong bdc38eb961 Cleanup unneeded includes (#495) 2025-06-03 11:06:45 -07:00
Christopher Horvath 6ab2ed501a fvdb source location restructure (#490)
Refactor: move of fvdb library sources to src/fvdb, update includes and .clang-format rules.

---------

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
2025-06-03 15:11:51 +10:00
Francis Williams 624b227afa Move more grid building functions from GridBatch into detail (#477)
* build grid

Signed-off-by: Francis Williams <francis@fwilliams.info>

* unskip test

Signed-off-by: Francis Williams <francis@fwilliams.info>

* check device for optionals

Signed-off-by: Francis Williams <francis@fwilliams.info>

* pull out grid building code into seperate module

Signed-off-by: Francis Williams <francis@fwilliams.info>

* cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more migration

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* another one

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* move to GridBatchImpl

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clang fmt

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm write accessor

Signed-off-by: Francis Williams <francis@fwilliams.info>

* need writeaccessor

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

* update

Signed-off-by: Francis Williams <francis@fwilliams.info>

* cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* move to static

Signed-off-by: Francis Williams <francis@fwilliams.info>

* typo

Signed-off-by: Francis Williams <francis@fwilliams.info>

* typo 2

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rename

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rename

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rename

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-06-02 19:18:06 +00:00
Matthew Cong 533cf4c20e Restore mGPU support for createGridFromPoints/IJK (#489) 2025-06-02 12:07:26 -07:00
Matthew Cong 22de0d9aca Fix build error (#488) 2025-05-30 21:06:34 -04:00
zlalena 384198f3ee Gaussian Splatting Camera Pose Optimization with multiGPU (#422) 2025-05-30 20:18:18 -04:00
Matthew Cong 4213aa354a Re-enable warning as errors (#484)
* Fix class-memaccess warning in CreateNanoGrid.h

* Revert "comment out Werr (#464)"

This reverts commit c760c1ccbe.
2025-05-30 17:57:58 -04:00
Francis Williams f4ef228672 re-enable test (#486)
Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-30 21:19:16 +00:00
Francis Williams 5b011d23c4 Move grid building logic and error checking out of GridBatch into detail (#476)
* build grid

Signed-off-by: Francis Williams <francis@fwilliams.info>

* unskip test

Signed-off-by: Francis Williams <francis@fwilliams.info>

* check device for optionals

Signed-off-by: Francis Williams <francis@fwilliams.info>

* pull out grid building code into seperate module

Signed-off-by: Francis Williams <francis@fwilliams.info>

* cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

Signed-off-by: Francis Williams <francis@fwilliams.info>

* move to GridBatchImpl

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clang fmt

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm write accessor

Signed-off-by: Francis Williams <francis@fwilliams.info>

* need writeaccessor

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

* skip test again

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-30 21:12:48 +00:00
Matthew Cong 05b2bf6f11 Fix one more warning (#481) 2025-05-29 21:51:40 -07:00
Matthew Cong cde4160d42 Fix newly introduced warnings in fVDB (#480) 2025-05-29 16:50:19 -07:00
Matthew Cong 1b29548661 Add initial support for Unified Memory backend (#460)
* Add initial support for Unified Memory

* Add MGPU support for transform points

* Cleanup

* Add guard for CUDA version

* Add cudamanaged support for JOffsetsFromJIdx and PointsInGrid

* Fixes for signed/unsigned warnings

* Rename for consistency

* Remove hardcoded launch bounds

* Internalize numThreads to forEach kernels

* Rename macro to explicitly call out backends

* Clean up signed/unsigned indexing and reduce default block size

* Clean up macro

* Format code

* Remove unnecessary includes

* Address some review comments

* Fix helper function and formatting

* Encapsulate allocation logic
2025-05-29 15:11:43 -07:00
Francis Williams a414cef4c5 Don't use verbosity 1 in dilation and restore dilation in ray marching tests (#475)
* small clangd fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

* Don't use verbosity 1 in dilation and restore previously crashing dilation in test_ray_marching.py

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-29 14:17:52 +00:00
Francis Williams 55d80ce33d small clangd fix (#474)
Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-29 14:11:17 +00:00
Eftychios Sifakis 87ce3b6c71 Adding support for dilation operations that generate new root nodes (#473)
* Bugfix: consistent passing of stream parameter & synchronization

* using cub::WarpReduce instead of sm80 intrinsic

* replacing sm80+ intrinsic with cub::WarpReduce

* Supporting dilation scenarios that create new root nodes
2025-05-29 09:32:33 -04:00
Francis WilliamsandMatthew Cong c875c46a20 Remove mutable grids from internal API (#462)
* grid dilation in fVDB

Signed-off-by: Francis Williams <francis@fwilliams.info>

* SPDX

Signed-off-by: Francis Williams <francis@fwilliams.info>

* start removing pad args

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm mutable grids from public API

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more nuking

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix comments

Signed-off-by: Francis Williams <francis@fwilliams.info>

* Fix CI failures due to dilation (#454)

* Remove unneeded atomic include (#451)

* Add minor cleanup (#452)

* move dilate to ops

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more mutable reference removal

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fine from coarse

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* mas cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm all of build directory

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clean up build kernels

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

* checkpoint

* rm prints

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm macros

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm custom accessors

Signed-off-by: Francis Williams <francis@fwilliams.info>

* comment out Werr

* clang format

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clang format after downgrade to 18

Signed-off-by: Francis Williams <francis@fwilliams.info>

* small fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

* use OnIndexGrid instead of NanoGrid<...>

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
Co-authored-by: Matthew Cong <1372750+matthewdcong@users.noreply.github.com>
2025-05-29 09:29:45 -04:00
Francis Williams 88b69a968b Remove allocate/free functions from GridBatchImpl header (#471)
* clean up header

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm if

Signed-off-by: Francis Williams <francis@fwilliams.info>

* herp derp

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-28 20:15:56 -07:00
Matthew Cong 782c0c403e Merge pull request #470 from matthewdcong/develop_fvdb_merge
Merge latest develop into feature/fvdb
2025-05-28 09:52:06 -07:00
Francis WilliamsandMatthew Cong 8162fb42fe Remove mutable grids from public API (#461)
* grid dilation in fVDB

Signed-off-by: Francis Williams <francis@fwilliams.info>

* SPDX

Signed-off-by: Francis Williams <francis@fwilliams.info>

* start removing pad args

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm mutable grids from public API

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more nuking

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix comments

Signed-off-by: Francis Williams <francis@fwilliams.info>

* Fix CI failures due to dilation (#454)

* Remove unneeded atomic include (#451)

* Add minor cleanup (#452)

* move dilate to ops

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more mutable reference removal

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fine from coarse

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* mas cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* more cleanup

Signed-off-by: Francis Williams <francis@fwilliams.info>

* rm all of build directory

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clean up build kernels

Signed-off-by: Francis Williams <francis@fwilliams.info>

* include guards

* comment out Werr

* fix clangd crash

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix tests for now

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
Co-authored-by: Matthew Cong <1372750+matthewdcong@users.noreply.github.com>
2025-05-28 12:40:05 -04:00
Matthew Cong d1b970b688 Merge branch 'develop' into develop_fvdb_merge 2025-05-28 08:18:17 -07:00
Francis Williams 38c078a773 Fix clangd crash in GridBatchImpl (#469)
* fix clangd crash

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-28 14:44:28 +00:00
Matthew Cong d02dc930f0 Fixes for signed/unsigned warnings (#465) 2025-05-27 16:05:03 -07:00
Francis Williams c760c1ccbe comment out Werr (#464) 2025-05-27 12:40:04 -07:00
Mark Harris 07993354a7 Warnings are Errors (#437)
This PR fixes all current warnings in fVDB. The goal is that by default, the build should only print messages when there is something wrong. It is quiet by default and there are no warnings.

 -  Fixes existing warnings that occur without -Wall
 - Fixes additional (many more) warnings that occur with -Wall. Mostly signed/unsigned comparisons and unused variables.
 - Enables -Wall -Werror for CXX options
 - Enables -Werror=all-warnings -XCompiler=-Wall,-Werror for CUDA options.
 - Disables a bunch of #pragma message output by default
 - Makes the build quiet by default rather than verbose.

Once this is merged, compilation will fail if there are any warnings.

To do a verbose build now, add -v for verbose pip output, and -C build.verbose=true for verbose CMake output (print every compilation command line).

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-05-27 13:08:53 +10:00
Eftychios Sifakis f5b68239b1 Bug fixes in DilateGrid (#458)
* Bugfix: consistent passing of stream parameter & synchronization

* using cub::WarpReduce instead of sm80 intrinsic

* replacing sm80+ intrinsic with cub::WarpReduce
2025-05-23 17:18:44 -04:00
Matthew Cong 712839bed5 Move tensorBytePointer into GaussianSplatting TU (#459) 2025-05-23 11:05:41 -07:00
Matthew Cong 8fb305aa28 Add minor cleanup (#452) 2025-05-23 09:47:22 -04:00
Matthew Cong 49ca5c2a7a Remove unneeded atomic include (#451) 2025-05-23 09:46:55 -04:00
Matthew Cong 7b0f8bf685 Fix CI failures due to dilation (#454) 2025-05-22 22:47:52 -07:00
Francis Williams 2009f7da08 Integrate new dilation into fvdb GridBatch (#447)
* grid dilation in fVDB

Signed-off-by: Francis Williams <francis@fwilliams.info>

* SPDX

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-22 14:03:15 -04:00
Mark Harris d6a68d1ef3 Clang-format: disable bin packing and other improvements. (#434)
* Improve clang-format settings and .clang-format organization

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-05-22 14:07:22 +10:00
Eftychios Sifakis 063b4b9bee Morphological dilation in NanoVDB (#420)
This new feature provides a device-accelerated process for computing a morphological dilation of a NanoVDB IndexGrid.
3 modes of dilation are supported (see NearestNeighbors in util/MorphologyHelpers.h):
NN_FACE (6-connected); NN_FACE_EDGE (18-connected); NN_FACE_EDGE_VERTEX (26-connected).

Known limitation: As of right now (easily fixable when we have a real-world test case), the operation will proceed correctly only if the dilation operation does not create any new ROOT (4096^3) node.

An example of use can be found in examples/ex_dilate_nanovdb_cuda, which dilates an OpenVDB .vdb file, and compares the result against the NanoVDB/CUDA new implementation.
2025-05-21 14:00:26 -05:00
Mark Harris 0987d220ba Rename AccessorHelpers.h to AccessorHelpers.cuh (#436)
The file AccessorHelpers.h added in #432 is only included from .cu source files, and clangd reports problems because some of the types it uses are only defined when compiling CUDA code. So it's better to make this a CUDA header (.cuh). This PR renames it and updates all includes.

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-05-21 15:35:14 +10:00
Matthew Cong 005cd8fc48 Modularize functionality in Utils.cuh (#432)
* Separate countEnabledPerLeaf

* Separate forEachCUDA functions from Utils.cuh

* Separate out forEachCPU calls

* Separate out Accessor helper functions

* Remove PrivateUse1

* Rename
2025-05-20 08:41:26 -07:00
Matthew Cong ecbc9ff68f Replace Torch type <-> string functions with PyTorch built-ins (#429)
* Replace Torch type <-> string functions with PyTorch built-ins

* Revert "Replace Torch type <-> string functions with PyTorch built-ins"

This reverts commit 2e9e43515af924459cf48875ebd75698efecf0b9.

* Use PyTorch built-ins in later versions
2025-05-19 16:01:28 -04:00
Matthew Cong d79383c194 Separate RAII device buffer from forEach macros (#431)
* Separate RAII device buffer from forEach macros

* Fix header guard
2025-05-19 12:57:41 -07:00
Matthew Cong 66013466c3 Replace c10::optional with std::optional (#430) 2025-05-19 14:50:31 -04:00
Francis Williams c70b3dbac4 Jagged Tensor squeeze (#423) 2025-05-16 19:03:22 -04:00
Matthew Cong 6545a4b620 Cleanup accessor utility functions using std::conditional (#427) 2025-05-16 15:49:00 -07:00
Matthew Cong e8ea08db78 Fix test_gsplat formatting which is breaking CI (#428) 2025-05-16 14:47:15 -07:00
j-nordling 5a741ae46f bugfix: save nan splat (#426) 2025-05-16 17:25:01 -04:00
Francis Williams 8dba107547 Add optional stream and shared memory arguments to forEachVoxelCUDA/etc. (#416)
* streams and shared memory in forEachXXX

Signed-off-by: Francis Williams <francis@fwilliams.info>

* overload

Signed-off-by: Francis Williams <francis@fwilliams.info>

* option to call callback everytime

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-16 11:23:26 -04:00
Jonathan Swartz 9e531b0a16 Merge pull request #2045 from swahtz/fvdb_update 2025-05-15 16:28:37 +12:00
Matthew Cong c2eb7e6ce3 Switch to modern AT_DISPATCH_V2 macro (#402) 2025-05-14 15:24:53 -07:00
Matthew Cong cba1da5961 Merge pull request #406 from matthewdcong/develop_fvdb_merge
Redo develop to feature/fvdb merge to account for squashing changes
2025-05-14 10:22:05 -07:00
Matthew Cong b0b26884a1 Merge remote-tracking branch 'upstream/develop' into feature/fvdb 2025-05-14 10:19:00 -07:00
e5d9c13b5d Merge latest develop into feature/fvdb (#405)
* Merge latest master into develop (#394)

* Avoid unnecessary and expensive getLastWriteTime calls for memory mapped files on windows

Signed-off-by: jjtParadox <jturner@4nsi.com>

* Add [[nodiscard]] to confusing math functions.

Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>

* Fix missing OpenVDB dependency for NanoVDB-only build

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* improved change notes and updated version number

* improved change notes and updated version number

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* improved documentation

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Separate PointsToGrid kernel lambdas into functors

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing iomanip include for latest GTest

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* improved nanovdb_convert

* improved nanovdb_convert

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* review feedback

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix format strings and Windows conversion warning

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix ODR violation due to anonymous namespace in SignedFloodFill

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Minor fix to unit-test of NanoVDB

* Minor fix to unit-test of NanoVDB

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* minor change

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add DeviceMesh and (optional) NCCL CMake Support

* Add device mesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Restore current device in constructor and destructor

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Enable range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove uneeded accessors and modularize functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Statically initialize entry point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Encapsulate

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to lightweight wrapper class for DeviceNodes vector

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Minor changes needed for DistributedPointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add RAII DeviceGuard

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up NCCL dependency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove parallel_for to modularize

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Implement and test move constructor/assignment

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add docs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Expand test and documentation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Move non-reinit comment to function description

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Switch to using aliases and modern type names

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Use size_type instead of int for return

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Separate out DeviceGuard and clean up API

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to DeviceMesh for MGPU sparse convolution example

* Convert MGPU convolution example to use DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typos and clarify

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Check for errors and switch to for_each

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing const variant of deviceData(device)

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing inline for DeviceMesh functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing NCCL ifdef

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix invalid free in UnifiedBuffer move constructor

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Change UnifiedBuffer prefetch and advise to be const

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix missing relocatable device code flag

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix namespace for AbsDiff and RelDiff ostream overloads

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix out-of-bounds device id

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix TBB template deduction in C++20

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fixed issue in signedfloodfill

* Fixed issue in signedfloodfill

Signed-off-by: Ken <ken.museth@gmail.com>

* partially addressed review comments

Signed-off-by: Ken <ken.museth@gmail.com>

* added RootData::TileIterator

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed assert bug

Signed-off-by: Ken <ken.museth@gmail.com>

* snapshot

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed bug and improved unit-test

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit test and documentation

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix DeviceMesh.h header to be self-contained

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing constructor for C++20 used in AddBlindData.cuh

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* removed dead code and updated the minor version number

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix class-memaccess warning due to non-trivial copy-assignment in GridBlindMetaData

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* major improvements to GridBlindMetaData

* major improvements to GridBlindMetaData

Signed-off-by: Ken <ken.museth@gmail.com>

* minor changes to fix clang issue

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* minor simplification in CreateNanoGrid

* minor simplification in CreateNanoGrid

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* introducing new magic numbers for grids and files

* introducing new magic numbers for grids and files

Signed-off-by: Ken <ken.museth@gmail.com>

* removed two redundant magic numbers

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* fixed typos and improved documentation in NanoVDB

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Consolidate DeviceGuard into DeviceMesh header

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add distributed implementation of PointsToGrid

* Add distributed implementation of PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition in merge and single GPU case

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix kernel/cudaFree race conditions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add DistributedPointsToGrid unittest

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up example

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix Windows build and some warnings

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update for refactored DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix copyright/include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add parallelForEach helper

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Templatize kernels to align with CUB better

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Shorten TemporaryDevicePool to TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Refactor to use TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to class

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch in build

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition wrt to root node processing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Speed up synchronization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add comments and fix deprecated TransformInputIterator

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address review comments

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address more review comments

* Add more cudaCheck calls and restrict EqualityIndicator type

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix license identifiers and remove unused code

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* revert deprecation warning

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Silence CMake warning about FindBoost module deprecation

* Silence CMake warning about FindBoost module deprecation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typo

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failures

* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failure
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Suppress stringop-overflow warning due to GCC 11 regression

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Generalize MGPU grid construction to any power-of-two number of GPUs

* Start support for more than two GPUs in key merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Flip flop storage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Generalize concurrent leftIntervals/rightIntervals usage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix median search

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix rebalancing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix recursive MGPU merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update TODO

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add guards for zero-tile GPUs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition across different merge levels (and memory leak in corresponding tests)

* Fix memory leaks in PointsToGrid tests

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix leapfrogging across recursion levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch for different levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Feature/fix get set methods

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed issue in get/set random access methods

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* deleted white space

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add optimizations to MGPU PointsToGrid

* Add timer for MGPU PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Avoid blocking kernel launches due to cudaFree

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix overlapping of copies

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Pipeline pointsPerVoxelPrefix sum

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup and optimization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Further improve pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove unnecessary sync point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert "Remove unnecessary sync point"

This reverts commit f01b36ad852f32ec65517b3baa08ea267d5edc2d.

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to GPU sync

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event destruction race condition and reduce host thread latency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert timer add

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More fine-grained pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event wait/destruction race condition

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Improve points to grid

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* minor improvements to nanovdb::tools::cuda::PointsToGrid

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix Windows warnings

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Force set _WIN32 flag

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Move away from deprecated 20.04 runners

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>

* Templatize buffer type for distributed points to grid (#403)

* Templatize buffer type for distributed points to grid

* Add missing template parameter

* Add pool

---------

Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
2025-05-14 13:03:06 -04:00
Matthew Cong 566f6c6d6c Templatize buffer type for distributed points to grid (#403)
* Templatize buffer type for distributed points to grid

* Add missing template parameter

* Add pool
2025-05-14 08:43:45 -07:00
Mark HarrisandJonathan Swartz ff9f4a5532 Fix get_torch.cmake for pytorch packages without libtorch_python.so symlink (#404)
* Make get_torch.cmake robust to missing conda symlink
* Fix setting `nvtx3_dir` to help torch find nvtx3 installed in fvdb build

Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-05-14 20:37:48 +10:00
Mark HarrisandJonathan Swartz a06dc77fc5 Add clangd configuration for vscode (#382)
Add clangd configuration, docs and vscode settings to use it.

Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-05-14 11:29:39 +10:00
Francis Williams d196ae04ea Permute dimensions of SH coefficients to have gaussians first (#317)
* split sh into two files

move spherical harmonics autograd into its own file

small refactor

factor out jagged spherical harmonics

split jagged spherical harmonics in autograd

cleanup

cleanup

even more cleanup

remove camera dim from sh coeffs

split out shN and sh0

* more cleanup

* no more separate jagged op

* rm old jagged kernel

* don't hardcode float32

* tests

* more tests

* typo fix

* whitespace

* permute SH axes in kernel

* n first

* fix naninfmask tests

* fix merge issues

Signed-off-by: Francis Williams <francis@fwilliams.info>

* clang format

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix gsplat tests

Signed-off-by: Francis Williams <francis@fwilliams.info>

* comments

Signed-off-by: Francis Williams <francis@fwilliams.info>

* fix PR comments

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-05-12 13:16:56 -04:00
bbartlett-nv cd29610ade Multi-GPU Splat Training (#380)
* wip split script

* working split, but grows beyond target region

* first working split training

* working multi-gpu script

* refactor into sandbox

* adding dockerfile for 3dgs

* adding script to downsize colmap images

* updates after multi-gpu testing

* updates after testing

* refactor back to project and remove sandbox

* merge with upstream feature branch

* added docs more testing cleanups

* formatting / license updates

* updates to ortho script to address comments
2025-05-09 12:36:05 -04:00
380a8d698c Merge latest master into develop (#394)
* Avoid unnecessary and expensive getLastWriteTime calls for memory mapped files on windows

Signed-off-by: jjtParadox <jturner@4nsi.com>

* Add [[nodiscard]] to confusing math functions.

Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>

* Fix missing OpenVDB dependency for NanoVDB-only build

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* improved change notes and updated version number

* improved change notes and updated version number

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* improved documentation

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Separate PointsToGrid kernel lambdas into functors

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing iomanip include for latest GTest

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* improved nanovdb_convert

* improved nanovdb_convert

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* review feedback

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix format strings and Windows conversion warning

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix ODR violation due to anonymous namespace in SignedFloodFill

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Minor fix to unit-test of NanoVDB

* Minor fix to unit-test of NanoVDB

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* minor change

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add DeviceMesh and (optional) NCCL CMake Support

* Add device mesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Restore current device in constructor and destructor

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Enable range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove uneeded accessors and modularize functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Statically initialize entry point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Encapsulate

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to lightweight wrapper class for DeviceNodes vector

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Minor changes needed for DistributedPointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add RAII DeviceGuard

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up NCCL dependency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove parallel_for to modularize

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Implement and test move constructor/assignment

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add docs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Expand test and documentation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Move non-reinit comment to function description

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Switch to using aliases and modern type names

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Use size_type instead of int for return

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Separate out DeviceGuard and clean up API

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to DeviceMesh for MGPU sparse convolution example

* Convert MGPU convolution example to use DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typos and clarify

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Check for errors and switch to for_each

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing const variant of deviceData(device)

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing inline for DeviceMesh functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing NCCL ifdef

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix invalid free in UnifiedBuffer move constructor

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Change UnifiedBuffer prefetch and advise to be const

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix missing relocatable device code flag

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix namespace for AbsDiff and RelDiff ostream overloads

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix out-of-bounds device id

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix TBB template deduction in C++20

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fixed issue in signedfloodfill

* Fixed issue in signedfloodfill

Signed-off-by: Ken <ken.museth@gmail.com>

* partially addressed review comments

Signed-off-by: Ken <ken.museth@gmail.com>

* added RootData::TileIterator

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed assert bug

Signed-off-by: Ken <ken.museth@gmail.com>

* snapshot

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed bug and improved unit-test

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit test and documentation

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix DeviceMesh.h header to be self-contained

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing constructor for C++20 used in AddBlindData.cuh

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* removed dead code and updated the minor version number

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix class-memaccess warning due to non-trivial copy-assignment in GridBlindMetaData

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* major improvements to GridBlindMetaData

* major improvements to GridBlindMetaData

Signed-off-by: Ken <ken.museth@gmail.com>

* minor changes to fix clang issue

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* minor simplification in CreateNanoGrid

* minor simplification in CreateNanoGrid

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* introducing new magic numbers for grids and files

* introducing new magic numbers for grids and files

Signed-off-by: Ken <ken.museth@gmail.com>

* removed two redundant magic numbers

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* fixed typos and improved documentation in NanoVDB

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Consolidate DeviceGuard into DeviceMesh header

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add distributed implementation of PointsToGrid

* Add distributed implementation of PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition in merge and single GPU case

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix kernel/cudaFree race conditions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add DistributedPointsToGrid unittest

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up example

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix Windows build and some warnings

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update for refactored DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix copyright/include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add parallelForEach helper

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Templatize kernels to align with CUB better

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Shorten TemporaryDevicePool to TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Refactor to use TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to class

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch in build

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition wrt to root node processing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Speed up synchronization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add comments and fix deprecated TransformInputIterator

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address review comments

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address more review comments

* Add more cudaCheck calls and restrict EqualityIndicator type

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix license identifiers and remove unused code

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* revert deprecation warning

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Silence CMake warning about FindBoost module deprecation

* Silence CMake warning about FindBoost module deprecation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typo

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failures

* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failure
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Suppress stringop-overflow warning due to GCC 11 regression

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Generalize MGPU grid construction to any power-of-two number of GPUs

* Start support for more than two GPUs in key merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Flip flop storage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Generalize concurrent leftIntervals/rightIntervals usage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix median search

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix rebalancing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix recursive MGPU merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update TODO

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add guards for zero-tile GPUs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition across different merge levels (and memory leak in corresponding tests)

* Fix memory leaks in PointsToGrid tests

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix leapfrogging across recursion levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch for different levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Feature/fix get set methods

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed issue in get/set random access methods

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* deleted white space

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add optimizations to MGPU PointsToGrid

* Add timer for MGPU PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Avoid blocking kernel launches due to cudaFree

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix overlapping of copies

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Pipeline pointsPerVoxelPrefix sum

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup and optimization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Further improve pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove unnecessary sync point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert "Remove unnecessary sync point"

This reverts commit f01b36ad852f32ec65517b3baa08ea267d5edc2d.

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to GPU sync

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event destruction race condition and reduce host thread latency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert timer add

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More fine-grained pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event wait/destruction race condition

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Improve points to grid

* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* minor improvements to nanovdb::tools::cuda::PointsToGrid

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix Windows warnings

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Force set _WIN32 flag

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Move away from deprecated 20.04 runners

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: jjtParadox <jturner@4nsi.com>
Signed-off-by: Jeff Lait <jlait@andorra.sidefx.com>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Ken <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: jjtParadox <jturner@4nsi.com>
Co-authored-by: Jeff Lait <jlait@andorra.sidefx.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
2025-05-07 16:36:22 -07:00
Matthew Cong 2ba8712023 Clean up API by switching to CoordBBox (#397) 2025-05-07 16:36:05 -07:00
Mark Harris 9cec4f1934 Update the test data commit hash to the latest (#396)
* Update test data commit hash
---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-05-07 16:10:22 +12:00
Mark Harris 652b7bff97 Add multicamera rasterization test and writePNG utility (#393)
* Add new image saving test utility and create fvdb_test_utils static lib
* Add `gtests` and `benchmarks` args to build.sh
* Add multicamera rasterization test
---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-05-07 01:15:41 +00:00
Matthew Cong 34996d0f0b Revert "Replace binary search for jidx computation with nested kernels (#375)" (#392)
This reverts commit 378b08b84d.
2025-05-06 15:50:37 -07:00
Jonathan Swartz 39d2c17c89 Merge pull request #2040 from swahtz/fvdb_update
fvdb update
2025-05-01 16:16:31 +12:00
Matthew Cong dd8862cca3 Add venv docs and update build requirements file (#373) 2025-05-01 14:57:28 +12:00
Francis Williams 0d79d8d35c Rewrite colmap dataset (#388)
* rewrite colmap dataset

Signed-off-by: Francis Williams <francis@fwilliams.info>

* named args

Signed-off-by: Francis Williams <francis@fwilliams.info>

---------

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-04-30 17:25:33 +00:00
Francis Williams e97d916284 remove stray cerr (#389) 2025-04-30 13:05:06 -04:00
Matthew Cong 378b08b84d Replace binary search for jidx computation with nested kernels (#375)
* Replace binary search for computing jidx with nested kernels

* Cleanup for CPU implementation
2025-04-30 09:21:35 -04:00
Jonathan Swartz c31b75ce69 Fix bug where the maximum radius was not being calculated across all cameras in computeGradientState (#385)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-30 09:12:56 -04:00
Jonathan Swartz 76ad1c97d4 3dgs: Replace ProjectBackwards GLM math use with NanoVDB Math (#344)
This remove the last vestiges of glm usage from our code by refactoring any Gaussian Projection Backwards code to use nanovdb::math classes and to cleanup any style/naming conventions on code that is refactored. To that end, several themes of work in this PR include:

Removing GLM from our build infrastucture
Transitioning the code in GaussianProjectedBackward.cu & GaussianProjectedJaggedBackward.cu to using nanovdb::math in place of glm
Adding functionality to nanovdb::math to support a few needed missing operators
Removing GaussianTypes.cuh which was used to define glm types for Projection
Consolidated any remaining, needed warp-prefix functions from GaussianTypes.cuh and GaussianVectorTypes.cuh into GaussianWarpUtils.cuh
Refactored functions in GaussianUtils.cuh to return their calculated results instead of directly modifying output parameters where possible. The return values of these functions is then used by the calling code for modifying variables in the calling code. For instance, instead of add_blur_vjp adding blur to a parameter passed by reference, generateBlurVectorJacobianProduct now builds a nanovdb::Math::Mat2 which is used by the calling code.
Add docstrings to GaussianUtils.cuh
Moving snake_case variables/functions to camelCase and being more descriptive in their naming
Making variable types and names consistent between related functions (forward/backwards)
Fixing worldToCamMatrices being mistakenly called camToWorldMatrices

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-30 00:17:00 +00:00
Jonathan Swartz 2878a819d8 3dgs Backward Projection Test Fix (#372)
* Debugging

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Clarifying comments

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Fix logic in computeGradientState
Fixed appropriate sizing of the tensors it writes to

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Change the computeGradientState loops over C*N to save on some multiplications

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* backward test checkpoint

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Revert BackwardTest rework

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* update test data tag

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* cleanup

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-29 20:41:09 +12:00
Christopher Horvath 27a59587a5 Added a fvdb devcontainer (#381)
* Added a fvdb devcontainer so that VSCode and Github Codespaces can run inside the docker environment automatically

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>

* Improved the language in the comments

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>

* Made suggested configuration changes from VSCode copilot

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>

---------

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
2025-04-28 11:38:41 -04:00
Matthew Cong 5dc696e88c Use PyTorch's pybind11 instead of source checkout (if possible) (#359) 2025-04-23 19:27:18 -07:00
Jonathan Swartz 4665c441a3 Merge pull request #2033 from swahtz/fvdb_update 2025-04-24 12:27:12 +12:00
Jonathan Swartz 5592b5fca8 Merge branch 'feature/fvdb' into fvdb_update
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-24 12:22:48 +12:00
Jonathan Swartz e5c380d127 Merge pull request #371 from matthewdcong/develop_fvdb_merge
Merge latest develop into feature/fvdb
2025-04-24 12:00:36 +12:00
Matthew Cong 360513e139 Merge remote-tracking branch 'upstream/develop' into feature/fvdb 2025-04-23 14:51:58 -07:00
Mark Harris 923be735a0 Refactor GaussianRasterizeForward (#308)
Similar to #231 this PR refactors the forward pass of gaussian rasterization.

    Adds a new Gaussian structure for use in both passes
    Adds a DeviceArgs class that simplifies configuring and passing arguments for the kernel, and contains the method volumeRenderTileForward which operates on the class data directly.
    Updates code for our coding style standard (e.g. camel case names)
    Renames "colors" to "features" everywhere to better match high-dimensional rendering capabilities.
    Removes redundant "pixel" and "perPixel" prefix/suffixes from some variables.

Signed-off-by: Mark Harris mharris@nvidia.com

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-04-24 07:48:51 +10:00
Matthew Cong 68160beb58 Merge pull request #370 from matthewdcong/master_develop_merge_part2
Merge latest master into develop
2025-04-23 14:47:29 -07:00
Matthew Cong 3ff8a4bb17 Squashed commit of the following:
Merge latest master into develop (squashed to avoid duplicates)
2025-04-23 14:41:05 -07:00
Matthew Cong 050ac875b5 Merge pull request #369 from matthewdcong/master_develop_merge_part1
Merge upstream commits from ASWF master into develop
2025-04-23 14:36:41 -07:00
Matthew Cong 09b77cb8ba Merge branch 'master' into develop 2025-04-23 14:33:17 -07:00
Mark Harris eadf8e38a1 Add a CMakeLists for standalone caching of fvdb_test_data (#362)
This adds a CMakeLists.txt that simply uses CPM to download / cache the FVDB test data if it is not already in the CPM_SOURCE_CACHE.

This is run by build.sh when running ctest (build.sh ctest).

Note that the CPM_SOURCE_CACHE needs to be set to the same value as set when building the gtests (or unset on both).


Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add CPM_SOURCE_CACHE to env in fvdb-gtests GHA job

Signed-off-by: Mark Harris <mharris@nvidia.com>

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-04-23 15:49:49 +10:00
Francis Williams 356efd6d00 Refactor projection forward pass (#334)
Refactors forward pass of projection to use tensor accessors and wrap kernel call in a class.
Also load cameras into shared memory which should be more efficient than having each thread load the same camera.

Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-04-23 15:28:11 +10:00
Jonathan Swartz c2d6ea99ed 3dgs projection tests (#356)
Adding gtests for the 3D Gaussian Splatting Projection code using the garden scene.

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-22 22:34:11 +00:00
Christopher Horvath 91846684b4 Moved docker troubleshooting into a separate markdown file (#360)
* Moved docker troubleshooting into a separate markdown file

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>

* Contents of docker_readme updated.

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>

---------

Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
2025-04-22 13:05:23 -07:00
Matthew Cong bc07dba8c5 Merge pull request #354 from matthewdcong/develop_fvdb_merge
Merge latest develop into feature/fvdb
2025-04-21 22:18:21 -07:00
Mark Harris c678006f6e Use object libraries to reduce recompilation of bindings and tests. (#349)
Use intermediate object libraries to reduce recompilation of gtests when modifying libfvdb sources.

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-04-22 14:40:49 +10:00
Christopher Horvath 4fba75b70d Added WSL2/Ubuntu docker troubleshooting to the README (#355)
Signed-off-by: Christopher Horvath <blackencino+git@gmail.com>
2025-04-21 20:39:45 -07:00
Matthew Cong 8607b78e4d Fix calling host function from hostdev function warning (#351) 2025-04-21 19:14:39 -07:00
Matthew Cong 9d3efb8a21 More updates 2025-04-18 11:51:37 -07:00
Matthew Cong 695729a0c0 Update FVDB accessors 2025-04-18 09:43:48 -07:00
Matthew Cong 79f732ad1a Merge branch 'develop' into feature/fvdb 2025-04-18 08:46:47 -07:00
Francis Williams 48d68e9f60 unfuck git (#312)
Signed-off-by: Francis Williams <francis@fwilliams.info>
2025-04-17 17:56:08 -04:00
Matthew Cong 97472f6ef1 Minor changes to GridBatchImpl in preparation for Unified Memory support (#341)
* Switch mHostMetadata to raw pointer in preparation for unified memory

* Set GPU metadata via kernels

* Add missing device guard

* Insert newline

* Use kernels for setFineTransform and setCoarseTransform

* Fix GridBatchImpl for empty grid

* More cleanup

* Move indexInternal to .cu file

* Add missed file
2025-04-17 11:24:09 -07:00
Mark Harris afd31e5509 Add fvdb-dev as CODEOWNERS for the fvdb directory (#346)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-04-17 14:35:14 +12:00
Matthew Cong e8a28fe1fb Merge pull request #343 from matthewdcong/upstream_aswf_merge
Merge latest master into develop
2025-04-16 16:34:45 -07:00
Matthew Cong 753d98fb7d Merge branch 'master' into upstream_aswf_merge 2025-04-16 14:06:19 -07:00
Jonathan SwartzandMark Harris 3b6880d96d CI: gtest build and run setup (#336)
This PR sets up running our gtest build targets as part of our automated fVDB CI actions.

First, all the gtests are built as part of the library & wheel building and the whole build directory is uploaded as an artifact separately of the wheel.
In a separate task on a CI machine with a GPU, the tar'd build directory is downloaded. The build directory is un-tar'd and the gtests are run normally with ./build.sh ctest
Fixes #172
Fixes #173

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Mark Harris <mharris@nvidia.com>
2025-04-15 16:51:06 +10:00
Matthew Cong 535923f2be Re-enable NumPy 2 support (#338)
Previously we pinned NumPy to versions prior to v2.0.0 (i.e. v1.x.x) due to the lack of NumPy 2 ABI support in point-cloud-utills. The latest version of point-cloud-utils now supports the NumPy 2 ABI so we can relax this pinning.

PyTorch v2.6.0 requires NumPy v2.x.x and it's likely that slightly earlier versions also built with NumPy v2.x.x as well.
2025-04-15 15:51:40 +12:00
Matthew Cong 150c901bf8 Remove StringOrListOfStrings in favor of function overloads (#339)
* Remove StringOrListOfStrings in favor of function overloads

* Replace default constructor with nullopt

* Fix formatting

* Another formatting fix
2025-04-14 20:44:43 -07:00
Matthew Cong fbd61b1b4b Fix missing device ordinals in examples (#337) 2025-04-14 20:14:13 -07:00
Matthew CongandJonathan Swartz fa12f4e5ce Remove TorchDeviceOrString in favor of stricter function overloads (#330)
* Remove TorchDeviceOrString in favor of stricter function overloads

* Small fixes to device index

* Fix formatting

* Remove trailing whitespace

* Add missing binding

* Small fixes

* Switch from torch::optional to std::optional

* Fix missing device ordinal

* Update stub file

* Format

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-14 14:26:02 -07:00
Matthew Cong a5380f30c5 Add support for editable PyTorch installs (#333)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-04-14 13:23:43 -07:00
Sérgio AgostinhoandJonathan Swartz 1225b9c798 fVDB: Promote SyncBatchNorm to a first-class layer (#322)
Promotes the SyncBatchNorm layer to a first-class citizen.
Addresses the issue with the original implementation where checkpoints created with SyncBatchNorm were incompatible with vanilla BatchNorm, which is a behavior PyTorch natively supports.

---------

Signed-off-by: Sérgio Agostinho <sagostinho@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-14 05:33:21 +00:00
Jonathan Swartz f290b512ca CI Fix Benchmarks job (#332)
* Fix benchmark task branch checkout failure

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-14 16:20:12 +12:00
Jonathan Swartz 9101f1dfdf Renamed gsplat headers that had prefix 'Gsplat' or had no mention of Gaussian to 'Gaussian*' prefix (#326)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-11 10:55:02 -04:00
Matthew Cong aa3e269b6d More cleanup for TorchDeviceBuffer (#320)
* More cleanup for TorchDeviceBuffer

* Format

* More cleanup
2025-04-11 00:33:32 -07:00
Jonathan Swartz 9ab8037226 CI: Fix merging reference branch to PR branch before building (#329)
* Added fvdb CI build steps to merge feature/fvdb branch in PR to PR branch before testing


---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-11 18:27:36 +12:00
Jonathan Swartz 868ef3a1eb Add global cmake download timeout and CPM_SOURCE_CACHE to fvdb CI(#328)
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-11 17:18:29 +12:00
Jonathan SwartzandMark Harris 24a942d5b6 Replaced use of glm with nanovdb math in projectForwardKernel (#238)
Implemented overloaded fucntions in GsplatUtils, Projection, etc. to not break other pieces of pipeline that still use glm
Implemented various Matrix classes in nanovdb::math that were required.

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <mharris@nvidia.com>
2025-04-11 02:55:15 +00:00
Mark HarrisandJonathan Swartz 40b1e6a8de Build fVDB module using scikit-build-core / CMake (#264)
Switched from using the PyTorch built-in setuptools-based cpp_extension module to a scikit-build-core + CMake build system. Additionally this includes the introduction of a new build script, updates to the Dockerfile, and updates to the documentation.

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-11 12:32:22 +12:00
Ken Museth f18d30ca0d Improve points to grid (#318)
* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* minor improvements to nanovdb::tools::cuda::PointsToGrid

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-04-09 11:15:20 -07:00
Matthew Cong 87d053396f Fix missing declaration in TorchDeviceBuffer (#319)
* Fix missing declaration in TorchDeviceBuffer
2025-04-09 00:33:25 +00:00
Francis Williams 8d876b90c8 fix grid stride loops (#316) 2025-04-08 15:51:57 -04:00
Matthew Cong e9277d5fe8 Refactor TorchDeviceBuffer to support an arbitrary single torch::Device (#302) 2025-04-04 13:47:54 -07:00
e05dd592bb Use new Gaussian Splat C++ API from Python (#290)
Implements a new GaussianSplat3d class in C++ that also tracks appropriate gradient state for optimization.
Clean up the Gaussian splatting code in python. We now only depend on Pytorch!
Clean up the optimizer code a lot by moving gradient state tracking to C++ class.
Move refinement part of optimization code to training script since it's clearer. The whole algorithm can now be read in one file.
Add a bunch of new error checking.

Still outstanding:

    Implement pruning/splitting/duplication in CUDA (Going to be a seperate PR)

-----
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-04-03 14:22:22 +11:00
Matthew Cong e217cbe6f2 Add patches to external dependencies required for CMake 4 (#305) 2025-04-02 13:12:26 -07:00
Matthew Cong 836d4a14d8 Merge pull request #306 from matthewdcong/upstream_aswf_merge
Merge in latest master into develop
2025-04-02 10:58:45 -07:00
Matthew Cong dcf8724324 Merge branch 'master' into develop 2025-04-02 09:43:35 -07:00
Matthew Cong e281e93a97 Merge pull request #300 from matthewdcong/upstream_aswf_merge
Merge latest master into develop
2025-03-31 14:07:27 -07:00
Matthew Cong 987cf322d6 Merge branch 'master' into develop 2025-03-31 12:16:02 -07:00
Mark Harris f87be92caa Add Doxygen docs for Gaussian Splatting C++ functions (#278)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-03-26 14:01:01 +11:00
Jonathan Swartz d977b72a4a fVDB: Add transform metadata when saving non-index grids (#295)
* Add transform metadata to non-index grids we're saving
fixes #32
* Fix data grid saving to be able to save non-uniform voxel scales
Add tests
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-03-24 11:06:45 +13:00
Mark Harris c877c9e7f0 Unit tests for GaussianForwardRasterization (#289)
New GaussianRasterizeForward unit tests.

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-03-18 05:46:59 +11:00
Jonathan Swartz d32be67783 Update credentials version
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-03-17 20:23:43 +13:00
Jonathan Swartz b94d3e1a96 added fvdb aws codebuild configurations
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-03-17 20:20:47 +13:00
Matthew Cong 74d46e5601 Add optimizations to MGPU PointsToGrid (#283)
* Add timer for MGPU PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Avoid blocking kernel launches due to cudaFree

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix overlapping of copies

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Pipeline pointsPerVoxelPrefix sum

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup and optimization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Further improve pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove unnecessary sync point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert "Remove unnecessary sync point"

This reverts commit f01b36ad852f32ec65517b3baa08ea267d5edc2d.

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to GPU sync

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event destruction race condition and reduce host thread latency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Revert timer add

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More fine-grained pipelining

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix event wait/destruction race condition

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-03-13 15:49:17 -07:00
Ken Museth 9f52c46ad0 Feature/fix get set methods (#288)
* minor cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed issue in get/set random access methods

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* deleted white space

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit tests

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-03-13 13:21:24 -07:00
Francis WilliamsandFrancis Williams 4e376ff930 C++ Class for GaussianSplat3d (#280)
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-03-12 12:34:29 +13:00
Matthew Cong 8edb137baa Fix race condition across different merge levels (and memory leak in corresponding tests) (#274)
* Fix memory leaks in PointsToGrid tests

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix leapfrogging across recursion levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch for different levels

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-03-05 12:52:38 -08:00
Francis Williams 82aab4082c Wide channel width in GaussianRasterizeBackwards (#262)
* move atomic adds to helper

* add fixture and basic cat test

* move gradient contribution to its own function

* renaming

* remove color struct to allow different shared memory channels

* channel ranges for atomic add and shared memory color dim arg

* channel range for color fetching into shared memory and split color and gaussian shared memory fetching into two functions

* size_t

* add template parameter for shared channels

* stub for chunked

* checkpoint

* checkpoint

* rm prints

* some constexpr

* more loop unrolling

* more unrolling

* fix

* more tests

* rm old codepath

* start renaming

* more renames

* rename

* rename all members to use m prefix

* rename template args

* more renames

* cpu throws test

* error checking and bring back all dimensions

* small cleanup
2025-03-05 00:34:15 +00:00
Matthew Cong 270d2238b8 Generalize MGPU grid construction to any power-of-two number of GPUs (#270)
* Start support for more than two GPUs in key merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Flip flop storage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Generalize concurrent leftIntervals/rightIntervals usage

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix median search

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix rebalancing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix recursive MGPU merge

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update TODO

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add guards for zero-tile GPUs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-03-04 12:42:17 -08:00
Matthew Cong 0e8e1966b7 Merge pull request #271 from matthewdcong/sync/master_to_develop
Merge latest ASWF master into develop
2025-03-04 12:13:18 -08:00
Matthew Cong 84c258562e Merge branch 'master' into develop 2025-03-04 11:10:29 -08:00
12276a7afc Unit tests for GaussianSplatBackward (#259)
* move gaussian accumulation into a function. Move delta and sigma into methods on Gaussians
* Added a simple test to compare GaussianRasterizeBackward against some saved data.
* Fixed a bug where packed was uninitialized.
* Fixed another latent bug where we were getting a pointer from a tensor accessor. This might fail if that accessor is strided in the last dimension.
* Populate compile time definition of path to test data in C++ unit tests.

Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Mark Harris <harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <swahtz@users.noreply.github.com>
2025-02-26 16:33:33 +11:00
Mark Harris e2b295a197 CMake configuration for building libfvdb (#237)
* Add CMakeLists and dependency getters for libfvdb

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add cudnn to dev conda environment

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix compilation errors uncovered when building with cmake

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add build dir to gitignore

* cudnn_fe --> cudnn_frontend, fix cutlass

* Revert adding cudnn to conda dev_environment

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Build gtests and gbenchmarks from main cmakelists

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix tensor dimension corruption by scoping IntArrayRef's vector lifetime

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add Cutlass patch

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add cpm source cache.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix CPM source cache and make it overrideable

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add blosc and missing compilation settings.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Since we require CUDA 12+, we can drop the cutlass patch.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix blosc build options

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix up compiler options and properly scope cmake options, and generate compile_commands.json

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Remove commented out lines.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add install rules

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Whitespace

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Make get_torch.cmake a bit more robust (more informative error on import failure)

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add missing typename keyword (pre-C++20)

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Update to C++20, which for some reason makes us need the cutlass patch again, so enable it.

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-02-26 07:51:31 +11:00
Jonathan Swartz bafe8fe86e add CMAKE_CUDA_ARCHITECTURES to nanovdb weekly tests (#257)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-02-25 08:56:56 -08:00
bbartlett-nvandFrancis Williams e1cf99fbed adding in scripts for ortho, mesh, mask training etc (#247)
* adding in scripts for ortho, mesh, mask training etc

* rm dep on colmapparser in gaussiansplatting

* move colmap dataset out of core fvdb into project

* update imports in gaussian splatting project

* revert dev env

* autoformat and rename T1 -> normalizat_transform

* clean up normalization argument

* print to warning

* rm print

* bring back sorting

---------

Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-02-25 11:36:52 -05:00
Francis Williams 794820311b Refactor Backward Gaussian Rasterization and remove glm (#231)
* remove glm dep and use struct

* rename macros

* small cleanup and const some things

* move volume render backward to helper function

* checkpoint

* rename S -> ScalarType

* pass in warp as variable

* camel case and type cleanup

* S -> ScalarType

* clean up full file

* address PR comments

* rename thread -> blockDim, blocks -> gridDim

* fixed and moved to class

* checkpoint

* checkpoint

* checkpoint

* rename

* cleanup

* checkpoint

* cleanup

* more cleanup

* Fix comment

* handle empty inputs

* fix

* fix error checking
2025-02-22 20:07:44 +00:00
Jonathan Swartz 350febee18 Merge pull request #248 from matthewdcong/fvdb_develop_integ
Merge develop into feature/fvdb
2025-02-21 12:37:39 +13:00
Matthew Cong ebca97a1a2 Merge develop into feature/fvdb
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-20 14:09:23 -08:00
Matthew Cong 4f60c64028 Suppress stringop-overflow warning due to GCC 11 regression (#246)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-20 13:08:44 -08:00
Mark Harris fb999c49e4 Fix strict aliasing violation in encode_depth, and document helper functions. (#236)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-02-19 08:46:26 +13:00
Jonathan Swartz 2a7498f7f7 Merging current develop into feature/fvdb (#234)
---------
Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-18 14:22:08 +13:00
Jonathan Swartz c9a06baf88 Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failures (#235)
* Adding /bigobj to TestNanoVDB.cu compilation options to fix Windows build failure
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-02-18 11:33:27 +13:00
Matthew Cong e170b879ae Use cuDNN 9 that's included in PyTorch 2.4 and above (#222)
Add cuDNN include directory and vendor in cuDNN frontend

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-18 09:04:43 +13:00
Jonathan SwartzandFrancis Williams 8c6c449898 Change status_checks to use self-hosted runner (#226)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
2025-02-15 00:07:35 +00:00
Matthew CongandKen Museth 1cc5aa13ee Silence CMake warning about FindBoost module deprecation (#230)
* Silence CMake warning about FindBoost module deprecation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typo

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
2025-02-14 14:44:54 -08:00
Ken Museth 692cdde46c minor cleanup (#229)
Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-14 13:59:38 -08:00
Ken Museth 0d157c199f revert deprecation warning (#228)
Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-14 12:02:33 -08:00
Mark HarrisandFrancis Williams 7b040d3c67 Gaussian Splatting sparse tile intersection (#213)
* Implementation and tests of dispatchGaussianTileIntersectionSparse (not yet passing)

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Some bug fixes, intermediate changes, still failing tests.

* fix

* Use custom kernel for sparse tile_offsets. Fixes current sparse test failures.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Make non-sparse tile_offsets look like it used to.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Refactor dispatchGaussianTileIntersection to reduce repetition between dense and sparse.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add a random sparsity test.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* docs and move sparse intersection into a different header

* grid stride loops

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-02-14 14:18:10 -05:00
Matthew Congand= 0783b2a7e1 Add distributed implementation of PointsToGrid (#102)
* Add distributed implementation of PointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition in merge and single GPU case

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix kernel/cudaFree race conditions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add DistributedPointsToGrid unittest

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up example

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix Windows build and some warnings

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update for refactored DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix copyright/include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add parallelForEach helper

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Templatize kernels to align with CUB better

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Shorten TemporaryDevicePool to TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Refactor to use TempDevicePool

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to class

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Parallelize kernel dispatch in build

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix race condition wrt to root node processing

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Speed up synchronization

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add comments and fix deprecated TransformInputIterator

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address review comments

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Address more review comments

* Add more cudaCheck calls and restrict EqualityIndicator type

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix license identifiers and remove unused code

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add missing include

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
2025-02-14 08:51:18 -08:00
Matthew Cong 20c22d71e5 Add support for venv builds (#219)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-14 00:12:25 +00:00
Matthew Congand= 372e48a430 Defer psutil import which is not specified as a Python requirement (#217)
* Defer psutil import which is not specified as a Python requirement

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix formatting

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: = <=>
2025-02-14 00:02:08 +00:00
Matthew Cong ad63e07a03 Consolidate DeviceGuard into DeviceMesh header (#221)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-13 12:40:14 -08:00
Ken Museth 1bb3b12482 fixed typos and improved documentation in NanoVDB (#220)
Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-13 11:46:16 -08:00
Matthew Cong 273d63e2ca Switch AX CI jobs to be weekly (#216)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-12 19:03:39 -08:00
Ken Museth 7cdf89202f introducing new magic numbers for grids and files (#210)
* introducing new magic numbers for grids and files

Signed-off-by: Ken <ken.museth@gmail.com>

* removed two redundant magic numbers

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-12 13:45:38 -08:00
Matthew Cong 69a7808d4d Remove TBB dependency introduced by GCC (#215)
* Remove TBB dependency introduced by GCC

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix formatting

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-12 12:16:33 -08:00
Mark Harris 7f22194e09 Return activeTileMask from computeSparseInfo (#211)
Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-02-11 18:43:10 -05:00
7c04627c24 Add C++ unit tests for GaussianTileIntersection (#203)
* Rename computeSparseInfoTest and add new unit tests for GaussianTileIntersection.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix handling of all-zero-radius splats. Fixes failing unit test.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* spdx header

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Fix the failing BasicIntersectionTest

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add an explanatory comment about packed mode.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* refactoring

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Add failing test, commented out.

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Separate GaussianFullyFusedProjection*.cu into distinct files (#201)

* separate projection files

* rename some functions

* rename jagged

* fix empty gaussian test, add error checking, and add error checking test

* Rename NanInfMaskTest to match other test file naming

Signed-off-by: Mark Harris <mharris@nvidia.com>

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-02-11 18:00:24 -05:00
Francis Williams 813ccdcf6b C++ PLY saving (#188)
* save ply for gaussian splats

* fixes

* filter operation in cuda

* checkpoint

* fixes and python bindings

* end to end test in python

* rm unused imports

* helper function for getting bytes from tensor

* rm thread divergent returns and inline on header only function

* use std generate

* use tensorOpts

* use config array

* const filename

* error message fix

* contiguous

* stylefix

* whitespace

* stylefix2

* grid stride loop and launch bounds

* use stream in sparse info computation (#190)

* Add a Vec2 type to nanovdb math (#166)

* orthographic projection in gaussian splatting

add orthographic flag to depth rendering function

derp

add ortho projection to jagged projection

* small refactor

* add vec2 class to nanovdb math

* fix

* Separate GaussianFullyFusedProjection*.cu into distinct files (#201)

* separate projection files

* rename some functions

* rename jagged
2025-02-11 16:12:45 -05:00
Matthew Cong bb0c4d141f Replace deprecated torch::linalg::inv with equivalent at::linalg_inv (#209)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-11 14:15:13 -05:00
Francis Williams 0f3578d60a Separate GaussianFullyFusedProjection*.cu into distinct files (#201)
* separate projection files

* rename some functions

* rename jagged
2025-02-11 10:36:48 -05:00
Ken Museth 35d6eea9d2 minor simplification in CreateNanoGrid (#202)
* minor simplification in CreateNanoGrid

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-10 17:16:09 -08:00
Francis Williams 91d8bcf3c0 Add a Vec2 type to nanovdb math (#166)
* orthographic projection in gaussian splatting

add orthographic flag to depth rendering function

derp

add ortho projection to jagged projection

* small refactor

* add vec2 class to nanovdb math

* fix
2025-02-10 16:23:13 -05:00
Ken Museth 90ac7aa909 major improvements to GridBlindMetaData (#199)
* major improvements to GridBlindMetaData

Signed-off-by: Ken <ken.museth@gmail.com>

* minor changes to fix clang issue

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-10 12:56:39 -08:00
Matthew CongandKen Museth a206519467 Fix class-memaccess warning due to non-trivial copy-assignment in GridBlindMetaData (#147)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
2025-02-07 22:12:29 -08:00
Ken Museth b4634c76b8 removed dead code and updated the minor version number (#198)
Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-07 17:11:38 -08:00
Matthew CongandKen Museth 2144e0efd4 Add missing constructor for C++20 used in AddBlindData.cuh (#197)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
2025-02-07 16:26:05 -08:00
Matthew Cong fc2c4b44b6 Fix DeviceMesh.h header to be self-contained (#196)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-07 23:34:49 +00:00
Ken Museth 6d54f0e50c Fixed issue in signedfloodfill (#185)
* Fixed issue in signedfloodfill

Signed-off-by: Ken <ken.museth@gmail.com>

* partially addressed review comments

Signed-off-by: Ken <ken.museth@gmail.com>

* added RootData::TileIterator

Signed-off-by: Ken <ken.museth@gmail.com>

* cleanup

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed assert bug

Signed-off-by: Ken <ken.museth@gmail.com>

* snapshot

Signed-off-by: Ken <ken.museth@gmail.com>

* fixed bug and improved unit-test

Signed-off-by: Ken <ken.museth@gmail.com>

* improved unit test and documentation

Signed-off-by: Ken <ken.museth@gmail.com>

---------

Signed-off-by: Ken <ken.museth@gmail.com>
2025-02-07 15:01:11 -08:00
Francis Williams 7f015429ca use stream in sparse info computation (#190) 2025-02-06 11:46:09 -05:00
Matthew Cong 72ffce9949 Fix TBB template deduction in C++20 (#189)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-05 16:33:41 -08:00
Matthew Cong 9733b0882e Fix out-of-bounds device id (#180)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-02-05 08:18:02 -08:00
Mark HarrisandFrancis Williams baab90646e Add support for multiple images in sparse gsplat config (#182)
Extends computeSparseInfo() (from #137) to work with a JaggedTensor of pixels to render with outer dimension > 1. In other words, pixels from more than one image.

Adds unit tests to exercise this functionality. Also parameterizes the strided-pixel unit tests to further DRY up the test code.

Collaboration with @swahtz and @fwilliams

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-02-05 19:21:37 +13:00
8c41e2b822 Sparse Gaussian Splatting Configuration (#137)
Closes #60

This pull request adds functionality to compute the configuration tensors for Sparse 3D Gaussian Splatting. These tensors will be used to mask the output of 3DGS when fed a list of sparse pixels to render, and to "regather" the sparse rendered pixels corresponding to the input pixel UV coordinates.

A fairly comprehensive C++ unit test suite is also added.

Build Configuration Updates:
fvdb/.vscode/c_cpp_properties.json: Updated include paths to reflect new dependencies and updated Python version from 3.10 to 3.11.
fvdb/setup.py: Added psutil import and set MAX_JOBS environment variable based on available RAM to control the number of parallel jobs for building. [1] [2]
fvdb/src/cmake/get_fvdb.cmake: Modified to dynamically find the Python version and update the FVDB_BUILD_DIR accordingly.
fvdb/src/tests/CMakeLists.txt: Added compile options for CUDA and C++ in debug mode and configured new unit tests for Gaussian splatting. [1] [2]
Functionality Enhancements:
fvdb/src/detail/ops/gsplat/GaussianSplatSparse.cu: Added new CUDA kernels and functions to implement sparse Gaussian splatting, including detailed comments explaining the algorithm and its components.
fvdb/src/detail/ops/gsplat/GaussianSplatSparse.h: Added header declarations for the new sparse Gaussian splatting functions.

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Signed-off-by: Matthew Cong <mcong@nvidia.com>
Signed-off-by: Mark Harris <mharris@nvidia.com>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <francis@fwilliams.info>
2025-02-04 12:07:53 +13:00
Matthew Cong 964c4270d6 Fix namespace for AbsDiff and RelDiff ostream overloads (#177)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-30 16:35:17 -08:00
Francis Williams 03cd858bf0 Merge remote-tracking branch 'fwilliams/fw/orthographic_gaussian_splats' into feature/fvdb 2025-01-30 08:51:00 -08:00
Francis Williams ca8fbd1ab4 naming 2025-01-30 07:07:51 -08:00
Francis Williams 3f72e2444a return values out of projection vjp 2025-01-30 07:03:23 -08:00
Jonathan Swartz 1a376f21d0 Moving 3dgs example to projects directory (#175)
* Moved examples/3dgs->projects/3d_gaussian_splatting/training

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Fix up READMEs

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-30 14:53:01 +13:00
Francis Williams 6485bca2db add documentation and move projections to their own header 2025-01-29 16:53:39 -08:00
Francis Williams b47913e604 fix some comments 2025-01-29 16:44:35 -08:00
Matthew Cong 16f190b574 Fix missing relocatable device code flag (#170)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-29 13:45:53 -08:00
Francis Williams 9d55e6397a return projection values rather than use output params.
template ortho in jagged projecction
2025-01-29 13:07:15 -08:00
Francis Williams 79a3b3a155 another typo 2025-01-29 08:24:22 -08:00
Francis Williams 1e7ecc2c2a typo fix 2025-01-29 08:20:19 -08:00
Francis Williams b74bad0a3f template ortho for backward 2025-01-29 07:50:55 -08:00
Francis Williams 3ca570de27 fix backward number of return values 2025-01-29 07:50:48 -08:00
Francis Williams 7c5ff85553 fix typo 2025-01-29 07:50:36 -08:00
Jonathan Swartz 470205d833 Removing pull_request trigger from 'Wait for Status Checks' (#163)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-29 17:21:50 +13:00
Jonathan Swartz 7f0b162766 Removing pull_request trigger from 'Wait for Status Checks' (#165)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-29 16:49:03 +13:00
ed220e48d8 Boolean template parameter for orthographic projection.
Co-authored-by: Mark Harris <harrism@users.noreply.github.com>
Co-authored-by: Jonathan Swartz <swahtz@users.noreply.github.com>
2025-01-28 19:17:22 -08:00
Matthew Cong 526a693b43 Change UnifiedBuffer prefetch and advise to be const (#160)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-27 23:52:29 +00:00
Matthew Cong 520085852c Fix invalid free in UnifiedBuffer move constructor (#156)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-27 22:34:16 +00:00
Francis Williams 500e158f97 small refactor 2025-01-27 14:13:02 -08:00
Jonathan Swartz 6ff3939a05 Fixing build_environment; should be 2.4.1 (#162)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-28 07:54:21 +11:00
Matthew Cong c146d17513 Add missing NCCL ifdef (#164)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-28 09:30:39 +13:00
Francis Williams fef302f5ff Revert "orthographic projection in gaussian splatting"
This reverts commit bfe68a0d82.
2025-01-24 13:26:21 -08:00
Francis Williams f38a52d8e6 Revert "add orthographic flag to depth rendering function"
This reverts commit 7803589d9d.
2025-01-24 13:26:08 -08:00
Francis Williams 3673dabd9c Revert "derp"
This reverts commit af38b51cf9.
2025-01-24 13:25:57 -08:00
Francis Williams 00a035affb Revert "add ortho projection to jagged projection"
This reverts commit d800ecfa88.
2025-01-24 13:25:43 -08:00
Francis Williams 589b9c9d16 orthographic projection in gaussian splatting
add orthographic flag to depth rendering function

derp

add ortho projection to jagged projection
2025-01-24 13:24:51 -08:00
Francis Williams d800ecfa88 add ortho projection to jagged projection 2025-01-24 13:21:54 -08:00
Francis Williams af38b51cf9 derp 2025-01-24 12:57:20 -08:00
Francis Williams 7803589d9d add orthographic flag to depth rendering function 2025-01-24 10:19:16 -08:00
Francis Williams bfe68a0d82 orthographic projection in gaussian splatting 2025-01-24 09:42:28 -08:00
Mark Harris 86f2734cd2 Fix conda envs and cmake for unit tests (#153)
* Fix build- and dev- environments and cmake so unit tests will build with conda-forge packages

Signed-off-by: Mark Harris <mharris@nvidia.com>

* Remove no-longer-needed env

Signed-off-by: Mark Harris <mharris@nvidia.com>

---------

Signed-off-by: Mark Harris <mharris@nvidia.com>
2025-01-23 11:38:53 +13:00
Jonathan Swartz 06f003e85a Merge pull request #1997 from swahtz/omni_fvdb_update
fVDB 0.2.1 update
2025-01-23 10:38:01 +13:00
Jonathan Swartz cd5fdeb92a fVDB version bumped to 0.2.1 (#151) (#152)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-22 17:40:25 +13:00
Jonathan Swartz 8145597272 Adding back fix to NanoVDB CI for test failures
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-22 14:49:50 +13:00
Jonathan Swartz 04e3193377 Revert any changes to .github/ made to accomodate CI
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-22 13:21:19 +13:00
Jonathan Swartz 16bfecf4c6 fVDB version bumped to 0.2.1 (#151)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-22 13:15:17 +13:00
Jonathan Swartz eb489a2bdc Remove test env accidentally merged in previous PR (#150)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-22 12:51:20 +13:00
Francis Williams a8e52da53c Fix bug where image cropping wasn't working in Gaussian Splatting 2025-01-22 12:21:48 +13:00
Matthew Cong 7d13055ceb Add missing inline for DeviceMesh functions (#145)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-21 09:46:15 -08:00
Francis Williams 2db574080d fix itertools.cycle (#142) 2025-01-21 15:51:32 +13:00
Matthew Cong 2d7bc30af3 Add missing const variant of deviceData(device) (#146)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-21 15:48:25 +13:00
Jonathan SwartzandKen Museth a75a507ecb PyTorch, CUDA package sources moved to conda-forge channel (#131)
Moved the recommended build/test/dev environments to use the conda-forge channel as their package source. This has required moving to CUDA 12.0, PyTorch 2.4.1.  Also removed the NKFW tests because they were breaking in the new environment but these tests’ functionality were covered by other unit tests.

closes #121 closes #135
---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
2025-01-21 13:01:25 +11:00
Matthew CongandMark Harris f9a9876ee9 Switch to DeviceMesh for MGPU sparse convolution example (#106)
* Convert MGPU convolution example to use DeviceMesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Fix typos and clarify

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Check for errors and switch to for_each

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
2025-01-16 10:57:19 -08:00
1b7f60fe53 remove tensor conversion on images from dataloader to save on ram useage for large datasets (#129)
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
2025-01-17 07:50:58 +13:00
Matthew CongandMark Harris 31b5fee9ab Add DeviceMesh and (optional) NCCL CMake Support (#99)
* Add device mesh

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Restore current device in constructor and destructor

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Enable range-based for loops

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Use structured bindings inside for loop

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove uneeded accessors and modularize functions

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Statically initialize entry point

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Encapsulate

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Switch to lightweight wrapper class for DeviceNodes vector

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Minor changes needed for DistributedPointsToGrid

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add RAII DeviceGuard

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* More cleanup

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Clean up NCCL dependency

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Remove parallel_for to modularize

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Implement and test move constructor/assignment

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Add docs

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Expand test and documentation

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Move non-reinit comment to function description

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Switch to using aliases and modern type names

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Use size_type instead of int for return

Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>

* Separate out DeviceGuard and clean up API

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Mark Harris <783069+harrism@users.noreply.github.com>
2025-01-15 13:41:11 -08:00
Mark HarrisandJonathan Swartz d9b35645a3 Add CMake support for unit tests (#133)
* Add basic cmake and an example gbenchmark

* Modify setup.py to exclude benchmarks directory

* gitignore benchmarks build dir

* Make CMake work with conda-forge Torch, and make simple benchmark use Torch.

* Add working C++11 ABI Torch conda environment

* Modularize the cmake.

* Whitespace cleanup

* empty

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Add comment about excluding benchmarks directory

* Modularize python, torch and fvdb dependencies, and add better error checking

* Empty commit to test signing

* Empty commit to test signing

* Add cmake and example for gtest-based C++ unit tests

* remove whitespace change.

* set `files.insertFinalNewLine` to true in workspace settings, fix EOF newlines

* newline at EOF

* Rename ExampleTest

* Add CTest support.

* "benchmarks" --> "tests"

* Fix typo

* Ignore tests directory (oops)

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-15 11:58:10 -05:00
Matthew CongandFrancis Williams da04f647be Create blank issue template (#136)
* Create issue.md

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update and rename issue.md to task--or--work--item.md

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update task--or--work--item.md

rm trailing whitespace

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Update and rename task--or--work--item.md to blank--issue

Signed-off-by: Matthew Cong <mcong@nvidia.com>

* Rename blank--issue to blank--issue.md

Signed-off-by: Matthew Cong <mcong@nvidia.com>

---------

Signed-off-by: Matthew Cong <mcong@nvidia.com>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
2025-01-14 14:38:34 -08:00
64f47dec27 Add basic CMake infrastructure for benchmarks (#75)
* Add basic cmake and an example gbenchmark

* Modify setup.py to exclude benchmarks directory

* gitignore benchmarks build dir

* Make CMake work with conda-forge Torch, and make simple benchmark use Torch.

* Add working C++11 ABI Torch conda environment

* Modularize the cmake.

* Whitespace cleanup

* empty

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Add comment about excluding benchmarks directory

* Modularize python, torch and fvdb dependencies, and add better error checking

* Empty commit to test signing

* Empty commit to test signing

* Use `find_library` to find libfvdb.so

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Francis Williams <fwilliams@users.noreply.github.com>
2025-01-14 16:34:27 -05:00
Francis Williams 8f3eaa471a Fw/3dgs lifestyle (#127)
* fix spelling mistake and add log

* quality of life helper
2025-01-14 03:01:13 +00:00
Francis Williams dc887b6509 vscode path settings (#126) 2025-01-13 16:16:57 -05:00
Jonathan Swartz 95166cf5cc Fix docs copyright notice to be OpenVDB contributors (#124)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-10 20:03:53 +00:00
Mark HarrisandJonathan Swartz 1acb6477ed Make setup.py handle case where cudnn directory is created but empty (#50)
Co-authored-by: Jonathan Swartz <2375296+swahtz@users.noreply.github.com>
2025-01-11 08:32:36 +13:00
Jonathan Swartz a4a92bc3fa Wait for status checks also triggered on pushes to pull-request branches (#123)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-11 08:31:13 +13:00
Jonathan SwartzandKen Museth 36f3e0921b CI: Update feature/fvdb from develop (#118)
Updating feature/fvdb branch from current develop branch to pickup the 'enforce-all-checks' action as well as disabled Windows tests setup.

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
Co-authored-by: Ken Museth <1495380+kmuseth@users.noreply.github.com>
2025-01-10 17:15:25 +13:00
Jonathan Swartz d2550dba8d Disabling Windows build & nanovdb tests; disabling all tests except for Windows tests in weekly (#120)
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-10 15:43:36 +13:00
Jonathan Swartz 7fdb6283ff black formatting fix for garfield download_example_data (#119)
* black formatting fix for garfield download_example_data
* Removing cv2 import that is only valid for pip opencv package
---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-10 15:09:48 +13:00
Jonathan Swartz d9e5b261e1 Fix status_check directory
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 10:49:39 +13:00
Jonathan Swartz e7d5b0c556 Add status check that checks for the pass/fail of only the triggered status checks
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 10:49:39 +13:00
Jonathan Swartz 527bf5eae8 Updated README
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz 7b542ae021 Garfield download_example_data now also downloads colmap data.
dozer_nerfgun_waldo changed to the default dataset

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz b4ba1cbeab Fix colmap dataset distortion parameters; wrong number of params for simple radial distortion
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz 99630eb403 Make 3dgs download_example_data executable
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz 6abaae22dd Add download_example_data script for downloading example colmap data from LERF project used by GARField paper.
Updated README

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz 8be8734a12 Fix trailing whitespace
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz d560caea5c Fixing garfield black formatting; adding garfield to SPDX ignore-paths
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz d2d4e13971 Add a garfield CUDA 12.1 environment
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Jonathan Swartz afbd5a9fcc Adding garfield source from research repo
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-09 04:55:45 +13:00
Ken Museth 89979f93f7 Minor fix to unit-test of NanoVDB (#111)
* Minor fix to unit-test of NanoVDB

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* minor change

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
2025-01-07 13:24:51 -08:00
Jonathan Swartz 3f9b956418 Fix BuildDeviceGrid's calls to NanoVDB voxelsToGrid which removed an allocator type as an optional template argument.
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-08 10:04:28 +13:00
Jonathan Swartz 07b3ee731d Attemping to fix fvdb action memory issue
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 17:50:43 +13:00
Jonathan Swartz 615a0f1ab9 Fix carriage return typo
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 17:50:43 +13:00
Jonathan Swartz c84d4e2848 Uncomment paths-ignore in fvdb action
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 17:50:43 +13:00
Jonathan Swartz 182a9e584e Commenting out fvdb paths-ignore
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 17:50:43 +13:00
Jonathan Swartz 8d2894cd5d Updating fvdb and whitespace actions for PR bot workflow
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 17:50:43 +13:00
Jonathan Swartz f655251b2b Merge branch 'develop' into feature/fvdb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2025-01-07 09:59:12 +13:00
Matthew Cong 59d2a5c7e3 Fix ODR violation due to anonymous namespace in SignedFloodFill (#97)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-06 12:09:18 -08:00
Matthew Cong 5ecb9c3ead Fix format strings and Windows conversion warning (#101)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-06 11:15:25 -08:00
Ken Museth 23ded25be2 improved nanovdb_convert (#98)
* improved nanovdb_convert

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* fixed typo

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* added unit tests

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* review feedback

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
2025-01-06 11:09:50 -08:00
Matthew Cong fa1ac5feef Add missing iomanip include for latest GTest
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-03 16:59:30 +13:00
Matthew Cong a004afbb05 Separate PointsToGrid kernel lambdas into functors (#94)
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2025-01-02 11:57:39 -06:00
Ken Museth adfd4cd1ef improved change notes and updated version number (#95)
* improved change notes and updated version number

Signed-off-by: Ken Museth <ken.museth@gmail.com>

* improved documentation

Signed-off-by: Ken Museth <ken.museth@gmail.com>

---------

Signed-off-by: Ken Museth <ken.museth@gmail.com>
2024-12-31 12:48:56 -08:00
Matthew Cong 1251b0e016 Fix missing OpenVDB dependency for NanoVDB-only build
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2024-12-31 12:03:58 +13:00
Jonathan Swartz 8c92ec47a6 Pull Request Testing Setup (#86)
* Added copy-pr-bot. Updated triggers to branch pushes per instructions:
https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

* Add NV CPU runners to tasks requiring larger instances
Turning off USE_EXPLICIT_INSTANTIATION, now unblocked by larger runner

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>

---------

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-30 15:04:03 +13:00
Jonathan Swartz 6f10bf3b15 Merge pull request #84 from swahtz/js/voxel-foundation-migration
Migrating last PR changes from private repo over to this repo
2024-12-23 12:02:12 +13:00
Jonathan Swartz 9d691a88d9 Removing GaussianRasterize.cu which was split into two source files
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-22 16:38:38 +13:00
Jonathan Swartz 06957104f9 Merge branch 'feature/fvdb' into js/voxel-foundation-migration 2024-12-22 16:33:38 +13:00
Jonathan Swartz 2d4f3e1bfe Migrating last PR changes from private repo over to this repo including:
Changes to .clang-format for better include sorting
Gsplat rasterization code cleanup and add unused arguments for pixel mask

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-22 16:30:45 +13:00
Jonathan Swartz 548b52e97e Merge pull request #46 from NVIDIA-Omniverse/js/fvdb_codestyle
Add fVDB code style check actions
2024-12-21 13:56:06 +13:00
Matthew Cong 47c5a29be4 Merge pull request #76 from NVIDIA-Omniverse/nanovdb_merge
Merge changes from latest NanoVDB
2024-12-20 15:59:12 -08:00
Matthew Cong faa644ab3d Merge changes from latest NanoVDB
Signed-off-by: Matthew Cong <mcong@nvidia.com>
2024-12-20 15:58:30 -08:00
Jonathan Swartz ce544bd2ff fix clang-format issue with JCat0.cu
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-21 11:26:13 +13:00
Jonathan Swartz 1f4a9d5617 Merge branch 'feature/fvdb' into js/fvdb_codestyle
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-21 11:22:35 +13:00
Jonathan Swartz 263e0e069e Merge pull request #81 from NVIDIA-Omniverse/fw/fix_jcat0
Fix jagged concatenation when concatenating a JaggedTensor with only one element in it
2024-12-20 11:55:11 +13:00
Francis Williams 200cf246ee Enhance JCat0 kernel to handle empty JIdx tensor case and add unit test for concatenation of JaggedTensors 2024-12-19 16:40:46 -05:00
Jonathan Swartz 6ccc92f0c6 newline
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-19 09:41:24 +13:00
Jonathan Swartz 29606d6a74 Update SPDX identifier action with ignore-paths for source files/dirs that have different licenses
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-18 16:48:33 +13:00
Jonathan Swartz 18fc7dc65d Merge pull request #66 from swahtz/disable_docs_for_fvdb
Disable docs Workflow for fVDB changes
2024-12-18 16:43:42 +13:00
Jonathan Swartz 3b5458baad Merge pull request #62 from NVIDIA-Omniverse/master
Updating `feature/fvdb` from `master`
2024-12-18 16:39:25 +13:00
Jonathan Swartz 5ac52485b1 Disabling docs action for fvdb changes
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-18 14:09:10 +13:00
Jonathan Swartz 1d9c7345b6 Addressing review notes
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-17 17:56:40 +13:00
Jonathan Swartz 7053bfd0d2 Fix codestyle source paths
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-17 14:31:07 +13:00
Jonathan Swartz a035c14b90 Add fVDB code style check actions
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-17 09:04:33 +13:00
Jonathan Swartz 70566d7fb2 Merge pull request #45 from NVIDIA-Omniverse/js/fvdb_actions
Add fVDB CI
2024-12-17 08:36:57 +13:00
Jonathan Swartz f70b1a570f Turn off explicit instantiation for debug linux build
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-16 21:56:45 +13:00
Jonathan Swartz 128be93972 fVDB continuous benchmaring results path fix
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-16 13:46:57 +13:00
Jonathan Swartz f088f173d1 Fixing fvdb wheel upload path
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-16 13:07:12 +13:00
Jonathan Swartz 43a5220700 Adding fvdb CI unit tests to github workflows
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-13 12:26:18 +13:00
Jonathan Swartz 38adbab1bc Updating the versions of checkout action; add .gitmodules to ignore list
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-13 11:40:50 +13:00
Jonathan Swartz 093a6382ae fVDB: Added 'projects' directory to include more fully-featured example 'batteries included' projects
Added panoptic segmentation project with MaskPLS implementation
Fixed install issue not including `fvdb.optim`
Re-introduced support for Volta&Turing but added errors for use of certain conv backends
Added interpolation functions to VDBTensor

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-11 15:47:23 +13:00
Jonathan Swartz 11836adebd Merge branch 'master' into feature/fvdb
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-06 12:35:18 +13:00
Jonathan Swartz f7b18d9d7b fVDB: Fix missing fvdb.utils.data modules
Expose various 'ELU non-linearities
Integer JaggedReduce
Updated build TORCH_CUDA_ARCH_LIST for supported CUDA compute architectures, fixed Docker dev and CI images
Updated REAME's env and build instructions

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-12-03 20:11:34 +13:00
Jonathan Swartz f1d9e2bc08 Version 0.2.0 release:
• Significant refactor of gaussian splatting pipeline
• Refactor of examples/3dgs using the new 3dgs pipeline (see README for a starting point to the example)
• License identifiers changed to Apache 2.0 to be in line with OpenVDB
• A `dev_environment.yml` is now included to help construct a reccommended development environment
• A bug was fixed when using `GridBatch.ijk_to_inv_index(cumulative=False)` when the ijk argument has repeated elements
• GLM is being vendored in and is no longer a runtime dependency
• The utility functions needed in the examples and unit tests to download and read the relevant data files has been refactored into `fvdb.utils.tests` and `fvdb.utils.examples` respectively

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-11-12 17:44:24 +13:00
Jonathan Swartz 7496bfa45c Merge pull request #1934 from JamesPerlman/patch-1
fVDB: Fix typo in 01_api_basics.ipynb
2024-10-23 07:35:27 +13:00
James Perlman 3d4a21b185 Update 01_api_basics.ipynb
There are 5 random features per voxel, and 8 grids.  Not 8 random features per voxel.

Signed-off-by: James Perlman <jam.e.perl@gmail.com>
2024-10-11 13:07:59 -07:00
Jonathan Swartz 6faf27c7cb Merge pull request #1915 from swahtz/feature/fvdb
Merge new commits from fVDB repository
2024-09-26 21:01:05 +12:00
Jonathan Swartz b5922af1cb Merge commits from fVDB repository including:
Version v0.1.0 release
Added gaussian splatting support
Significant VDBTensor API rewrite as well as various GridBatch function name changes to make them more consistent

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-09-26 20:47:01 +12:00
Jonathan Swartz f0324e6fca Merge pull request #1907 from AcademySoftwareFoundation/master
Merge master to feature/fvdb
2024-09-18 20:31:54 +12:00
Jonathan Swartz 9accf19836 Merge pull request #1891 from swahtz/feature/fvdb
fVDB improved test setup and PyTorch 2.4 update
2024-09-17 13:32:09 +12:00
Jonathan Swartz 4592f6c887 Updated fVDB requirements and documentation to PyTorch 2.4
Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-09-16 21:04:12 +12:00
Jonathan Swartz 5de7ee4da9 Moved all test data to an external repository and updated tests
Updated Github test actions to split apart build and test steps
Added negative operator to JaggedTensor; to operators to SparseConvPackInfo

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-09-06 21:25:33 +12:00
apradhana 70e0264ed1 Merge pull request #1886 from swahtz/feature/fvdb
fVDB Updates: Bugs fixed for multi-GPU support, JaggedTensor slicing/indexing CUDA kernels
2024-09-04 12:09:21 -07:00
Jonathan Swartz 52ba85af93 Bugs fixed for multi-GPU support
JaggedTensor slicing and indexing moved to CUDA kernels
Small updates to basic_concepts docs and README

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-09-02 18:17:30 +12:00
apradhana 975beecdb6 Merge pull request #1876 from swahtz/feature/fvdb
fVDB code format updates
2024-08-20 20:33:09 -07:00
Jonathan Swartz c9aee5964a Formatting changes to match OpenVDB guidelines
Added examples
Updated README and environment/docker updates

Signed-off-by: Jonathan Swartz <jonathan@jswartz.info>
2024-08-21 10:47:20 +12:00
apradhana c99b17c85c Merge pull request #1869 from swahtz/feature/fvdb
Updates to fVDB
2024-08-13 17:24:05 -07:00
Jonathan Swartz 9357034f9a fVDB changes including:
•Reintroduced missing src/build/* files that were accidentally ommitted
•JaggedTensor concatentation moved to a cuda kernel
•Non-cumulative indices for ijk mappings is now the default return style (makes indexing into JaggedTensors of data more natural)
•cuDNN disabled for CUDA versions <12
•Updated notebook files to new API and now included
•Removed deprecated usage of `python setup.py test` and running pytest directly

Signed-off-by: Jonathan Swartz <jonathan@swartzfx.com>
2024-08-14 11:54:20 +12:00
apradhana 63f7ab0da4 Merge pull request #1862 from fwilliams/fw/fvdb
Commit fVDB to OpenVDB
2024-07-23 12:01:25 -07:00
Francis Williams 9b178ba16c Commit fVDB to OpenVDB
Signed-off-by: Francis Williams <francis@fwilliams.info>
2024-07-23 14:40:41 -04:00
1191 changed files with 161233 additions and 107824 deletions
+1
View File
@@ -0,0 +1 @@
+20 -25
View File
@@ -30,6 +30,9 @@ on:
- 'fvdb/**'
- 'pendingchanges/**'
- '**.md'
schedule:
# run this workflow every day 7am UTC
- cron: '0 7 * * *'
workflow_dispatch:
inputs:
type:
@@ -52,7 +55,7 @@ jobs:
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'linux'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
name: >
linux-ax:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
container:
@@ -64,22 +67,17 @@ jobs:
matrix:
# Only test unified builds (core+ax). weekly CI should test standalone
config:
- { image: '2026', cxx: 'clang++', build: 'Release', cmake: '' }
- { image: '2026', cxx: 'g++', build: 'Release', cmake: '' }
- { image: '2026', cxx: 'clang++', build: 'Debug', cmake: '' }
- { image: '2025-clang19.1', cxx: 'clang++', build: 'Release', cmake: '' }
- { image: '2024-clang16.2', cxx: 'clang++', build: 'Release', cmake: '' }
# Needed to test LLVM 15.X
- { image: '2023-clang15', cxx: 'clang++', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
- { image: '2023-clang15', cxx: 'clang++', build: 'Release', cmake: '' }
- { image: '2023-clang15', cxx: 'g++', build: 'Release', cmake: '' }
- { image: '2023-clang15', cxx: 'clang++', build: 'Debug', cmake: '' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
# 2026 images are broken with gtest/glfw installs
- name: deps
if: contains(matrix.config.image, '2026')
run: ./ci/install_gtest.sh latest
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_nanobind.sh 2.0.0
- name: install_gtest
run: ./ci/install_gtest.sh 1.15.2
- name: timestamp
id: timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
@@ -96,11 +94,12 @@ jobs:
run: >
./ci/build.sh -v
--build-type=${{ matrix.config.build }}
--components='core,python,axcore,axbin,axtest'
--components='core,python,bin,axcore,axbin,axtest'
--cargs=\"
${{ matrix.config.cmake }}
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DOPENVDB_CXX_STRICT=ON
\"
- name: test
run: cd build && ctest -V
@@ -123,13 +122,9 @@ jobs:
strategy:
matrix:
config:
- { runner: 'macos-15', cxx: 'clang++', build: 'Release', llvm: '21' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '21' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '20' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '19' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '18' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '17' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Release', llvm: '16' }
# Last macos runner before M1 (macos-14)
- { runner: 'macos-13', cxx: 'clang++', build: 'Release', llvm: '15' }
- { runner: 'macos-13', cxx: 'clang++', build: 'Release', llvm: '13' }
fail-fast: false
steps:
- uses: actions/checkout@v3
@@ -141,7 +136,7 @@ jobs:
run: >
./ci/build.sh -v
--build-type=${{ matrix.config.build }}
--components="core,python,axcore,axbin,axtest"
--components="core,python,bin,axcore,axbin,axtest"
--cargs=\"
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
@@ -157,15 +152,15 @@ jobs:
if: |
github.event_name == 'workflow_dispatch' &&
github.event.inputs.type == 'grammar'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
container:
image: aswf/ci-openvdb:2025-clang19.1
image: aswf/ci-openvdb:2023-clang15
steps:
- uses: actions/checkout@v3
- name: build
run: ./ci/build.sh -v --components=axgr --target=openvdb_ax_grammar --cargs=\"-DOPENVDB_AX_GRAMMAR_NO_LINES=ON\"
- name: upload grammar
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v2
with:
name: ax_grammar
path: ./build/openvdb_ax/openvdb_ax/openvdb_ax/grammar
+35 -41
View File
@@ -19,8 +19,6 @@ on:
- 'pendingchanges/**'
- '**.md'
pull_request:
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
types: [opened, synchronize, reopened, ready_for_review]
branches:
- '**'
paths-ignore:
@@ -34,6 +32,12 @@ on:
- 'fvdb/**'
- 'pendingchanges/**'
- '**.md'
schedule:
# run this workflow every day at 7am UTC except Monday
- cron: '0 7 * * 0,2-6'
# run this workflow Monday 7am UTC
# warning: This pattern is checked in various places below
- cron: '0 7 * * 1'
workflow_dispatch:
inputs:
type:
@@ -55,13 +59,15 @@ jobs:
# VFX platform jobs. These are run on the appropriate CentOS images from
# the provided ASWF docker containers
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'linux'
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
name: >
linux:${{ matrix.config.image }}-abi:${{ matrix.config.abi }}-cxx:${{ matrix.config.cxx }}-type:${{ matrix.config.build }}
linux-vfx:${{ matrix.config.image }}-
abi:${{ matrix.config.abi }}-
cxx:${{ matrix.config.cxx }}-
type:${{ matrix.config.build }}
container:
image: aswf/ci-openvdb:${{ matrix.config.image }}
env:
@@ -70,22 +76,21 @@ jobs:
strategy:
matrix:
config:
- { cxx: clang++, image: '2026', abi: '13', build: 'Release', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON -DOPENVDB_ENABLE_ASSERTS=ON' }
- { cxx: g++, image: '2026', abi: '13', build: 'Release', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON' }
- { cxx: clang++, image: '2026', abi: '13', build: 'Debug', cmake: '-DOPENVDB_USE_FUTURE_ABI_13=ON' }
- { cxx: clang++, image: '2025-clang19.1', abi: '12', build: 'Release', cmake: '' }
- { cxx: clang++, image: '2024-clang17.2', abi: '11', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
- { cxx: clang++, image: '2024', abi: '12', build: 'Release', cmake: '' }
- { cxx: g++, image: '2024', abi: '12', build: 'Release', cmake: '' }
- { cxx: clang++, image: '2024', abi: '12', build: 'Debug', cmake: '' }
- { cxx: clang++, image: '2023', abi: '11', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
- { cxx: g++, image: '2023', abi: '11', build: 'Release', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
# 2026 images are broken with gtest/glfw installs
- name: deps
if: contains(matrix.config.image, '2026')
run: |
./ci/install_gtest.sh latest
./ci/install_glfw.sh latest
run: ./ci/install_nanobind.sh 2.0.0
- name: glfw
if: contains(matrix.config.image, '2023') == true
run: ./ci/install_glfw.sh 3.3.10
- name: install_gtest
run: ./ci/install_gtest.sh 1.15.2
- name: timestamp
id: timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
@@ -109,8 +114,9 @@ jobs:
-DOPENVDB_ABI_VERSION_NUMBER=${{ matrix.config.abi }}
\"
- name: test
# Skip Debug on commits as they take a while.
if: github.event_name == 'workflow_dispatch' || matrix.config.build == 'Release'
# Always run tests on weekly builds but skip Debug on commits as they take a while.
# https://github.community/t/distinct-job-for-each-schedule/17811/2
if: contains(github.event.schedule, '0 7 * * 1') || matrix.config.build == 'Release'
run: |
cd build && ctest -V
cd - && ./ci/test_install.sh
@@ -122,10 +128,9 @@ jobs:
windows:
# Windows CI. Tests a dynamic build with MD.
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'win'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
name: windows
env:
@@ -143,9 +148,6 @@ jobs:
- name: install
shell: powershell
run: .\ci\install_windows.ps1
- name: install_numpy
shell: powershell
run: .\ci\install_windows_numpy.ps1
- name: build
run: >
./ci/build.sh -v
@@ -167,19 +169,12 @@ jobs:
macos:
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
runs-on: ${{ matrix.config.image }}
name: ${{ matrix.config.image }}
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'mac'
runs-on: macos-13 # Last macos runner befor M1 (macos-14)
env:
CXX: clang++
strategy:
matrix:
config:
- { image: macos-14 }
- { image: macos-15 }
steps:
- uses: actions/checkout@v3
- name: install
@@ -196,4 +191,3 @@ jobs:
\'
- name: test
run: cd build && ctest -V
+19 -38
View File
@@ -11,6 +11,7 @@ on:
- 'CHANGES'
- 'openvdb_maya/**'
- 'pendingchanges/**'
- '**.md'
pull_request:
branches:
- '**'
@@ -18,6 +19,7 @@ on:
- 'CHANGES'
- 'openvdb_maya/**'
- 'pendingchanges/**'
- '**.md'
workflow_dispatch:
inputs:
deploy:
@@ -31,41 +33,27 @@ concurrency:
cancel-in-progress: true
jobs:
validate_docs:
# Cheap static checks that run before the heavier doxygen build:
# * every #include <...> referenced from a fenced code block in doc/ resolves
# * every github.com/.../blob/<branch>/<path> URL points to a file on disk
# Catches the class of docs-rot from issue #2161 (e.g. nanovdb::util ->
# nanovdb::tools rename) before the doxygen job runs.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set_up_python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: run_validator
run: python3 ci/validate_docs_references.py
doxygen:
needs: validate_docs
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ubuntu-latest
env:
CXX: g++
container:
image: aswf/ci-openvdb:2026
# @note We can't update this as epydoc doesn't support python3. We'll
# need to re-write the python docs to use sphinx
image: aswf/ci-openvdb:2024
steps:
- uses: actions/checkout@v4
- name: install_doxygen
run: ./ci/install_doxygen.sh 1_14_0
run: ./ci/install_doxygen.sh 1_8_11
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_nanobind.sh 2.0.0
# - name: install_epydoc
# run: pip install epydoc
- name: install_latex
run: |
yum -y install texlive-latex-bin texlive-dvips texlive-collection-fontsrecommended texlive-collection-latexrecommended
- name: build
# Doxygen's native WARN_AS_ERROR=FAIL_ON_WARNINGS gates the docs build:
# any warning fails the job. FAIL_ON_WARNINGS still generates the docs and
# writes the full warning log first, so the artifact step below captures
# it for debugging. Enabled via OPENVDB_DOXYGEN_WARN_AS_ERROR (see
# doc/CMakeLists.txt).
run: >
./ci/build.sh -v
--build-type=Release
@@ -76,18 +64,10 @@ jobs:
-DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON
-DOPENVDB_DOXYGEN_WARN_AS_ERROR=ON
\"
- name: upload_doxygen_warning_log
# Always upload so contributors can debug failed PR builds without
# having to reproduce the doxygen environment locally.
if: always()
uses: actions/upload-artifact@v4
with:
name: doxygen-warnings
path: build/doc/doxygen.warnings.log
if-no-files-found: ignore
retention-days: 14
# - name: epydoc
# run: |
# epydoc --html -o /usr/local/share/doc/OpenVDB/html/python pyopenvdb
- name: pre_deploy
# Overwrite global SSH configuration
# https://github.com/peaceiris/actions-gh-pages/issues/719
@@ -126,7 +106,7 @@ jobs:
github.event.inputs.deploy == 'coverage'
runs-on: ubuntu-latest
container:
image: aswf/ci-openvdb:2025-clang19.1
image: aswf/ci-openvdb:2023
env:
CXX: g++
steps:
@@ -176,3 +156,4 @@ jobs:
- Deployed from: AcademySoftwareFoundation/openvdb ${{ github.sha }}
Signed-off-by: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>"
+118
View File
@@ -0,0 +1,118 @@
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
#
# GitHub Actions workflow file
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: fVDB Codebuild
on:
pull_request:
paths-ignore:
- 'CHANGES'
- 'CODEOWNERS'
- 'doc/**'
- 'openvdb/**'
- 'openvdb_cmd/**'
- 'openvdb_ax/**'
- 'openvdb_maya/**'
- 'openvdb_houdini/**'
- 'nanovdb/**'
- 'pendingchanges/**'
- '**.md'
- 'fvdb/debug/**'
- 'fvdb/docs/**'
- 'fvdb/examples/**'
- 'fvdb/notebooks/**'
- 'fvdb/scripts/**'
permissions:
contents: read
id-token: write
jobs:
# ---------------------------------------------------------------------------
# Linux GPU (AWS CodeBuild)
# ---------------------------------------------------------------------------
linux_gpu:
name: 'ci-openvdb 2024'
# Don't run on forks
if: github.repository == 'AcademySoftwareFoundation/openvdb'
# GH-hosted VM. The build runs in CentOS 7 'container' hard-coded in
# AWS CodeBuild project.
# TODO: Add support for dynamic GH Action defined CodeBuild
# container choice.
runs-on: ubuntu-latest
steps:
- name: Verify AWS Credentials Set
run: |
if [ -z "${{ secrets.CODEBUILD_ID }}" ] || [ -z "${{ secrets.CODEBUILD_SECRET }}" ]; then
echo "Error: AWS credentials secrets not properly configured"
echo "Please ensure CODEBUILD_ID and CODEBUILD_SECRET are set in organization secrets"
exit 1
fi
echo "AWS credentials secrets are configured"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.CODEBUILD_ID }}
aws-secret-access-key: ${{ secrets.CODEBUILD_SECRET }}
aws-region: us-west-2
- name: Verify AWS Authentication
run: |
echo "Testing AWS authentication..."
aws sts get-caller-identity || {
echo "Error: AWS authentication failed"
exit 1
}
echo "AWS authentication successful"
- name: CodeBuild Monitoring URLs
run: |
echo "🚀 Starting CodeBuild job..."
echo "Project: OpenVDB"
echo ""
echo "📊 Monitor the build progress at:"
# Check if public builds are enabled by looking for the public project URL
PUBLIC_URL=$(aws codebuild batch-get-projects --names OpenVDB --query 'projects[0].publicProjectUrl' --output text 2>/dev/null || echo "None")
if [ "$PUBLIC_URL" != "None" ] && [ "$PUBLIC_URL" != "null" ]; then
echo "📖 Public Build Results (no sign-in required):"
echo " $PUBLIC_URL"
echo ""
fi
echo "🔒 AWS Console (requires sign-in):"
echo " Project: https://console.aws.amazon.com/codesuite/codebuild/projects/OpenVDB/history"
echo ""
echo "ℹ️ Individual build URLs will be available once the job starts..."
- name: Run CodeBuild
id: codebuild
uses: aws-actions/aws-codebuild-run-build@v1
with:
project-name: OpenVDB
buildspec-override: ci/buildspec.yml
- name: CodeBuild Results
if: always()
run: |
echo "📋 CodeBuild Results:"
echo "Build ID: ${{ steps.codebuild.outputs.aws-build-id }}"
echo "Build Status: ${{ steps.codebuild.outputs.aws-build-status }}"
echo ""
echo "🔗 Detailed Build Links:"
if [ -n "$CODEBUILD_PUBLIC_BUILD_URL" ]; then
echo "📖 Public Build Details: $CODEBUILD_PUBLIC_BUILD_URL"
fi
echo "🔒 AWS Console Build Details: https://console.aws.amazon.com/codesuite/codebuild/projects/OpenVDB/build/${{ steps.codebuild.outputs.aws-build-id }}/"
echo ""
if [ "${{ steps.codebuild.outputs.aws-build-status }}" != "SUCCEEDED" ]; then
echo "❌ Build failed! Check the build logs at the links above for detailed error information."
echo "Common issues to check:"
echo "- Build environment configuration"
echo "- Source code compilation errors"
echo "- Missing dependencies"
echo "- Buildspec.yml configuration"
else
echo "✅ Build succeeded!"
fi
+80
View File
@@ -0,0 +1,80 @@
name: fVDB Code Style
on:
push:
branches:
- "pull-request/[0-9]+"
paths-ignore:
- 'CHANGES'
- 'CODEOWNERS'
- 'doc/**'
- 'ci/**'
- 'openvdb/**'
- 'openvdb_cmd/**'
- 'openvdb_ax/**'
- 'openvdb_maya/**'
- 'openvdb_houdini/**'
- 'openvdb_wolfram/**'
- 'tsc/**'
- 'nanovdb/**'
- 'pendingchanges/**'
- '**.md'
- 'fvdb/docs/**'
- 'fvdb/env/**'
- 'fvdb/notebooks/**'
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test-python-black-lint:
name: Check Python code style with black
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--check --verbose --target-version=py311 --line-length=120"
src: "fvdb/"
version: "~= 24.0"
test-cpp-clang-format-lint:
name: Check C++ code style with clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: 'fvdb/src/'
extensions: 'h,cpp,cc,cu,cuh'
clangFormatVersion: 18
style: file
include-guards:
name: Check include guards
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: swahtz/include-guards-check-action@master
with:
path: 'fvdb/src/'
check-spdx-identifiers:
name: Check SPDX identifiers
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: swahtz/spdx@feature/ignore_paths
with:
licenses: |-
Apache-2.0
ignore-paths: |-
openvdb/openvdb/math/Half.cc
openvdb/openvdb/math/Half.h
openvdb_wolfram/OpenVDBLink
openvdb_ax/openvdb_ax/grammar/generated
fvdb/projects/panoptic_segmentation/garfield/garfield
+25 -14
View File
@@ -28,6 +28,9 @@ on:
- 'fvdb/**'
- 'pendingchanges/**'
- '**.md'
schedule:
# run this workflow every day 7am UTC
- cron: '0 7 * * *'
workflow_dispatch:
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
@@ -62,8 +65,8 @@ jobs:
if: >
${{ needs.checksecret.outputs.HOUDINI_SECRETS == 'true' ||
github.repository_owner == 'AcademySoftwareFoundation' }}
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
name: hou:${{ matrix.config.hou_hash }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-build:${{ matrix.config.build }}
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
name: hou:${{ matrix.config.hou_hash }}-vfx:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}
container:
image: aswf/ci-base:${{ matrix.config.image }}
env:
@@ -72,18 +75,26 @@ jobs:
strategy:
matrix:
config:
- { cxx: clang++, image: '2026', hou_hash: '21_0', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: clang++, image: '2026', hou_hash: '21_0', build: 'Debug', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: g++, image: '2026', hou_hash: '21_0', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: clang++, image: '2024', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: g++, image: '2024', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: clang++, image: '2024', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test' }
- { cxx: clang++, image: '2023', hou_hash: '20_5', build: 'Debug', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: g++, image: '2023', hou_hash: '20_5', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: clang++, image: '2023', hou_hash: '20_0-newabi', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
- { cxx: g++, image: '2023', hou_hash: '20_0-newabi', build: 'Release', components: 'core,hou,bin,view,render,python,test,axcore,axbin,axtest' }
fail-fast: false
steps:
- name: remove zstd
run: yum -y remove zstd
- uses: actions/checkout@v3
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
#if: contains(matrix.config.image, '2023') == false
run: ./ci/install_nanobind.sh 2.0.0
- name: glfw
if: contains(matrix.config.image, '2023') == true
run: ./ci/install_glfw.sh 3.3.10
- name: cppunit
run: ./ci/install_cppunit.sh 1.15.1
- name: install_gtest
run: ./ci/install_gtest.sh latest
run: ./ci/install_gtest.sh 1.15.2
- name: timestamp
id: timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
@@ -114,7 +125,7 @@ jobs:
- name: build
run: |
./ci/build.sh -v \
--build-type="${{ matrix.config.build }}" \
--build-type=Release \
--components="${{ matrix.config.components }}" \
--cargs=\" \
-DHOUDINI_ROOT=$HOME/houdini_install/hou \
@@ -124,7 +135,6 @@ jobs:
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
\"
- name: test
if: matrix.config.build == 'Release'
run: cd build && ctest -V
# Keep ccache light by stripping out any caches not accessed in the last day
- name: ccache_clean
@@ -155,12 +165,12 @@ jobs:
cp hou/hou.tar.gz $HOME/houdini_install/hou.tar.gz
cd $HOME/houdini_install && tar -xzf hou.tar.gz && cd -
- name: install_deps
run: ./ci/install_macos.sh 20
run: ./ci/install_macos.sh 15
- name: build
run: |
./ci/build.sh -v \
--build-type=Release \
--components="core,hou,bin,view,render,test,axcore,axbin" \
--components="core,hou,bin,view,render,python,test,axcore,axbin" \
--cargs=\" \
-DHOUDINI_ROOT=$HOME/houdini_install/hou \
-DOPENVDB_BUILD_HOUDINI_ABITESTS=OFF \
@@ -168,7 +178,8 @@ jobs:
-DDISABLE_CMAKE_SEARCH_PATHS=ON \
-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON \
-DUSE_EXPLICIT_INSTANTIATION=OFF \
-DLLVM_DIR=/opt/homebrew/opt/llvm@20/lib/cmake/llvm \
-DTbb_INCLUDE_DIR=$HOME/houdini_install/hou/Frameworks/Houdini.framework/Versions/Current/Resources/toolkit/include/tbb \
-DLLVM_DIR=/opt/homebrew/opt/llvm@15/lib/cmake/llvm \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
\"
- name: test
+34 -41
View File
@@ -18,8 +18,6 @@ on:
- 'pendingchanges/**'
- '**.md'
pull_request:
# Add 'ready_for_review' to run CI when a draft PR is marked ready.
types: [opened, synchronize, reopened, ready_for_review]
branches:
- '**'
paths-ignore:
@@ -32,6 +30,9 @@ on:
- 'fvdb/**'
- 'pendingchanges/**'
- '**.md'
schedule:
# run this workflow every day 7am UTC
- cron: '0 7 * * *'
workflow_dispatch:
inputs:
type:
@@ -46,13 +47,11 @@ concurrency:
jobs:
linux-nanovdb:
# push OR non-draft PR OR matching manual run
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'linux'
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
name: >
linux-nanovdb:cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
container:
@@ -62,44 +61,42 @@ jobs:
strategy:
matrix:
config:
- { cxx: g++, image: '2024-clang17.2', build: 'Release' }
- { cxx: g++, image: '2024-clang17.2', build: 'Debug' }
- { cxx: clang++, image: '2024-clang17.2', build: 'Release' }
- { cxx: clang++, image: '2024-clang17.2', build: 'Debug' }
- { cxx: g++, image: '2024', build: 'Release' }
- { cxx: g++, image: '2024', build: 'Debug' }
- { cxx: clang++, image: '2024', build: 'Release' }
- { cxx: clang++, image: '2024', build: 'Debug' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: setup_cuda_12
run: |
yum -y install yum-utils
echo "/usr/local/cuda-12/bin" >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=/usr/local/cuda-12/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
- name: build
# NOTE: CMAKE_POSITION_INDEPENDENT_CODE set to fix default behaviour change in clang 14
# https://github.com/AcademySoftwareFoundation/aswf-docker/issues/228
run: >
./ci/build.sh -v
--build-type=${{ matrix.config.build }}
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
--components=core,nano,nanotest,nanoexam,nanobench,nanotool
--cargs=\'
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DNANOVDB_USE_CUDA=ON
-DCMAKE_CUDA_ARCHITECTURES="80"
-DNANOVDB_USE_OPENVDB=ON
-DCMAKE_INSTALL_PREFIX=`pwd`
-DUSE_BLOSC=ON
-DUSE_BLOSC=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
\'
- name: test
run: cd build && sudo ctest -V -E ".*cuda.*|.*mgpu.*"
run: cd build && sudo ctest -V -E ".*cuda.*"
windows-nanovdb:
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'win')))
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'win'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
env:
VCPKG_DEFAULT_TRIPLET: 'x64-windows'
@@ -121,41 +118,38 @@ jobs:
shell: powershell
run: .\ci\install_windows.ps1
- name: build
# nvcc doesn't set _WIN32 when run in bash so we need to set it manually
shell: bash
run: >
./ci/build.sh -v
--config=Release
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
--components=core,nano,nanotest,nanoexam,nanobench,nanotool
--cargs=\'
-A x64 -G \"Visual Studio 17 2022\" -DOPENVDB_CORE_STATIC=OFF
-DMSVC_COMPRESS_PDB=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DNANOVDB_USE_CUDA=ON
-DCMAKE_CUDA_ARCHITECTURES="80"
-DCMAKE_CUDA_FLAGS="-D_WIN32"
-DNANOVDB_USE_OPENVDB=ON
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
\'
- name: test
shell: bash
run: cd build && ctest -V -C Release -E ".*cuda.*|.*mgpu.*"
run: cd build && ctest -V -E ".*cuda.*"
macos-nanovdb:
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'mac')))
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'mac'
runs-on: ${{ matrix.config.runner }}
env:
CXX: ${{ matrix.config.cxx }}
strategy:
matrix:
config:
- { runner: 'macos-14', cxx: 'clang++', build: 'Release' }
- { runner: 'macos-14', cxx: 'clang++', build: 'Debug' }
- { runner: 'macos-13', cxx: 'clang++', build: 'Release' }
- { runner: 'macos-13', cxx: 'clang++', build: 'Debug' }
fail-fast: false
steps:
- uses: actions/checkout@v3
@@ -167,24 +161,23 @@ jobs:
run: >
./ci/build.sh -v
--build-type=${{ matrix.config.build }}
--components=core,nano,nanotest,nanoexam,nanobench,nanotool,nanopython,nanopytest
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DNANOVDB_USE_CUDA=OFF -DNANOVDB_USE_OPENVDB=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \'
--components=core,nano,nanotest,nanoexam,nanobench,nanotool
--cargs=\'-DUSE_EXPLICIT_INSTANTIATION=OFF -DNANOVDB_USE_CUDA=OFF -DNANOVDB_USE_OPENVDB=ON\'
- name: test
run: cd build && ctest -V -E ".*cuda.*|.*mgpu.*"
run: cd build && ctest -V -E ".*cuda.*"
nanovdb-lite:
if: |
(github.event_name == 'push' ||
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
(github.event_name == 'workflow_dispatch' &&
(github.event.inputs.type == 'all' || github.event.inputs.type == 'linux')))
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'linux'
runs-on: ${{ (github.repository_owner == 'NVIDIA-Omniverse' && 'linux-amd64-cpu32') || (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
container:
image: aswf/ci-openvdb:2024-clang17.2
image: aswf/ci-openvdb:2024
steps:
- uses: actions/checkout@v3
- name: install_gtest
run: ./ci/install_gtest.sh latest
run: ./ci/install_gtest.sh 1.15.2
- name: build_and_test
run: |
cd nanovdb/nanovdb
+54 -68
View File
@@ -61,7 +61,7 @@ jobs:
(github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'houdini')
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
name: linux-houdini:${{ matrix.config.hou_hash }}
env:
CXX: clang++
@@ -70,13 +70,23 @@ jobs:
strategy:
matrix:
config:
- { houdini_version: '21.0', platform: 'linux_x86_64_gcc11.2', hou_hash: '21_0' }
- { houdini_version: '20.0', platform: 'linux_x86_64_gcc11.2', hou_hash: '20_0-newabi' }
- { houdini_version: '20.5', platform: 'linux_x86_64_gcc11.2', hou_hash: '20_5' }
fail-fast: false
container:
image: aswf/ci-base:2024
steps:
- uses: actions/checkout@v3
# We bumped from the 2021 CI image to 2023 here to fix some OpenSSL issues
# with the Houdini download script. In so doing we broke some of the caching
# between this job and the jobs in houdini.yml which _don't_ use the 2023
# image yet. The issue is that the cache action will use zstd if it's
# available to zip the cache and this causes it to be inserted with a unique
# hash which images without zstd (i.e. the 2021/2022 images don't have
# access to). For now, uninstall zstd here instead of installing it
# everywhere and ask the LF to add zstd to the older base images.
- name: remove zstd
run: yum -y remove zstd
- name: timestamp
id: timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
@@ -103,7 +113,7 @@ jobs:
# Note that macos-14 (current macos-latest) switches to M1. We could instead test
# the arm build here instead of the x86 one.
runs-on: macos-latest
name: macos-houdini
name: macos-houdini-20
env:
HOUDINI_CLIENT_ID: ${{ secrets.HOUDINI_CLIENT_ID }}
HOUDINI_SECRET_KEY: ${{ secrets.HOUDINI_SECRET_KEY }}
@@ -113,7 +123,7 @@ jobs:
id: timestamp
run: echo "timestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: download_houdini
run: ./ci/download_houdini.sh 21.0 macosx_arm64_clang15.0_14 --prod
run: ./ci/download_houdini.sh 20.0 macosx_arm64_clang14.0_13 --prod
- name: install_houdini
run: |
mkdir $HOME/houdini_install
@@ -136,38 +146,31 @@ jobs:
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'extra'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
name: linux-extra:${{ matrix.config.name }}
container:
image: aswf/ci-openvdb:${{ matrix.config.image }}
image: aswf/ci-openvdb:2024
env:
CXX: clang++
strategy:
matrix:
config:
- { name: 'all', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=ON -DUSE_ZLIB=ON -DUSE_EXR=ON -DUSE_PNG=ON' }
- { name: 'lite', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF -DUSE_EXR=OFF -DUSE_PNG=OFF' }
- { name: 'half', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_IMATH_HALF=ON' }
- { name: 'simd', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_X86_INSTRSET=7 -DUSE_VCL=ON' } # 7=AVX
- { name: 'pygrid', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON' }
- { name: 'asan', image: '2026', build: 'asan', components: 'core,test', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON -DNANOVDB_USE_OPENVDB=ON -DOPENVDB_AX_STATIC=OFF -DOPENVDB_CORE_STATIC=OFF -DUSE_BLOSC=OFF' } # We never called blosc_destroy(), so disable blosc to silence these errors
- { name: 'ubsan', image: '2026', build: 'ubsan', components: 'core,test', cmake: '-DDISABLE_DEPENDENCY_VERSION_CHECKS=ON -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" ' }
- { name: 'c++20', image: '2026', build: 'Release', components: 'core,test', cmake: '-DCMAKE_CXX_STANDARD=20' }
- { name: 'abi14', image: '2026', build: 'Release', components: 'core,test', cmake: '-DOPENVDB_USE_FUTURE_ABI_14=ON -DOPENVDB_ENABLE_ASSERTS=ON' }
- { name: 'conf', image: '2026', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON' }
- { name: 'all', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=ON -DUSE_ZLIB=ON -DUSE_EXR=ON -DUSE_PNG=ON' }
- { name: 'lite', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_ZLIB=OFF -DUSE_EXR=OFF -DUSE_PNG=OFF -DOPENVDB_USE_DELAYED_LOADING=OFF' }
- { name: 'half', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_BLOSC=OFF -DUSE_IMATH_HALF=ON' }
- { name: 'sse', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_SIMD=SSE42' }
- { name: 'avx', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DOPENVDB_SIMD=AVX' }
- { name: 'numpy', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DUSE_NUMPY=ON -DOPENVDB_PYTHON_WRAP_ALL_GRID_TYPES=ON' }
- { name: 'asan', build: 'asan', components: 'core,test', cmake: '-DNANOVDB_USE_OPENVDB=ON -DOPENVDB_AX_STATIC=OFF -DOPENVDB_CORE_STATIC=OFF -DUSE_BLOSC=OFF' } # We never called blosc_destroy(), so disable blosc to silence these errors
- { name: 'ubsan', build: 'ubsan', components: 'core,test', cmake: '-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" ' }
- { name: 'c++20', build: 'Release', components: 'core,test', cmake: '-DCMAKE_CXX_STANDARD=20' }
- { name: 'conf', build: 'Release', components: 'core,python,bin,view,render,test', cmake: '-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
# 2026 images are broken with gtest/glfw/exr installs
- name: deps
if: contains(matrix.config.image, '2026')
run: |
./ci/install_gtest.sh latest
./ci/install_glfw.sh latest
./ci/install_imath.sh v3.2.2
./ci/install_exr.sh v3.2.2
#if: contains(container.image, '2023') == false
run: ./ci/install_nanobind.sh 2.0.0
- name: build
run: >
./ci/build.sh -v
@@ -189,22 +192,21 @@ jobs:
strategy:
matrix:
config:
# llvm-17 is currently the default which has symbol issues with the python module
- { runson: ubuntu-latest, cxx: g++, cmake: '-DOPENVDB_PYTHON_USE_AX=OFF' }
- { runson: ubuntu-latest, cxx: g++, cmake: '' }
# Disable the clang job for now. See https://github.com/actions/runner-images/issues/8659
# - { runson: ubuntu-latest, cxx: clang++, cmake: '' }
# @todo gcc on macos
- { runson: macos-latest, cxx: '', cmake: '-DLLVM_DIR=/opt/homebrew/opt/llvm@20/lib/cmake/llvm' }
- { runson: macos-latest, cxx: '', cmake: '-DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@15/bin/clang++ -DLLVM_DIR=/opt/homebrew/opt/llvm@15/lib/cmake/llvm' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: install_deps
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get -q install -y libboost-dev libboost-iostreams-dev libtbb-dev libblosc-dev libgtest-dev libgmock-dev python3-numpy
./ci/install_nanobind.sh 2.5.0
sudo apt-get -q install -y libboost-dev libboost-iostreams-dev libtbb-dev libblosc-dev llvm-dev libgtest-dev libcppunit-dev
./ci/install_nanobind.sh 2.0.0
elif [ "$RUNNER_OS" == "macOS" ]; then
./ci/install_macos.sh 20
./ci/install_macos.sh 15
./ci/install_tbb_macos.sh
else
echo "$RUNNER_OS not supported"; exit 1
@@ -214,11 +216,7 @@ jobs:
./ci/build.sh -v
--build-type=Release
--components=\"core,axcore,python,bin,render,test,axbin\"
--cargs=\'
-DCMAKE_CXX_STANDARD=20
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
${{ matrix.config.cmake }}
\'
--cargs=\"-DCMAKE_CXX_STANDARD=20 -DOPENVDB_USE_DELAYED_LOADING=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ matrix.config.cmake }}\"
- name: test
run: cd build && ctest -V
@@ -255,10 +253,6 @@ jobs:
- name: install
shell: powershell
run: .\ci\install_windows.ps1
- name: install_numpy
if: matrix.config.vc == 'x64-windows'
shell: powershell
run: .\ci\install_windows_numpy.ps1
- name: build
run: >
./ci/build.sh -v
@@ -290,7 +284,7 @@ jobs:
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'ax'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
name: >
linux-ax:${{ matrix.config.image }}-cxx:${{ matrix.config.cxx }}-${{ matrix.config.build }}
container:
@@ -300,14 +294,15 @@ jobs:
strategy:
matrix:
config:
- { image: '2025-clang18.1', cxx: 'clang++', build: 'Release', components: 'core,axcore,axbin,axtest', cmake: '' }
# @note LLVM 17 builds are incompatible with the vdb python plugin on linux
- { image: '2024-clang17.2', cxx: 'clang++', build: 'Release', components: 'core,axcore,axbin,axtest', cmake: '-DOPENVDB_PYTHON_USE_AX=OFF' }
# Unified
- { image: '2023-clang15', cxx: 'clang++', build: 'Release', components: 'core,bin,axcore,axbin,axtest', cmake: '' }
- { image: '2023-clang15', cxx: 'g++', build: 'Release', components: 'core,bin,axcore,axbin,axtest', cmake: '' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: nanobind
run: ./ci/install_nanobind.sh 2.5.0
#f: contains(matrix.config.image, '2023') == false
run: ./ci/install_nanobind.sh 2.0.0
- name: build
run: >
./ci/build.sh -v
@@ -318,7 +313,6 @@ jobs:
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DOPENVDB_CXX_STRICT=ON
-DOPENVDB_BUILD_VDB_TOOL=OFF
\"
- name: clean
if: matrix.config.components == 'core'
@@ -334,7 +328,6 @@ jobs:
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DOPENVDB_CXX_STRICT=ON
-DOPENVDB_BUILD_VDB_TOOL=OFF
\"
- name: test
run: cd build && ctest -V
@@ -346,14 +339,14 @@ jobs:
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'ax'
runs-on: ${{ matrix.config.runner }}
runs-on: macos-13
name: macos-cxx:${{ matrix.config.cxx }}-llvm:${{ matrix.config.llvm }}-${{ matrix.config.build }}
env:
CXX: ${{ matrix.config.cxx }}
strategy:
matrix:
config:
- { runner: 'macos-latest', cxx: 'clang++', build: 'Release', llvm: '20' }
- { cxx: 'clang++', build: 'Release', llvm: '15' }
fail-fast: false
steps:
- uses: actions/checkout@v3
@@ -383,7 +376,7 @@ jobs:
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'ax'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'windows-2022-8c-32g-300h') || 'windows-latest' }}
name: ${{ matrix.config.vc }}-${{ matrix.config.crt }}-${{ matrix.config.build }}-llvm${{ matrix.config.llvm }}
name: windows-vc:${{ matrix.config.vc }}-type:${{ matrix.config.build }}
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vc }}
# Export this with '' avoid bash treating \ as escape
@@ -397,22 +390,17 @@ jobs:
# @todo We don't currently run the axtests with shared builds of ax
# due to symbol issues using LLVM as a static lib (which is the only
# option on Windows).
# @note currently only test static builds with MT as building LLVM as
# a shared lib on windows is a bit dicey
- { vc: 'x64-windows-static', llvm: '18.1.0', crt: 'MultiThreaded', components: 'core,axcore,axbin,axtest', build: 'Release', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
- { vc: 'x64-windows-static', llvm: '18.1.0', crt: 'MultiThreadedDebug', components: 'core,axcore,axbin,axtest', build: 'Debug', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
- { vc: 'x64-windows', llvm: '18.1.0', crt: 'MultiThreadedDLL', components: 'core,axcore,axbin', build: 'Release', cmake: '-DOPENVDB_CORE_STATIC=OFF -DOPENVDB_AX_STATIC=OFF' }
- { vc: 'x64-windows-static', llvm: '15.0.0', crt: 'MultiThreaded', components: 'core,axcore,axbin,axtest', build: 'Release', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
- { vc: 'x64-windows', crt: 'MD', components: 'core,bin,axcore,axbin,python', build: 'Release', cmake: '-DOPENVDB_CORE_STATIC=OFF -DOPENVDB_AX_STATIC=OFF' }
- { vc: 'x64-windows-static', crt: 'MT', components: 'core,bin,axcore,axbin,axtest', build: 'Release', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
- { vc: 'x64-windows-static', crt: 'MTd', components: 'core,bin,axcore,axbin,axtest', build: 'Debug', cmake: '-DOPENVDB_CORE_SHARED=OFF -DOPENVDB_AX_SHARED=OFF -DUSE_STATIC_DEPENDENCIES=ON -DBLOSC_USE_EXTERNAL_SOURCES=ON' }
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: llvm
run: ./ci/install_llvm_windows.sh ${{ matrix.config.llvm }} ${{ matrix.config.crt }}
run: ./ci/install_llvm_windows.sh ${{ matrix.config.crt }}
- name: install
shell: powershell
run: |
vcpkg update
vcpkg install tbb gtest
run: .\ci\install_windows.ps1
- name: build
run: >
./ci/build.sh -v
@@ -420,12 +408,10 @@ jobs:
--components="${{ matrix.config.components }}"
--cargs=\'
-A x64 -G \"Visual Studio 17 2022\"
-DUSE_BLOSC=OFF \
-DUSE_ZLIB=OFF \
-DVCPKG_TARGET_TRIPLET=${VCPKG_DEFAULT_TRIPLET}
-DCMAKE_TOOLCHAIN_FILE=\"${VCPKG_INSTALLATION_ROOT}\\scripts\\buildsystems\\vcpkg.cmake\"
-DMSVC_COMPRESS_PDB=ON
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=OFF
-DOPENVDB_AX_TEST_CMD_DOWNLOADS=ON
-DUSE_EXPLICIT_INSTANTIATION=OFF
-DLLVM_DIR=\"${HOME}\\llvm_install\\lib\\cmake\\llvm\"
-DCMAKE_INSTALL_PREFIX=\"${VDB_INSTALL_PREFIX}\"
@@ -497,7 +483,7 @@ jobs:
\'
- name: test
shell: bash
run: cd build && ctest -V -E ".*cuda.*|.*mgpu.*"
run: cd build && ctest -V -E ".*cuda.*"
#############################################################################
################################## Blosc ####################################
@@ -508,13 +494,13 @@ jobs:
github.event_name != 'workflow_dispatch' ||
github.event.inputs.type == 'all' ||
github.event.inputs.type == 'blosc'
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-8c-32g-300h') || 'ubuntu-latest' }}
name: linux-blosc:${{ matrix.blosc }}
container:
image: aswf/ci-openvdb:2025-clang19.1
image: aswf/ci-base:2023
strategy:
matrix:
blosc: ['1.21.0', 'latest']
blosc: ['1.18.0','1.19.0','1.20.0','1.21.0']
fail-fast: false
steps:
- uses: actions/checkout@v3
@@ -604,7 +590,7 @@ jobs:
-strict
-extended
- name: upload_report
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v3
if: always()
with:
name: abi_report
+2 -4
View File
@@ -4,12 +4,10 @@ name: Whitespace
on:
push:
paths-ignore:
- 'ext/**'
- 'pendingchanges/**'
- 'tsc/meetings/**'
pull_request:
paths-ignore:
- 'ext/**'
- 'pendingchanges/**'
- 'tsc/meetings/**'
@@ -27,7 +25,7 @@ jobs:
- name: test
run: |
set +e
git grep -n -I -E '^.+[ ]+$' -- ':!tsc/meetings/*' ':!pendingchanges/*' ':!ext/*' ':!*.wlt'
git grep -n -I -E '^.+[ ]+$' -- ':!tsc/meetings/*' ':!pendingchanges/*' ':!*.wlt'
test $? -eq 1
# Search for any tabs excluding meeting notes, image files and a few others
@@ -38,5 +36,5 @@ jobs:
- name: test
run: |
set +e
git grep -n " " -- ':!*/whitespace.yml' ':!tsc/meetings/*' ':!*.svg' ':!*.cmd' ':!*.png' ':!pendingchanges/*' ':!ext/*' ':!*.wlt' ':!*.jpg' ':!*.gif' ':!*.mp4' ':!*.pt' ':!*.pth' ':!*.nvdb' ':!*.npz'
git grep -n " " -- ':!*/whitespace.yml' ':!tsc/meetings/*' ':!*.svg' ':!*.cmd' ':!*.png' ':!pendingchanges/*' ':!*.wlt' ':!*.jpg' ':!*.gif' ':!*.mp4' ':!*.pt' ':!*.pth' ':!*.nvdb' ':!*.npz'
test $? -eq 1
+2
View File
@@ -1,2 +1,4 @@
/build/*
**/src/benchmarks/build/*
nanovdb/nanovdb/build/*
.DS_Store
+6 -296
View File
@@ -1,306 +1,18 @@
OpenVDB Version History
=======================
Version 13.0.1 - In Development
Version 13.0.0 - November 3, 2025
This version introduces ABI changes relative to older major releases,
so to preserve ABI compatibility it might be necessary to define the
macro OPENVDB_ABI_VERSION_NUMBER=N, where, for example, N is 11 for
Houdini 20.5 and 12 for Houdini 21.0.
Support for reading .vdb files written prior to VDB 1.0 has been removed.
To read older .vdb files, please use VDB 12.x or older and re-write them,
so that they use the newer file format and can be read in VDB 13+.
Highlights:
- OpenVDB now includes in-memory support for Half Grids and the file format
has been extended to add I/O serialization for half grids. More work is
planned on adapting algorithms when using Half Grids for better performance
and improved precision.
- NanoVDB is no longer limited to static applications, such as rendering, but
can increasingly be applied to problems that involve dynamic topology, such
as level set tracking, grid building, morphology operations and merging of
grids. This is due to the fact that we keep adding more and more tools to
NanoVDB that facilitates tree modification. However, unlike OpenVDB, these
operations generate new NanoVDB grids (as oppose to in-palace modifications
in OpenVDB), yet are typically much faster since they are performed on the
GPU. Many of these exciting new features are the foundation of fVDB.
OpenVDB:
New features:
- Added native registration of HalfGrid type.
- Added customization of the output transformation attribute for
points::pca(). Can be output as a quaternion or as a combined affine
transform with the scale/stretch ommitted.
- Added support for input quaternions attributes and affine
transformations (that include scale) in points::rasterizeSdf() for
ellipsoidal rasterizations.
API Changes:
- Added LeafBuffer::storage() for direct const access to the raw data
buffer when using the bool LeafNode.
- Removed Grid::evalMinMax(), use tools::minMax for superior threaded
performance.
- Removed points::rasterize() that took a custom filter and interrupter.
- Removed LeafNode<bool, ...>() TopologyCopy constructor in favor of using
explicit mask/buffer constructors.
- Removed ValueAccessor NodeT0, NodeT1, NodeT2 aliases, use NodeTypeAtLevel
instead.
- Add InternalNode::setValueMaskUnsafe() to write a value mask directly.
- LegacyFrustum and RootNodeMask have been removed. These classes were only
used for reading old .vdb files, which is no longer supported.
- io::writeCompressedValues() now takes a const ValueT* source buffer for
improved const-correctness.
Bug Fixes:
- Fix a bug in the LevelSetRayIntersector class where two of the methods
were incorrectly adjusting the time even when an intersection was not
found.
- Fixed an assertion in math::Quat where a vector length check was using
too small a tolerance.
- Fixed a bug in the unit tests where detecting if assertions were enabled
was using NDEBUG rather than OpenVDB assertions.
Build:
- Removed the unnecessary USE_NUMPY build option for the OpenVDB Python
module. All functions which take numpy arrays are now always generated
(numpy is not required at compile time for this support).
- Bumped minimum supported CMake version to 3.24, and new future minimum
to 4.0.0.
- Bumped minimum supported OpenEXR and Imath versions to 3.2, and new
future minimum to 3.3.
- Bumped minimum supported Boost version to 1.82, and new future minimum
to 1.85.
- Bumped minimum supported Python version to 3.11
- Bumped minimum supported Log4cplus version to 2.0
- Bumped minimum supported Houdini version to 20.5
- Bumped minimum supported GLFW version to 3.3
- Bumped future minimum for TBB to 2021 (oneapi).
- Bumped future minimum for nanobind to 2.5.0.
OpenVDB AX:
New:
- Added support for LLVM 21.
NanoVDB:
Highlights:
- NanoVDB is no longer limited to static applications, such as rendering,
but can increasingly be applied to problems that involve dynamic
topology, such as level set tracking, grid building, morphology
operations and merging of grids. This is due to the fact that we keep
adding more and more tools to NanoVDB that facilitates tree modification.
However, unlike OpenVDB, these operations generate new NanoVDB grids (as
oppose to in-palace modifications in OpenVDB), yet are typically much
faster since they are performed on the GPU. Many of these exciting new
features are the foundation of fVDB.
New features:
- Added nanovdb/tools/cuda/DilateGrid.cuh, which performs topology dilation
on the GPU.
- Added nanovdb/tools/cuda/MergeGrids.cuh, which merges the topology of two
grids on the GPU.
- Added nanovdb/tools/cuda/CoarsenGrid.cuh, which performs topological
coarsening of grids on the GPU.
- Added nanovdb/tools/cuda/RefineGrid.cuh, which performs topological
refinement of grids on the GPU.
- Added nanovdb/tools/cuda/PruneGrid.cuh, which prunes the topology of a
grid using a sidecar mask on the GPU.
- Added nanovdb/util/cuda/Injection.cuh, which facilitates sidecar data
copying - on the GPU - in the overlap of two grids with different
topology.
- Added Mat classes and other math types to NanoVDB.
- Major rewrite of nanovdb::NanoToOpenVDB, which now allows
nanovdb::IndexGrids and blind (or sidecar) data to be converted into an
openvdb grid.
- Added support for LevelSet, FogVolume, and Staggered grid semantics.
Added toGridClass and toSemantic to map Grid Blind data semantic to Grid
class and vice versa.
Improvements:
- Improvements to mGPU grid building and introduction of a separate test
executable for mGPU tests
- Added stand-alone function nanovdb::writeUncompressedGrid that allows
nanovdb::IndexGrids and blind (or sidecar) data to be written directly to
a stream.
- nanovdb_print now (optionally) prints the blind data count per grid.
- Extended nanovdb::GridBlindDataSemantic with nanovdb::GridClass types to
support conversion between IndexGrid and regular grids.
- Improvements and bugfixes to PNanoVDB.
API Changes:
- Removed nanovdb::ValueIndexMask and nanovdb::ValueOnIndexMask since they
are no longer used by fVDB (or elsewhere).
- NanoVDB version is now 32.9.0, so the ABI of the grid is preserved but
not the API. However, the API changes are very minor!
Bug Fixes:
- Several fixes for compiler warnings.
- Fixed error in nanovdb/io/IO.h related to missing throws.
Houdini:
- Remove support for openvdb_houdini::Interrupter, use
openvdb_houdini::HoudiniInterrupter instead.
- Remove input-stealing via duplicateSourceStealable(), SideFX have since
introduced verbification and compiled SOPs to provide zero-copy node
evaluation.
Version 12.1.1 - September 30, 2025
OpenVDB AX:
Fixes:
- Fixed an issue which was causing host specific optimization passes to be
omitted when using LLVM 16 and higher.
Houdini:
- Fixed a compilation issue with the OpenVDB Activate SOP with Houdini 21
[Reported by @callen128]
Version 12.1.0 - August 8, 2025
OpenVDB:
New features:
- New level set constructor tools::createLevelSetCapsule creates a grid
containing a narrow-band level set representation of a capsule (tube
with constant radius and sphere caps).
- New level set constructor tools::createLevelSetTaperedCapsule creates a
grid containing a narrow-band level set representation of a tapered
capsule (tube with sphere caps and different radii at both ends, or
equivalently the convex hull of two spheres with possibly different
centers and radii).
- New level set constructor tools::createLevelSetTubeComplex creates a grid
containing a narrow-band level set representation of a tube complex (a
collection of capsules or tapered capsules defined by endpoint coordinates
and segment indices).
- New level set constructor tools::createLevelSetDilatedMesh creates a grid
containing a narrow-band level set representation of a dilated surface
mesh (dilated by a radius in all directions).
- New class tools::ConvexVoxelizer, used by the above methods, which can be
inherited to implement a convex level set constructor.
- Introduced anisotropic surfacing tools in points/PointRasterizeSDF.h and
principal component analysis (PCA) methods in points/PrincipalComponentAnalysis.h.
The latter tool analyses point neighborhoods and computes affine
transformations representing elliptical distributions. The prior tool
takes rotational and stretch point attributes (optionally computed from
the prior PCA methods) and generates anisotropic surfaces.
Improvements:
- Significantly improved the performance of all LeafNode ValueIterators,
up to 5x on some platforms and up to 10x when delay loading is enabled.
Construction of a ValueIterator from a leaf node now requests the leaf
buffers ahead of iteration to avoid potentially expensive API calls.
- Improved the performance of PointRasterizeSDF.h tools with larger radii
with better bound computation approximations.
- Significant performance improvement to delay loaded files - the warning
logic which checks the underlying mapped file for the last modified time
has been removed, resulting in performance gains upwards of 10x when
loading in node data buffers. Note that the check that was removed is
entirely redundant on Windows and would only print a warning on other
system.
[Contributed by jjtParadox]
- Added OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION and OPENVDB_HAS_MEMBER_FUNCTION
macros to help determine the presence and compatibility of interface
member functions at compile time.
- Added OPENVDB_ASSUME macros to mimic builtin assume and C++23 assume
attributes.
- Improved read and write of PLY files with vdb_tool so they support Vec3d
and 64 bit attributes. Changed vdb_tool version number from 10.6.1 to
10.7.0.
API Changes:
- Mat3 and Mat4 functions have been marked [[nodiscard]] where it may be
confusing if they are operating in place or returning a result, in
particular tranpose, invert, adjoint, and timesDiagonal.
- Re-worked the API in PointRasterizeSDF.h with the addition of anisotropic
surfacing kernels. The new API exposes more concise free functions which
take structs of parameters. The old API remains supported but is
deprecated.
- Deprecated providing a filter or interrupter as arguments to
points::rasterize. These can instead be implemented on user transfer
schemes.
- Transfer schemes provided to points::rasterize can now optionally
implement a rasterizePoints callback that takes a range of points per
voxel.
Fixes:
- Fixed a bug in points::rasterizeSpheres and points::rasterizeSmoothSpheres
which could cause sections of the generated surface to incorrectly be
marked as negative interior values.
- Fixed a bug in points::rasterizeSmoothSpheres which could result in
incomplete surface reconstruction with significantly larger search
distances.
- Fixed some precision issues in various Matrix methods.
- Fixed bugs in vdb_tool that prevented build with newer namespaces in
nanovdb.
OpenVDB AX:
Improvements:
- Added support for LLVM versions greater than 15. Upgraded CI to test with
LLVM versions 16, 17, 18, 19 and 20.
- As of this release, LLVM 15 is the minimum required version for OpenVDB
AX. Note that there is an issue with LLVM 17 symbols which makes it
incompatible with the OpenVDB Python plugin. AS such, LLVM version 18 and
greater are the recommended LLVM versions to use, with LLVM 18 being the
new future minimum version.
- Significant performance improvement to the compilation of AX kernels when
using LLVM 18 and greater.
- Significant backend refactoring to AX IR generation to support newer
versions of LLVM. In particular, parts of the codegen::Function and
codegen::FunctionBuilder API require new usage from LLVM 16 due to
the LLVM opaque pointer changes. If you're not using the OpenVDB AX
Function codegen API then no client changes should be necessary.
- Migrated OpenVDB AX unit tests from cppunit to gtest
[Contributed by Tim Straubinger]
Fixes:
- Fixed a case of undefined behaviour when explicitly casting variables to
the same type as their storage type e.g:
double a; double b = double(a);
- Fixed an AX compiler error which would produce invalid IR when using 64bit
integer variables for matrix array offsetting e.g:
int64 a = 0; mat4f b = 1; float c = b[a,a];
NanoVDB:
- Added nanovdb::openToIndexVDB, which can convert an OpenVDB grid into a
NanoVDB IndexGrid.
- Added new options "--index" and "--onIndex" to the command-line tool
nanovdb_convert so it can produce IndexGrids.
- Fixed memory leak in DeviceBuffer.
- Added constructor for DeviceBuffer from an existing HostBuffer.
- Added VoxelBlockManager, an acceleration structure for sequential access
and stencil ops over active voxels.
- Added helper functions for kernel launches with shared memory.
- Added support for CUDA 13.0.
- Fix warnings and compilation errors for GCC and Clang.
- Fixed inconsistent usage of util::cuda::mallocAsync/freeAsync that
affected vGPUs.
- Added support for custom memory resources in PointsToGrid.
- Fixed race condition in split/mergeGridHandles.
- Fixed offset bug in nanovdb::tools::cuda::IndexToGrid related to non-POD
build types.
[Contributed by Andreas Henne]
Houdini:
- Define OP_InputIdx and OP_OutputIdx for Houdini 21.0 compatibility
- Add Houdini 21 style camera interface to support LOP cameras
- Include env flag for avoiding stream writing (was backported to 19.5)
Version 12.0.2 - In development
Version 12.0.1 - April 3, 2025
OpenVDB:
New features:
- Added read and write support for OFF (Object File Format) files to
vdb_tool
- Added read and write support for OFF (Object File Format) files to vdb_tool
Build:
- Fixed a build issue with vdb_render on Windows with newer versions of
glew not including glu.h by default
- Fixed issues with newer versions of clang refusing to accept older
::template syntax
- Fixed a build issue with vdb_render on Windows with newer versions of glew not including glu.h by default
- Fixed issues with newer versions of clang refusing to accept older ::template syntax
NanoVDB:
New features:
@@ -308,12 +20,10 @@ Version 12.0.1 - April 3, 2025
- Added a UnifiedBuffer class that wraps CUDA unified memory
- Added example for multiGPU sparse convolution
- Added CUDA utility functions for device queries
- Added functions to independently stop and compute the elapsed time for
timer classes
- Added functions to independently stop and compute the elapsed time for timer classes
Improvements:
- Replaced CUB's CachingDeviceAllocator with the default asynchronous
stream ordered allocator in PointsToGrid for improved performance
- Replaced CUB's CachingDeviceAllocator with the default asynchronous stream ordered allocator in PointsToGrid for improved performance
Bug fix:
- Map is now properly transposed when converting NanoVDB to OpenVDB.
+37 -74
View File
@@ -42,7 +42,7 @@
# note: cmake_minimum_required must be called before project commands to
# ensure policy scope is set up correctly
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
# CMP0091 allows for MSVC ABI targetting via CMAKE_MSVC_RUNTIME_LIBRARY
# from CMake 3.15 and above. Must come before project().
@@ -52,9 +52,9 @@ endif()
###### Version
set(OpenVDB_MAJOR_VERSION 13)
set(OpenVDB_MAJOR_VERSION 12)
set(OpenVDB_MINOR_VERSION 0)
set(OpenVDB_PATCH_VERSION 1)
set(OpenVDB_PATCH_VERSION 2)
set(OpenVDB_VERSION "${OpenVDB_MAJOR_VERSION}.${OpenVDB_MINOR_VERSION}.${OpenVDB_PATCH_VERSION}")
project(OpenVDB LANGUAGES CXX VERSION ${OpenVDB_VERSION})
@@ -80,10 +80,7 @@ option(OPENVDB_BUILD_NANOVDB "Build the NanoVDB library. Turns ON if USE_NANOVDB
# Global options
option(OPENVDB_ENABLE_RPATH "Build with RPATH information" ON)
option(OPENVDB_ENABLE_ASSERTS "Build with asserts in OpenVDB code enabled" OFF)
option(OPENVDB_ENABLE_VEC_RELATIONAL_OPERATIONS [=[
Enabled deprecated relational < and > operators on Vector types. This option
will be switched to OFF and the feature will be subsequently removed in future
releases.]=] ON)
option(OPENVDB_USE_DELAYED_LOADING "Build the core OpenVDB library with delayed-loading." ON)
option(OPENVDB_CXX_STRICT "Enable or disable pre-defined compiler warnings" OFF)
cmake_dependent_option(OPENVDB_INSTALL_CMAKE_MODULES
"Install the provided OpenVDB CMake modules when building the core library"
@@ -134,30 +131,6 @@ required.]=] ${USE_EXR})
option(USE_PNG "Use PNG while building openvdb components." OFF)
option(USE_AX "Use OpenVDB AX while building openvdb components." ${OPENVDB_BUILD_AX})
option(USE_NANOVDB "Use NanoVDB while building openvdb components." ${OPENVDB_BUILD_NANOVDB})
option(USE_VCL [=[
Use the internally supplied copy of Agner Fog's vectorclass (VCL) SIMD wrapper
library to instrument OpenVDB tools. This also requires VCL to be installed
along with OpenVDB headers. Only applicable which compiling for x86 targets.]=] OFF)
set(OPENVDB_X86_INSTRSET 0 CACHE STRING [=[
The x86 instruction set to use. When unset, if USE_VCL is ON, this is
automatically configured based on provided build flags. When unset and USE_VCL
is OFF, defaults to 0. It is expected for you to provide this flag. Available
values are:
0: Unknown or unspecified
1: SSE -msse
2: SSE2 -msse2 # Minimum on x86_64
3: SSE3 -msse3
4: SSSE3 -mssse3
5: SSE4.1 -msse4.1
6: SSE4.2 -msse4.2 # Minimum recommended where supported
7: AVX -mavx
8: AVX2 -mavx2
9: AVX512F -mavx512f
10: AVX512BW/DQ/VL -mavx512bw -mavx512dq -mavx512vl
Note that (while not strictly enforced by vendors) each option implies all
preceeding flags. If you need more granular control you can provide your
desired flags via CXX_FLAGS. Only applicable which compiling for x86 targets.
]=])
cmake_dependent_option(OPENVDB_DISABLE_BOOST_IMPLICIT_LINKING
"Disable the implicit linking of Boost libraries on Windows" ON "WIN32" OFF)
@@ -199,6 +172,19 @@ elseif(NOT ${CONCURRENT_MALLOC} IN_LIST _CONCURRENT_MALLOC_OPTIONS)
set(CONCURRENT_MALLOC Auto CACHE STRING FORCE)
endif()
set(_OPENVDB_SIMD_OPTIONS None SSE42 AVX)
if(NOT OPENVDB_SIMD)
set(OPENVDB_SIMD None CACHE STRING
"Choose whether to enable SIMD compiler flags or not, options are: None SSE42 AVX.
Although not required, it is strongly recommended to enable SIMD. AVX implies SSE42.
None is the default." FORCE
)
elseif(NOT ${OPENVDB_SIMD} IN_LIST _OPENVDB_SIMD_OPTIONS)
message(WARNING "Unrecognized or unsupported value for OPENVDB_SIMD, "
"using None instead.")
set(OPENVDB_SIMD None CACHE STRING FORCE)
endif()
if(USE_BLOSC AND NOT USE_ZLIB)
message(WARNING "ZLib can only be disabled if Blosc is also disabled. Enabling ZLib.")
endif()
@@ -263,6 +249,7 @@ mark_as_advanced(
OPENVDB_BUILD_HOUDINI_ABITESTS
OPENVDB_CXX_STRICT
OPENVDB_ENABLE_RPATH
OPENVDB_USE_DELAYED_LOADING
OPENVDB_FUTURE_DEPRECATION
OPENVDB_SIMD
SYSTEM_LIBRARY_PATHS
@@ -281,13 +268,6 @@ mark_as_advanced(
include(cmake/config/OpenVDBVersions.cmake)
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_CMAKE_VERSION)
if(CMAKE_VERSION VERSION_LESS ${FUTURE_MINIMUM_CMAKE_VERSION})
message(DEPRECATION "Support for CMake versions < ${FUTURE_MINIMUM_CMAKE_VERSION} "
"is deprecated and will be removed.")
endif()
endif()
foreach(DEPRECATED_ABI ${OPENVDB_DEPRECATED_ABI_LIST})
option(OPENVDB_USE_DEPRECATED_ABI_${DEPRECATED_ABI} "Bypass minimum ABI requirement checks" OFF)
mark_as_advanced(OPENVDB_USE_DEPRECATED_ABI_${DEPRECATED_ABI})
@@ -398,28 +378,6 @@ endif()
#########################################################################
# Still support -DOPENVDB_SIMD=SSE42 and -DOPENVDB_SIMD=AVX, these alias to
# their respective OPENVDB_X86_INSTRSET value but, as a build option, are
# deprecated. Not that the defines in version.h need to persist in case
# downstream software was using them before including VDB headers
set(_OPENVDB_SIMD_OPTIONS None SSE42 AVX)
if(NOT OPENVDB_SIMD)
set(OPENVDB_SIMD None CACHE STRING "Deprecated, see OPENVDB_X86_INSTRSET." FORCE)
else()
if(NOT ${OPENVDB_SIMD} IN_LIST _OPENVDB_SIMD_OPTIONS)
message(WARNING "Unrecognized or unsupported value for OPENVDB_SIMD, using None instead.")
set(OPENVDB_SIMD None CACHE STRING "Deprecated, see OPENVDB_X86_INSTRSET." FORCE)
endif()
message(DEPRECATION "The OPENVDB_SIMD option is deprecated and will be removed. Use OPENVDB_X86_INSTRSET.")
if(OPENVDB_SIMD STREQUAL "AVX")
set(OPENVDB_X86_INSTRSET 7)
elseif(OPENVDB_SIMD STREQUAL "SSE42")
set(OPENVDB_X86_INSTRSET 6)
endif()
endif()
#########################################################################
# Configure general CMake and CXX settings
include(cmake/config/OpenVDBCXX.cmake)
@@ -439,6 +397,22 @@ if(CONCURRENT_MALLOC STREQUAL "Auto")
endif()
endif()
# Configure SIMD. AVX implies SSE 4.2.
if(OPENVDB_SIMD STREQUAL "AVX")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.2>")
endif()
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:OPENVDB_USE_AVX>")
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:OPENVDB_USE_SSE42>")
elseif(OPENVDB_SIMD STREQUAL "SSE42")
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.2>")
endif()
add_compile_definitions("$<$<COMPILE_LANGUAGE:CXX>:OPENVDB_USE_SSE42>")
endif()
#########################################################################
# Configure our cmake modules to only search for static libraries
@@ -504,7 +478,10 @@ endif()
# Locate Python and nanobind if necessary
if(OPENVDB_BUILD_PYTHON_MODULE OR (OPENVDB_BUILD_NANOVDB AND NANOVDB_BUILD_PYTHON_MODULE))
# Call find_package(Python ...)
find_package(Python ${MINIMUM_PYTHON_VERSION} REQUIRED COMPONENTS Development Interpreter)
find_package(nanobind ${MINIMUM_NANOBIND_VERSION} REQUIRED)
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_PYTHON_VERSION)
if(Python_VERSION VERSION_LESS ${FUTURE_MINIMUM_PYTHON_VERSION})
message(DEPRECATION "Support for Python versions < ${FUTURE_MINIMUM_GLFW_VERSION} "
@@ -512,20 +489,6 @@ if(OPENVDB_BUILD_PYTHON_MODULE OR (OPENVDB_BUILD_NANOVDB AND NANOVDB_BUILD_PYTHO
endif()
endif()
find_package(nanobind REQUIRED CONFIG)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(nanobind
FOUND_VAR nanobind_FOUND
REQUIRED_VARS NB_DIR
VERSION_VAR nanobind_VERSION)
if(OPENVDB_FUTURE_DEPRECATION AND FUTURE_MINIMUM_NANOBIND_VERSION)
if(nanobind_VERSION VERSION_LESS ${FUTURE_MINIMUM_NANOBIND_VERSION})
message(DEPRECATION "Support for nanobind versions < ${FUTURE_MINIMUM_NANOBIND_VERSION} "
"is deprecated and will be removed.")
endif()
endif()
if(NOT DEFINED VDB_PYTHON_INSTALL_DIRECTORY)
if(DEFINED Python_SITELIB)
get_filename_component(Python_PACKAGES_DIR ${Python_SITELIB} NAME)
+3
View File
@@ -41,3 +41,6 @@ CHANGES @kmuseth @apradhana
/openvdb_houdini/openvdb_houdini/PointUtils.* @danrbailey @idclip
/openvdb_houdini/openvdb_houdini/*_OpenVDB_Points_* @danrbailey @idclip
/openvdb_houdini/openvdb_houdini/GR_PrimVDBPoints.* @danrbailey @idclip
# fVDB
/fvdb/ @NVIDIA-Omniverse/fvdb-dev
-4
View File
@@ -57,10 +57,6 @@ code and has the right to release it under the
[Apache License, version 2.0](LICENSE.md)
license. See the [TAC documentation on contribution sign off](https://github.com/AcademySoftwareFoundation/tac/blob/master/process/contributing.md#contribution-sign-off) for more information on this requirement.
#### Stale PRs
A PR that does not have a signed CLA or DCO sign-off will be given at least one week in which to resolve the issue and then will be closed. The TSC cannot review or merge PRs without these requirements having been met. Please re-open PRs that are now expected to pass once this criteria has been met.
## Maintainer
The maintainer role is the equivalent of the "Committer" role in the charter.
+2
View File
@@ -95,6 +95,8 @@ vcpkg install zlib:x64-windows
vcpkg install blosc:x64-windows
vcpkg install tbb:x64-windows
vcpkg install boost-iostreams:x64-windows
vcpkg install boost-any:x64-windows
vcpkg install boost-algorithm:x64-windows
vcpkg install boost-interprocess:x64-windows
```
+10 -19
View File
@@ -33,13 +33,8 @@ PARMS[--target]=install
PARMS[--build-dir]=build
if [[ $RUNNER_NAME == *"8c-32g-300h"* ]]; then
if [[ $CXX == "g++" ]]; then
# GCC hits memory limits on runners, reduce threads
PARMS[-j]=6
else
# ASWF github actions runners have 8 threads
PARMS[-j]=8
fi
# ASWF github actions runners have 8 threads
PARMS[-j]=8
else
# Github actions runners have 2 threads
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
@@ -56,8 +51,7 @@ declare -A COMPONENTS
COMPONENTS['core']='OPENVDB_BUILD_CORE'
COMPONENTS['python']='OPENVDB_BUILD_PYTHON_MODULE'
COMPONENTS['test']='OPENVDB_BUILD_UNITTESTS'
# @todo split out vdb tool from this...
COMPONENTS['bin']='OPENVDB_BUILD_VDB_PRINT,OPENVDB_BUILD_VDB_LOD,OPENVDB_BUILD_VDB_TOOL,OPENVDB_BUILD_VDB_TOOL_UNITTESTS'
COMPONENTS['bin']='OPENVDB_BUILD_BINARIES'
COMPONENTS['view']='OPENVDB_BUILD_VDB_VIEW'
COMPONENTS['render']='OPENVDB_BUILD_VDB_RENDER'
COMPONENTS['hou']='OPENVDB_BUILD_HOUDINI_PLUGIN'
@@ -73,8 +67,6 @@ COMPONENTS['nanotest']='NANOVDB_BUILD_UNITTESTS'
COMPONENTS['nanoexam']='NANOVDB_BUILD_EXAMPLES'
COMPONENTS['nanobench']='NANOVDB_BUILD_BENCHMARK'
COMPONENTS['nanotool']='NANOVDB_BUILD_TOOLS'
COMPONENTS['nanopython']='NANOVDB_BUILD_PYTHON_MODULE'
COMPONENTS['nanopytest']='NANOVDB_BUILD_PYTHON_UNITTESTS'
################################################
@@ -158,11 +150,7 @@ for comp in "${!COMPONENTS[@]}"; do
setting="ON"; break
fi
done
OPENVDB_TOGGLES="${COMPONENTS[$comp]}"
OPENVDB_TOGGLES=(${OPENVDB_TOGGLES//,/ })
for toggle in "${!OPENVDB_TOGGLES[@]}"; do
CMAKE_EXTRA+=("-D${OPENVDB_TOGGLES[$toggle]}=$setting")
done
CMAKE_EXTRA+=("-D${COMPONENTS[$comp]}=$setting")
done
################################################
@@ -194,14 +182,17 @@ cd ${BUILD_DIR}
set -x
# Note:
# - OPENVDB_BUILD_BINARIES is always ON, but each binary will be toggled depending on the provided comps
# - print and lod binary options are always on and can be toggles with: OPENVDB_BUILD_BINARIES=ON/OFF
# - always enabled the python tests with OPENVDB_BUILD_PYTHON_UNITTESTS if the python module is in use,
# regardless of the 'test' component being enabled or not (see the OPENVDB_BUILD_PYTHON_UNITTESTS option).
cmake \
-DOPENVDB_USE_DEPRECATED_ABI_10=ON \
-DOPENVDB_USE_DEPRECATED_ABI_11=ON \
-DOPENVDB_USE_DEPRECATED_ABI_12=ON \
-DOPENVDB_BUILD_VDB_PRINT=ON \
-DOPENVDB_BUILD_VDB_LOD=ON \
-DOPENVDB_BUILD_VDB_TOOL=ON \
-DOPENVDB_BUILD_VDB_TOOL_UNITTESTS=ON \
-DOPENVDB_TOOL_USE_NANO=OFF \
-DOPENVDB_BUILD_BINARIES=ON \
-DOPENVDB_BUILD_PYTHON_UNITTESTS=ON \
-DMSVC_MP_THREAD_COUNT=${PARMS[-j]} \
"${CMAKE_EXTRA[@]}" \
+84
View File
@@ -0,0 +1,84 @@
version: 0.2
env:
variables:
PYTHONPATH: ""
# secrets-manager:
# GITHUB_TOKEN: "github-token:token"
phases:
install:
runtime-versions:
python: 3.10
commands:
# Install Conda
- wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
- bash Miniforge3-Linux-x86_64.sh -b -p $HOME/miniforge3
- eval "$($HOME/miniforge3/bin/conda shell.bash hook)"
- conda init
- source ~/.bashrc || true
# Create build environment
- conda env create -f fvdb/env/build_environment.yml -n fvdb_build
- echo "Build environment created successfully"
# Create test environment
- conda env create -f fvdb/env/test_environment.yml -n fvdb_test
- echo "Test environment created successfully"
pre_build:
commands:
- echo "Starting pre_build phase"
- git config --global --add safe.directory "$(pwd)"
# Verify environments exist
- conda env list
- echo "Pre-build phase completed"
build:
commands:
- echo "Starting build phase"
# Build fvdb wheel using conda run (this ensures proper environment activation)
- cd fvdb
- export TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6+PTX"
- echo "Building wheel with conda run..."
- conda run --no-capture-output -n fvdb_build ./build.sh wheel verbose gtests benchmarks
# Verify wheel was created
- ls -la dist/
- echo "Wheel build completed"
# Move back to root directory
- cd ..
# Install package in test environment using conda run
- echo "Installing wheel in test environment..."
- conda run --no-capture-output -n fvdb_test pip install ./fvdb/dist/*.whl
- echo "Package installation completed"
post_build:
commands:
- echo "Starting post_build phase"
# Run unit tests using conda run
- echo "Running unit tests..."
- cd fvdb/tests
- conda run --no-capture-output -n fvdb_test pytest -v unit
# Run documentation tests using conda run
- echo "Running documentation tests..."
- cd ..
- conda run --no-capture-output -n fvdb_test pytest --markdown-docs docs
- echo "All tests completed successfully"
artifacts:
files:
- fvdb/dist/*.whl
name: fvdb-artifacts
cache:
paths:
- '/root/.cache/pip/**/*'
- '$HOME/miniforge3/**/*'
+16 -22
View File
@@ -8,14 +8,8 @@ HOUDINI_MAJOR="$1"
PLATFORM="$2"
OTHER_ARGS="$3"
if [[ $PLATFORM =~ "linux" ]]; then
pip3 install --user requests
elif [[ $PLATFORM =~ "macos" ]]; then
# Tell the homebrew install of pip3 that we don't care about installing directly through pip3
pip3 install --user requests --break-system-packages
fi
python3 ci/download_houdini.py $HOUDINI_MAJOR $PLATFORM $OTHER_ARGS
pip install --user requests
python ci/download_houdini.py $HOUDINI_MAJOR $PLATFORM $OTHER_ARGS
if [[ $PLATFORM =~ "linux" ]]; then
# create dir hierarchy
@@ -37,20 +31,20 @@ if [[ $PLATFORM =~ "linux" ]]; then
ls -al dsolib/
# copy required libraries
mv toolkit/cmake ../hou/toolkit/.
mv toolkit/include ../hou/toolkit/.
mv dsolib/libHoudini* ../hou/dsolib/.
mv dsolib/libopenvdb_sesi* ../hou/dsolib/.
mv dsolib/libblosc* ../hou/dsolib/.
mv dsolib/libhboost* ../hou/dsolib/.
mv dsolib/libz* ../hou/dsolib/.
mv dsolib/libbz2* ../hou/dsolib/.
mv dsolib/libtbb* ../hou/dsolib/.
mv dsolib/libjemalloc* ../hou/dsolib/.
mv dsolib/liblzma* ../hou/dsolib/.
mv dsolib/libIex* ../hou/dsolib/.
mv dsolib/libImath* ../hou/dsolib/.
mv dsolib/libIlmThread* ../hou/dsolib/.
cp -r toolkit/cmake ../hou/toolkit/.
cp -r toolkit/include ../hou/toolkit/.
cp -r dsolib/libHoudini* ../hou/dsolib/.
cp -r dsolib/libopenvdb_sesi* ../hou/dsolib/.
cp -r dsolib/libblosc* ../hou/dsolib/.
cp -r dsolib/libhboost* ../hou/dsolib/.
cp -r dsolib/libz* ../hou/dsolib/.
cp -r dsolib/libbz2* ../hou/dsolib/.
cp -r dsolib/libtbb* ../hou/dsolib/.
cp -r dsolib/libjemalloc* ../hou/dsolib/.
cp -r dsolib/liblzma* ../hou/dsolib/.
cp -r dsolib/libIex* ../hou/dsolib/.
cp -r dsolib/libImath* ../hou/dsolib/.
cp -r dsolib/libIlmThread* ../hou/dsolib/.
cd ..
elif [[ $PLATFORM =~ "macos" ]]; then
+1 -1
View File
@@ -15,6 +15,6 @@ fi
mkdir build
cd build
cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ../.
cmake ../.
make -j8
make install
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
set -ex
EXR_VERSION="$1"
git clone https://github.com/AcademySoftwareFoundation/openexr.git
cd openexr
if [ "$EXR_VERSION" != "latest" ]; then
git checkout tags/${EXR_VERSION} -b ${EXR_VERSION}
fi
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
+4 -7
View File
@@ -3,19 +3,16 @@
# SPDX-License-Identifier: Apache-2.0
set -ex
GTEST_VERSION="$1"
git clone https://github.com/google/googletest.git
git clone https://github.com/google/googletest.git -b v${GTEST_VERSION}
cd googletest
if [ "$GTEST_VERSION" != "latest" ]; then
git checkout tags/${GTEST_VERSION} -b ${GTEST_VERSION}
fi
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
-21
View File
@@ -1,21 +0,0 @@
#!/usr/bin/env bash
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
set -ex
IMATH_VERSION="$1"
git clone https://github.com/AcademySoftwareFoundation/Imath.git
cd Imath
if [ "$IMATH_VERSION" != "latest" ]; then
git checkout tags/${IMATH_VERSION} -b ${IMATH_VERSION}
fi
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
+6 -35
View File
@@ -4,55 +4,26 @@
set -ex
LLVM_VER="$1"
LLVM_CRT="$2"
LLVM_CRT="$1"
# Legacy define for older versions of LLVM
LLVM_LEGACY_CRT_DEFINE=""
if [[ "${LLVM_CRT}" == "MultiThreaded" ]]; then
LLVM_LEGACY_CRT_DEFINE="MT"
elif [[ "${LLVM_CRT}" == "MultiThreadedDebug" ]]; then
LLVM_LEGACY_CRT_DEFINE="MTd"
elif [[ "${LLVM_CRT}" == "MultiThreadedDLL" ]]; then
LLVM_LEGACY_CRT_DEFINE="MD"
elif [[ "${LLVM_CRT}" == "MultiThreadedDebugDLL" ]]; then
LLVM_LEGACY_CRT_DEFINE="MDd"
fi
git clone -b llvmorg-${LLVM_VER} --depth 1 https://github.com/llvm/llvm-project.git llvm
git clone -b llvmorg-14.0.0 --depth 1 https://github.com/llvm/llvm-project.git llvm
cd llvm
mkdir .build
cd .build
# @note currently only test static builds with MT
cmake -B . -S ../llvm -A x64 -G "Visual Studio 17 2022" -Thost=x64 \
-DCMAKE_INSTALL_PREFIX="${HOME}/llvm_install" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_PROJECTS="" \
-DLLVM_ENABLE_RUNTIMES="" \
-DLLVM_ENABLE_UNWIND_TABLES=OFF \
-DLLVM_TARGETS_TO_BUILD="host" \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_INCLUDE_TOOLS=OFF \
-DLLVM_INCLUDE_UTILS=OFF \
-DLLVM_BUILD_BENCHMARKS=OFF \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_BUILD_TESTS=OFF \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_BUILD_TOOLS=OFF \
-DLLVM_BUILD_UTILS=OFF \
-DLLVM_ENABLE_BINDINGS=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_PARALLEL_COMPILE_JOBS=4 \
-DLLVM_PARALLEL_LINK_JOBS=4 \
-DCMAKE_MSVC_RUNTIME_LIBRARY=${LLVM_CRT} \
-DLLVM_USE_CRT_RELEASE=${LLVM_LEGACY_CRT_DEFINE}
-DLLVM_USE_CRT_RELEASE=${LLVM_CRT}
cmake --build . --parallel 4 --config Release --target install
cmake --build . --config Release --target install
cd ..
+2 -1
View File
@@ -22,7 +22,6 @@ brew install jq # for trivial parsing of brew json
brew install openexr
brew install nanobind # also installs the dependent python version
brew install robin-map # required for nanobind
brew install numpy # only for python tests
brew install zlib
brew install jemalloc
@@ -46,7 +45,9 @@ LLVM_VERSION=$1
if [ ! -z "$LLVM_VERSION" ]; then
if [ "$LLVM_VERSION" == "latest" ]; then
brew install llvm
brew install cppunit
else
brew install llvm@$LLVM_VERSION
brew install cppunit
fi
fi
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/env bash
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
set -ex
# Download the TeX Live installer
wget https://mirrors.mit.edu/CTAN/systems/texlive/tlnet/install-tl-unx.tar.gz
# Extract
tar xzf install-tl-unx.tar.gz
rm install-tl-unx.tar.gz
cd install-tl-*
# Run the installer with no docs or source installation
./install-tl --no-interaction --no-doc-install --no-src-install --scheme=minimal --repository https://mirrors.mit.edu/CTAN/systems/texlive/tlnet
# Export the texlive PATH to GITHUB_PATH
TEXLIVE_PATH=$(echo /usr/local/texlive/*/bin/x86_64-linux)
export PATH=${TEXLIVE_PATH}:${PATH}
echo "${TEXLIVE_PATH}" >> $GITHUB_PATH
# Install the required packages
tlmgr install latex-bin dvips collection-fontsrecommended collection-latexrecommended
# Validate that installing dvips and latex has been successful
dvips --version
latex --version
-9
View File
@@ -1,9 +0,0 @@
# Enable verbose and stop on error
$ErrorActionPreference = "Stop"
$VerbosePreference = "Continue"
# Install numpy for tests
& "$env:VCPKG_INSTALLATION_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\python3\python.exe" -m ensurepip --upgrade
& "$env:VCPKG_INSTALLATION_ROOT\installed\$env:VCPKG_DEFAULT_TRIPLET\tools\python3\python.exe" -m pip install numpy
Write-Host "pip numpy install completed successfully"
+1 -1
View File
@@ -10,7 +10,7 @@ set -e
# the expected VDB installation
cmakelists="
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
project(TestInstall LANGUAGES CXX)
find_package(OpenVDB REQUIRED COMPONENTS openvdb)
add_executable(test_vdb_print \"../openvdb_cmd/vdb_print/main.cc\")
-236
View File
@@ -1,236 +0,0 @@
#!/usr/bin/env python3
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
"""Validate cross-references inside the OpenVDB documentation tree.
Run from the repo root (no arguments) or pass paths to validate explicitly.
The script scans Markdown (`.md`) and Doxygen narrative (`.txt`) files under
``doc/`` and checks two classes of cross-reference for staleness:
1. ``#include <path/to/header.h>`` lines that appear inside Markdown
``cpp``/``cuda``/``c``/``c++`` fenced code blocks or inside Doxygen
``@code``/``\\code`` blocks. Each include is resolved to a real file in
``openvdb/``, ``openvdb_ax/``, ``openvdb_houdini/`` or ``nanovdb/``.
2. ``https://github.com/AcademySoftwareFoundation/openvdb/blob/<ref>/<path>``
URLs. The ``<path>`` portion is checked against the local checkout.
The script exits non-zero on any unresolved reference and prints a
``file:line`` style error so the failure is actionable in CI logs. It is
intentionally dependency-free so it can run in a minimal Python container.
This guards against the class of bug tracked in issue #2161, where renames
under ``nanovdb/util/ -> nanovdb/tools/`` and ``nanovdb/util/IO.h ->
nanovdb/io/IO.h`` silently left the docs referencing paths that no longer
exist.
"""
from __future__ import annotations
import re
import sys
from pathlib import Path
from typing import Iterable, List, Sequence, Tuple
REPO_ROOT = Path(__file__).resolve().parent.parent
# Map a top-level include namespace to one or more on-disk directories that it
# resolves against. ``#include <nanovdb/io/IO.h>`` resolves to
# ``nanovdb/nanovdb/io/IO.h`` because the repo uses a double-named layout;
# ``#include <houdini_utils/ParmFactory.h>`` resolves to
# ``openvdb_houdini/openvdb_houdini/ParmFactory.h`` because the Houdini plugin
# CMake configuration synthesises a ``houdini_utils/`` subtree at build time
# (see ``openvdb_houdini/openvdb_houdini/CMakeLists.txt``).
INCLUDE_NAMESPACE_ROOTS = {
"openvdb": ("openvdb/openvdb", "openvdb"),
"openvdb_ax": ("openvdb_ax/openvdb_ax", "openvdb_ax"),
"openvdb_houdini": ("openvdb_houdini/openvdb_houdini", "openvdb_houdini"),
"nanovdb": ("nanovdb/nanovdb", "nanovdb"),
"houdini_utils": ("openvdb_houdini/openvdb_houdini",),
}
# Top-level include path components that come from outside this repo. When a
# header's leading component matches one of these, we skip resolution entirely.
# Houdini SDK headers (``UT/``, ``GA/``, ``GEO_*``, etc.) live in the Houdini
# install, not in our checkout.
EXTERNAL_INCLUDE_PREFIXES = (
"boost/",
"tbb/",
"cuda", # cuda_runtime.h, cuda.h, ...
"thrust/",
"Eigen/",
"OpenEXR/",
"Imath/",
"openexr/",
"GL/",
# Houdini SDK prefixes
"UT/",
"GA/",
"GU/",
"GEO/",
"GT/",
"GR/",
"OP/",
"PRM/",
"SOP/",
"SYS/",
"CH/",
"DEP/",
"PI/",
"RE/",
# Standard library headers (no '/' is the usual signal, but list a few
# explicitly to be safe).
"stdio.h",
"iostream",
"vector",
"string",
"memory",
"cstdint",
)
# Match a Markdown fenced code block whose language is one of cpp/cuda/c/c++.
_MARKDOWN_FENCE_RE = re.compile(
r"^```(?:cpp|cuda|c\+\+|c)\s*$(?P<body>.*?)^```\s*$",
re.DOTALL | re.MULTILINE,
)
# Doxygen ``@code``/``\code`` ... ``@endcode``/``\endcode`` blocks. The
# language hint (``@code{.cpp}``) is optional.
_DOXY_CODE_RE = re.compile(
r"[@\\]code(?:\{[^}]*\})?\s*$(?P<body>.*?)^[@\\]endcode\s*$",
re.DOTALL | re.MULTILINE,
)
_INCLUDE_RE = re.compile(r"#\s*include\s*<([^>\n]+)>")
# Match URLs pointing into a blob in this repo. ``<ref>`` may be a branch
# name or a sha; ``<path>`` is the portion that must exist on disk today.
_GITHUB_BLOB_RE = re.compile(
r"https?://github\.com/AcademySoftwareFoundation/openvdb/blob/"
r"(?P<ref>[^/\s]+)/(?P<path>[^\s)\"'#?]+)"
)
def is_external_include(header: str) -> bool:
"""Return True for headers we cannot resolve from this repo."""
head, _, _ = header.partition("/")
if head in INCLUDE_NAMESPACE_ROOTS:
return False
return any(header.startswith(p) for p in EXTERNAL_INCLUDE_PREFIXES) or "/" not in header
def resolve_include(header: str) -> Path | None:
"""Resolve ``#include <header>`` to a path on disk, or None if not found."""
head, _, rest = header.partition("/")
roots = INCLUDE_NAMESPACE_ROOTS.get(head)
if roots is None or not rest:
return None
for root in roots:
candidate = REPO_ROOT / root / rest
if candidate.is_file():
return candidate
return None
def iter_code_block_lines(text: str) -> Iterable[Tuple[int, str]]:
"""Yield (line_number, line_text) for every line inside a code block.
Line numbers are 1-based and refer to the original ``text``. Handles both
Markdown fences (```cpp ...```) and Doxygen ``@code``/``\\code`` blocks.
"""
for match in _MARKDOWN_FENCE_RE.finditer(text):
body_start = match.start("body")
yield from _lines_with_offsets(text, match.group("body"), body_start)
for match in _DOXY_CODE_RE.finditer(text):
body_start = match.start("body")
yield from _lines_with_offsets(text, match.group("body"), body_start)
def _lines_with_offsets(full_text: str, body: str, body_offset: int) -> Iterable[Tuple[int, str]]:
base_line = full_text.count("\n", 0, body_offset) + 1
for i, line in enumerate(body.splitlines()):
yield base_line + i, line
def find_doc_files(extra_paths: Sequence[str]) -> List[Path]:
"""Return the list of doc files to scan.
Without arguments, scan ``doc/**/*.md`` and ``doc/**/*.txt``. With
arguments, scan only those files (resolved relative to the repo root).
"""
if extra_paths:
return [
(Path(p) if Path(p).is_absolute() else REPO_ROOT / p).resolve()
for p in extra_paths
]
doc_dir = REPO_ROOT / "doc"
return sorted(
list(doc_dir.rglob("*.md")) + list(doc_dir.rglob("*.txt"))
)
def check_file(path: Path) -> List[str]:
"""Return a list of human-readable error strings for the given doc file."""
errors: List[str] = []
try:
text = path.read_text(encoding="utf-8")
except (OSError, UnicodeDecodeError) as exc:
return [f"{path}: failed to read: {exc}"]
rel = path.relative_to(REPO_ROOT) if path.is_relative_to(REPO_ROOT) else path
for line_no, line in iter_code_block_lines(text):
for include_match in _INCLUDE_RE.finditer(line):
header = include_match.group(1).strip()
if is_external_include(header):
continue
if resolve_include(header) is None:
errors.append(
f"{rel}:{line_no}: include <{header}> does not resolve "
"to a file in this checkout"
)
for url_match in _GITHUB_BLOB_RE.finditer(text):
ref = url_match.group("ref")
url_path = url_match.group("path")
on_disk = REPO_ROOT / url_path
if not on_disk.exists():
# Compute the 1-based line number of the URL for the error report.
line_no = text.count("\n", 0, url_match.start()) + 1
errors.append(
f"{rel}:{line_no}: github URL "
f"AcademySoftwareFoundation/openvdb/blob/{ref}/{url_path} "
"does not exist in this checkout"
)
return errors
def main(argv: Sequence[str]) -> int:
files = find_doc_files(argv[1:])
total_errors: List[str] = []
for path in files:
if not path.exists():
total_errors.append(f"{path}: file does not exist")
continue
total_errors.extend(check_file(path))
if total_errors:
print("Documentation reference validation FAILED.", file=sys.stderr)
print("", file=sys.stderr)
for err in total_errors:
print(err, file=sys.stderr)
print("", file=sys.stderr)
print(
f"{len(total_errors)} broken reference(s) across "
f"{len(files)} file(s).",
file=sys.stderr,
)
return 1
print(f"OK: {len(files)} doc file(s) validated, no broken references.")
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))
+4 -6
View File
@@ -88,7 +88,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
mark_as_advanced(
@@ -419,11 +419,9 @@ if(NOT TARGET Blosc::blosc)
set(${BLOSC_EXTERNAL_LIB}_LIBRARIES ${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG})
endif()
if(${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE OR ${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG)
target_link_libraries(Blosc::blosc INTERFACE
$<$<CONFIG:Release>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE}>
$<$<CONFIG:Debug>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG}>)
endif()
target_link_libraries(Blosc::blosc INTERFACE
$<$<CONFIG:Release>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_RELEASE}>
$<$<CONFIG:Debug>:${${BLOSC_EXTERNAL_LIB}_LIBRARY_DEBUG}>)
endforeach()
endif()
+320
View File
@@ -0,0 +1,320 @@
# Copyright Contributors to the OpenVDB Project
# SPDX-License-Identifier: Apache-2.0
#
#[=======================================================================[.rst:
FindCppUnit
-----------
Find CppUnit include dirs and libraries
Use this module by invoking find_package with the form::
find_package(CppUnit
[version] [EXACT] # Minimum or EXACT version
[REQUIRED] # Fail with error if CppUnit is not found
)
IMPORTED Targets
^^^^^^^^^^^^^^^^
``CppUnit::cppunit``
This module defines IMPORTED target CppUnit::cppunit, if CppUnit has been
found.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``CppUnit_FOUND``
True if the system has the CppUnit library.
``CppUnit_VERSION``
The version of the CppUnit library which was found.
``CppUnit_INCLUDE_DIRS``
Include directories needed to use CppUnit.
``CppUnit_RELEASE_LIBRARIES``
Libraries needed to link to the release version of CppUnit.
``CppUnit_RELEASE_LIBRARY_DIRS``
CppUnit release library directories.
``CppUnit_DEBUG_LIBRARIES``
Libraries needed to link to the debug version of CppUnit.
``CppUnit_DEBUG_LIBRARY_DIRS``
CppUnit debug library directories.
Deprecated - use [RELEASE|DEBUG] variants:
``CppUnit_LIBRARIES``
Libraries needed to link to CppUnit.
``CppUnit_LIBRARY_DIRS``
CppUnit library directories.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``CppUnit_INCLUDE_DIR``
The directory containing ``cppunit/Portability.h``.
``CppUnit_LIBRARY``
The path to the CppUnit library.
Hints
^^^^^
Instead of explicitly setting the cache variables, the following variables
may be provided to tell this module where to look.
``CppUnit_ROOT``
Preferred installation prefix.
``CPPUNIT_INCLUDEDIR``
Preferred include directory e.g. <prefix>/include
``CPPUNIT_LIBRARYDIR``
Preferred library directory e.g. <prefix>/lib
``CPPUNIT_DEBUG_SUFFIX``
Suffix of the debug version of CppUnit libs. Defaults to "_d".
``SYSTEM_LIBRARY_PATHS``
Global list of library paths intended to be searched by and find_xxx call
``CPPUNIT_USE_STATIC_LIBS``
Only search for static cppunit libraries
``DISABLE_CMAKE_SEARCH_PATHS``
Disable CMakes default search paths for find_xxx calls in this module
#]=======================================================================]
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
mark_as_advanced(
CppUnit_INCLUDE_DIR
CppUnit_LIBRARY
)
set(_FIND_CPPUNIT_ADDITIONAL_OPTIONS "")
if(DISABLE_CMAKE_SEARCH_PATHS)
set(_FIND_CPPUNIT_ADDITIONAL_OPTIONS NO_DEFAULT_PATH)
endif()
# Set _CPPUNIT_ROOT based on a user provided root var. Xxx_ROOT and ENV{Xxx_ROOT}
# are prioritised over the legacy capitalized XXX_ROOT variables for matching
# CMake 3.12 behaviour
# @todo deprecate -D and ENV CPPUNIT_ROOT from CMake 3.12
if(CppUnit_ROOT)
set(_CPPUNIT_ROOT ${CppUnit_ROOT})
elseif(DEFINED ENV{CppUnit_ROOT})
set(_CPPUNIT_ROOT $ENV{CppUnit_ROOT})
elseif(CPPUNIT_ROOT)
set(_CPPUNIT_ROOT ${CPPUNIT_ROOT})
elseif(DEFINED ENV{CPPUNIT_ROOT})
set(_CPPUNIT_ROOT $ENV{CPPUNIT_ROOT})
endif()
# Additionally try and use pkconfig to find cppunit
if(USE_PKGCONFIG)
if(NOT DEFINED PKG_CONFIG_FOUND)
find_package(PkgConfig)
endif()
pkg_check_modules(PC_CppUnit QUIET cppunit)
endif()
# ------------------------------------------------------------------------
# Search for CppUnit include DIR
# ------------------------------------------------------------------------
set(_CPPUNIT_INCLUDE_SEARCH_DIRS "")
list(APPEND _CPPUNIT_INCLUDE_SEARCH_DIRS
${CPPUNIT_INCLUDEDIR}
${_CPPUNIT_ROOT}
${PC_CppUnit_INCLUDEDIR}
${SYSTEM_LIBRARY_PATHS}
)
# Look for a standard cppunit header file.
find_path(CppUnit_INCLUDE_DIR cppunit/Portability.h
${_FIND_CPPUNIT_ADDITIONAL_OPTIONS}
PATHS ${_CPPUNIT_INCLUDE_SEARCH_DIRS}
PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
)
if(EXISTS "${CppUnit_INCLUDE_DIR}/cppunit/Portability.h")
file(STRINGS "${CppUnit_INCLUDE_DIR}/cppunit/Portability.h"
_cppunit_version_string REGEX "#define CPPUNIT_VERSION "
)
string(REGEX REPLACE "#define CPPUNIT_VERSION +\"(.+)\".*$" "\\1"
_cppunit_version_string "${_cppunit_version_string}"
)
string(STRIP "${_cppunit_version_string}" CppUnit_VERSION)
unset(_cppunit_version_string )
endif()
# ------------------------------------------------------------------------
# Search for CppUnit lib DIR
# ------------------------------------------------------------------------
if(NOT DEFINED CPPUNIT_DEBUG_SUFFIX)
set(CPPUNIT_DEBUG_SUFFIX "d")
endif()
set(_CPPUNIT_LIBRARYDIR_SEARCH_DIRS "")
list(APPEND _CPPUNIT_LIBRARYDIR_SEARCH_DIRS
${CPPUNIT_LIBRARYDIR}
${_CPPUNIT_ROOT}
${PC_CppUnit_LIBDIR}
${SYSTEM_LIBRARY_PATHS}
)
# Library suffix handling
set(_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
if(MSVC)
if(CPPUNIT_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
else()
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_dll.lib")
endif()
else()
if(CPPUNIT_USE_STATIC_LIBS)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
endif()
endif()
list(APPEND CPPUNIT_BUILD_TYPES RELEASE DEBUG)
foreach(BUILD_TYPE ${CPPUNIT_BUILD_TYPES})
set(_CPPUNIT_LIB_NAME cppunit)
if(BUILD_TYPE STREQUAL DEBUG)
set(_CPPUNIT_LIB_NAME "${_CPPUNIT_LIB_NAME}${CPPUNIT_DEBUG_SUFFIX}")
endif()
# Find the lib
find_library(CppUnit_LIBRARY_${BUILD_TYPE} ${_CPPUNIT_LIB_NAME}
${_FIND_CPPUNIT_ADDITIONAL_OPTIONS}
PATHS ${_CPPUNIT_LIBRARYDIR_SEARCH_DIRS}
PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
)
endforeach()
# Reset library suffix
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
unset(_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
if(CppUnit_LIBRARY_DEBUG AND CppUnit_LIBRARY_RELEASE)
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(_isMultiConfig OR CMAKE_BUILD_TYPE)
set(CppUnit_LIBRARY optimized ${CppUnit_LIBRARY_RELEASE} debug ${CppUnit_LIBRARY_DEBUG})
else()
# For single-config generators where CMAKE_BUILD_TYPE has no value,
# just use the release libraries
set(CppUnit_LIBRARY ${CppUnit_LIBRARY_RELEASE})
endif()
# FIXME: This probably should be set for both cases
set(CppUnit_LIBRARIES optimized ${CppUnit_LIBRARY_RELEASE} debug ${CppUnit_LIBRARY_DEBUG})
endif()
# if only the release version was found, set the debug variable also to the release version
if(CppUnit_LIBRARY_RELEASE AND NOT CppUnit_LIBRARY_DEBUG)
set(CppUnit_LIBRARY_DEBUG ${CppUnit_LIBRARY_RELEASE})
set(CppUnit_LIBRARY ${CppUnit_LIBRARY_RELEASE})
set(CppUnit_LIBRARIES ${CppUnit_LIBRARY_RELEASE})
endif()
# if only the debug version was found, set the release variable also to the debug version
if(CppUnit_LIBRARY_DEBUG AND NOT CppUnit_LIBRARY_RELEASE)
set(CppUnit_LIBRARY_RELEASE ${CppUnit_LIBRARY_DEBUG})
set(CppUnit_LIBRARY ${CppUnit_LIBRARY_DEBUG})
set(CppUnit_LIBRARIES ${CppUnit_LIBRARY_DEBUG})
endif()
# If the debug & release library ends up being the same, omit the keywords
if("${CppUnit_LIBRARY_RELEASE}" STREQUAL "${CppUnit_LIBRARY_DEBUG}")
set(CppUnit_LIBRARY ${CppUnit_LIBRARY_RELEASE} )
set(CppUnit_LIBRARIES ${CppUnit_LIBRARY_RELEASE} )
endif()
if(CppUnit_LIBRARY)
set(CppUnit_FOUND TRUE)
else()
set(CppUnit_FOUND FALSE)
endif()
# ------------------------------------------------------------------------
# Cache and set CppUnit_FOUND
# ------------------------------------------------------------------------
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CppUnit
FOUND_VAR CppUnit_FOUND
REQUIRED_VARS
CppUnit_LIBRARY
CppUnit_INCLUDE_DIR
VERSION_VAR CppUnit_VERSION
)
if(NOT CppUnit_FOUND)
if(CppUnit_FIND_REQUIRED)
message(FATAL_ERROR "Unable to find CppUnit")
endif()
return()
endif()
# Partition release/debug lib vars
set(CppUnit_RELEASE_LIBRARIES ${CppUnit_LIBRARY_RELEASE})
get_filename_component(CppUnit_RELEASE_LIBRARY_DIRS ${CppUnit_RELEASE_LIBRARIES} DIRECTORY)
set(CppUnit_DEBUG_LIBRARIES ${CppUnit_LIBRARY_DEBUG})
get_filename_component(CppUnit_DEBUG_LIBRARY_DIRS ${CppUnit_DEBUG_LIBRARIES} DIRECTORY)
set(CppUnit_LIBRARIES ${CppUnit_RELEASE_LIBRARIES})
set(CppUnit_LIBRARY_DIRS ${CppUnit_RELEASE_LIBRARY_DIRS})
set(CppUnit_INCLUDE_DIRS ${CppUnit_INCLUDE_DIR})
# Configure lib type. If XXX_USE_STATIC_LIBS, we always assume a static
# lib is in use. If win32, we can't mark the import .libs as shared, so
# these are always marked as UNKNOWN. Otherwise, infer from extension.
set(CPPUNIT_LIB_TYPE UNKNOWN)
if(CPPUNIT_USE_STATIC_LIBS)
set(CPPUNIT_LIB_TYPE STATIC)
elseif(UNIX)
get_filename_component(_CPPUNIT_EXT ${CppUnit_LIBRARY_RELEASE} EXT)
if(_CPPUNIT_EXT STREQUAL ".a")
set(CPPUNIT_LIB_TYPE STATIC)
elseif(_CPPUNIT_EXT STREQUAL ".so" OR
_CPPUNIT_EXT STREQUAL ".dylib")
set(CPPUNIT_LIB_TYPE SHARED)
endif()
endif()
if(NOT TARGET CppUnit::cppunit)
add_library(CppUnit::cppunit ${CPPUNIT_LIB_TYPE} IMPORTED)
set_target_properties(CppUnit::cppunit PROPERTIES
INTERFACE_COMPILE_OPTIONS "${PC_CppUnit_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${CppUnit_INCLUDE_DIRS}")
# Standard location
set_target_properties(CppUnit::cppunit PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${CppUnit_LIBRARY}")
# Release location
if(EXISTS "${CppUnit_LIBRARY_RELEASE}")
set_property(TARGET CppUnit::cppunit APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(CppUnit::cppunit PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${CppUnit_LIBRARY_RELEASE}")
endif()
# Debug location
if(EXISTS "${CppUnit_LIBRARY_DEBUG}")
set_property(TARGET CppUnit::cppunit APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(CppUnit::cppunit PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${CppUnit_LIBRARY_DEBUG}")
endif()
endif()
+1 -1
View File
@@ -64,7 +64,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
+1 -1
View File
@@ -87,7 +87,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
+1 -1
View File
@@ -93,7 +93,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
+19 -1
View File
@@ -64,6 +64,8 @@ This will define the following variables:
True if the OpenVDB Library has been built with log4cplus support
``OpenVDB_USES_IMATH_HALF``
True if the OpenVDB Library has been built with Imath half support
``OpenVDB_USES_DELAYED_LOADING``
True if the OpenVDB Library has been built with delayed-loading
``OpenVDB_ABI``
Set if this module was able to determine the ABI number the located
OpenVDB Library was built against. Unset otherwise.
@@ -107,7 +109,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
@@ -520,6 +522,7 @@ set(OpenVDB_USES_BLOSC ${USE_BLOSC})
set(OpenVDB_USES_ZLIB ${USE_ZLIB})
set(OpenVDB_USES_LOG4CPLUS ${USE_LOG4CPLUS})
set(OpenVDB_USES_IMATH_HALF ${USE_IMATH_HALF})
set(OpenVDB_USES_DELAYED_LOADING ${OPENVDB_USE_DELAYED_LOADING})
set(OpenVDB_DEFINITIONS)
if(WIN32)
@@ -552,6 +555,7 @@ if(_OPENVDB_HAS_NEW_VERSION_HEADER)
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_IMATH_HALF" OpenVDB_USES_IMATH_HALF)
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_BLOSC" OpenVDB_USES_BLOSC)
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_ZLIB" OpenVDB_USES_ZLIB)
OPENVDB_GET_VERSION_DEFINE(${_OPENVDB_VERSION_HEADER} "OPENVDB_USE_DELAYED_LOADING" OpenVDB_USES_DELAYED_LOADING)
elseif(NOT OPENVDB_USE_STATIC_LIBS)
# Use GetPrerequisites to see which libraries this OpenVDB lib has linked to
# which we can query for optional deps. This basically runs ldd/otoll/objdump
@@ -598,6 +602,11 @@ elseif(NOT OPENVDB_USE_STATIC_LIBS)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_IMATH_HALF ON)
endif()
string(FIND ${PREREQUISITE} "boost_iostreams" _HAS_DEP)
if(NOT ${_HAS_DEP} EQUAL -1)
set(OpenVDB_USES_DELAYED_LOADING ON)
endif()
endforeach()
unset(_OPENVDB_PREREQUISITE_LIST)
@@ -619,6 +628,10 @@ if(OpenVDB_USES_IMATH_HALF)
find_package(Imath REQUIRED CONFIG)
endif()
if(OpenVDB_USES_DELAYED_LOADING)
find_package(Boost REQUIRED COMPONENTS iostreams)
endif()
if(UNIX)
find_package(Threads REQUIRED)
endif()
@@ -630,6 +643,11 @@ endif()
set(_OPENVDB_VISIBLE_DEPENDENCIES "")
if(OpenVDB_USES_DELAYED_LOADING)
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES Boost::iostreams)
list(APPEND OpenVDB_DEFINITIONS OPENVDB_USE_DELAYED_LOADING)
endif()
if(OpenVDB_USES_IMATH_HALF)
list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES Imath::Imath)
endif()
+1 -1
View File
@@ -93,7 +93,7 @@ may be provided to tell this module where to look.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
include(GNUInstallDirs)
+1 -1
View File
@@ -47,7 +47,7 @@ The following variables may be provided to tell this module where to look.
# Find the glfw3 installation and use glfw's CMake to initialize
# the glfw lib
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
set(_FIND_GLFW3_ADDITIONAL_OPTIONS "")
if(DISABLE_CMAKE_SEARCH_PATHS)
+1 -1
View File
@@ -73,7 +73,7 @@ may be provided to tell this module where to look.
# Find the Houdini installation and use Houdini's CMake to initialize
# the Houdini lib
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
# Include utility functions for version information
include(${CMAKE_CURRENT_LIST_DIR}/OpenVDBUtils.cmake)
+1 -1
View File
@@ -51,7 +51,7 @@ variables may be provided to tell this module where to look.
# Find the Maya installation and use Maya's CMake to initialize
# the Maya lib
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
set(_FIND_MAYA_ADDITIONAL_OPTIONS "")
+5 -117
View File
@@ -57,7 +57,7 @@ The following functions are provided:
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
function(OPENVDB_GET_VERSION_DEFINE HEADER KEY VALUE)
@@ -83,8 +83,8 @@ function(OPENVDB_GET_VERSION_DEFINE HEADER KEY VALUE)
endfunction()
###############################################################################
###############################################################################
########################################################################
########################################################################
function(OPENVDB_VERSION_FROM_HEADER OPENVDB_VERSION_FILE)
@@ -120,8 +120,8 @@ function(OPENVDB_VERSION_FROM_HEADER OPENVDB_VERSION_FILE)
endfunction()
###############################################################################
###############################################################################
########################################################################
########################################################################
function(OPENVDB_ABI_VERSION_FROM_PRINT OPENVDB_PRINT)
@@ -162,115 +162,3 @@ function(OPENVDB_ABI_VERSION_FROM_PRINT OPENVDB_PRINT)
set(${_VDB_ABI} ${_OpenVDB_ABI} PARENT_SCOPE)
endif()
endfunction()
###############################################################################
## @brief Compute the enumerated ISA value for x86/x86_64 architectures that
## VCL will use during compilation of OpenVDB. The value is stored in the
## VCL_INSTRSET variable. Possible values are:
## 0: Unknown or error
## 2: SSE2
## 3: SSE3
## 4: SSSE3
## 5: SSE4.1
## 6: SSE4.2
## 7: AVX
## 8: AVX2
## 9: AVX512F
## 10: AVX512BW/DQ/VL
function(OPENVDB_COMPUTE_X86_INSTRSET_FROM_VCL VCL_INSTRSET)
# Append project specific flags
set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
if(OPENVDB_SIMD STREQUAL "AVX")
set(CMAKE_REQUIRED_FLAGS "-mavx;-msse4.2")
elseif(OPENVDB_SIMD STREQUAL "SSE42")
set(CMAKE_REQUIRED_FLAGS "-msse4.2")
endif()
# Figure out that the INSTRSET macro would expand to.
# @note would be much faster with try_run but this way doesn't involve
# invoking bad instruction sets on unsupported ISAs on the build machine.
include(CheckCXXSourceCompiles)
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 10); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX512VL_DQ_BW__)
if(COMPUTE_VCL_INSTRSET__AVX512VL_DQ_BW__)
set(${VCL_INSTRSET} 10 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 9); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX512F__)
if(COMPUTE_VCL_INSTRSET__AVX512F__)
set(${VCL_INSTRSET} 9 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 8); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX2__)
if(COMPUTE_VCL_INSTRSET__AVX2__)
set(${VCL_INSTRSET} 8 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 7); return 0; } ]] COMPUTE_VCL_INSTRSET__AVX__)
if(COMPUTE_VCL_INSTRSET__AVX__)
set(${VCL_INSTRSET} 7 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 6); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE4_2__)
if(COMPUTE_VCL_INSTRSET__SSE4_2__)
set(${VCL_INSTRSET} 6 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 5); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE4_1__)
if(COMPUTE_VCL_INSTRSET__SSE4_1__)
set(${VCL_INSTRSET} 5 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 4); return 0; } ]] COMPUTE_VCL_INSTRSET__SSSE3__)
if(COMPUTE_VCL_INSTRSET__SSSE3__)
set(${VCL_INSTRSET} 4 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 3); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE3__)
if(COMPUTE_VCL_INSTRSET__SSE3__)
set(${VCL_INSTRSET} 3 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 2); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE2__)
if(COMPUTE_VCL_INSTRSET__SSE2__)
set(${VCL_INSTRSET} 2 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
check_cxx_source_compiles([[
#include "${CMAKE_SOURCE_DIR}/ext/vcl/openvdb/ext/vcl/instrset.h"
int main() { static_assert(INSTRSET == 1); return 0; } ]] COMPUTE_VCL_INSTRSET__SSE__)
if(COMPUTE_VCL_INSTRSET__SSE__)
set(${VCL_INSTRSET} 1 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
return()
endif()
# Unknown or error
set(${VCL_INSTRSET} 0 PARENT_SCOPE)
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
endfunction()
+1 -1
View File
@@ -16,7 +16,7 @@ existing from a previous run of cmake.
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
set(MANIFEST "${CMAKE_CURRENT_BINARY_DIR}/install_manifest.txt")
+1 -42
View File
@@ -7,7 +7,7 @@
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
###############################################################################
@@ -127,47 +127,6 @@ endif()
###############################################################################
# x86 ISA selection
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 1)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 2)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse2>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 3)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse3>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 4)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mssse3>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 5)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.1>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 6)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-msse4.2>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 7)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 8)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx2>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 9)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512f>")
endif()
if(OPENVDB_X86_INSTRSET GREATER_EQUAL 10)
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512bw>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512dq>")
add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:-mavx512vl>")
endif()
elseif(OPENVDB_X86_INSTRSET GREATER 0)
message(WARNING "OPENVDB_X86_INSTRSET has been set but has no effect when building for ${CMAKE_SYSTEM_PROCESSOR}.")
endif()
###############################################################################
# Increase the number of sections that an object file can contain
add_compile_options("$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/bigobj>")
# Enable MSVC options that make it behave like other compilers
+26 -23
View File
@@ -8,7 +8,7 @@
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
###############################################################################
@@ -27,9 +27,7 @@ set(OPENVDB_DEPRECATED_ABI_LIST ${MINIMUM_OPENVDB_ABI_VERSION} ${_PREV_ABI})
unset(_PREV_ABI)
if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
# @note Currently tracking CY2024 of the VFX platform where available
# (that is, our minimum requirements are for the current VFX platform)
# minus 2 years to be able to build with legacy ABI)
# @note Currently tracking CY2022 of the VFX platform where available
# @Note Compiler versions are not really a hard and fast rule, you just need
# a compiler with complete support for our MINIMUM_CXX_STANDARD (currently 17).
@@ -41,27 +39,32 @@ if(NOT DISABLE_DEPENDENCY_VERSION_CHECKS)
set(MINIMUM_ICC_VERSION 19)
set(MINIMUM_MSVC_VERSION 19.30) # 1928 (Visual Studio 2019 Version 16.8 + 16.9)
set(MINIMUM_BOOST_VERSION 1.82)
set(MINIMUM_OPENEXR_VERSION 3.2)
set(MINIMUM_IMATH_VERSION 3.2)
set(MINIMUM_BOOST_VERSION 1.80)
# Nanobind does not store the version in the CMake config file in 2.0.0.
# This issue was fixed in 2.1.0 so next time we bump the minimum version,
# we can define this.
#set(MINIMUM_NANOBIND_VERSION 2.0.0)
set(MINIMUM_IMATH_VERSION 3.1)
set(MINIMUM_OPENEXR_VERSION 3.1)
set(MINIMUM_ZLIB_VERSION 1.2.7)
set(MINIMUM_TBB_VERSION 2020.3)
set(MINIMUM_LLVM_VERSION 15.0.0)
set(MINIMUM_LLVM_VERSION 13.0.0)
set(MINIMUM_BLOSC_VERSION 1.17.0)
set(MINIMUM_GLFW_VERSION 3.3)
set(MINIMUM_GLFW_VERSION 3.1)
set(MINIMUM_PYTHON_VERSION 3.11)
set(MINIMUM_PYTHON_VERSION 3.10)
set(MINIMUM_NUMPY_VERSION 1.23.0)
set(MINIMUM_GOOGLETEST_VERSION 1.10)
set(MINIMUM_LOG4CPLUS_VERSION 2.0)
set(MINIMUM_HOUDINI_VERSION 20.5)
set(MINIMUM_LOG4CPLUS_VERSION 1.1.2)
set(MINIMUM_HOUDINI_VERSION 19.5)
# These always promote warnings rather than errors
set(MINIMUM_MAYA_VERSION 2017)
set(MINIMUM_DOXYGEN_VERSION 1.8.8)
endif()
# VFX 24 deprecations to transition to MINIMUM_* variables in OpenVDB 14.0.0
# VFX 23 deprecations to transition to MINIMUM_* variables in OpenVDB 12.0.0
# @note At the time of writing, any variables that are commented out don't
# have target transitional versions.
@@ -70,16 +73,16 @@ endif()
# set(FUTURE_MINIMUM_ICC_VERSION 19)
# set(FUTURE_MINIMUM_CXX_STANDARD 20)
set(FUTURE_MINIMUM_CMAKE_VERSION 4.0)
set(FUTURE_MINIMUM_OPENEXR_VERSION 3.3)
set(FUTURE_MINIMUM_IMATH_VERSION 3.3)
set(FUTURE_MINIMUM_TBB_VERSION 2021)
set(FUTURE_MINIMUM_BOOST_VERSION 1.85)
#set(FUTURE_MINIMUM_GLFW_VERSION 3.3)
#set(FUTURE_MINIMUM_LOG4CPLUS_VERSION 2.0)
set(FUTURE_MINIMUM_NANOBIND_VERSION 2.5.0)
set(FUTURE_MINIMUM_CMAKE_VERSION 3.24)
set(FUTURE_MINIMUM_OPENEXR_VERSION 3.2)
set(FUTURE_MINIMUM_BOOST_VERSION 1.82)
set(FUTURE_MINIMUM_GLFW_VERSION 3.3)
set(FUTURE_MINIMUM_LOG4CPLUS_VERSION 2.0)
# set(FUTURE_MINIMUM_NANOBIND_VERSION 2.1.0)
# set(FUTURE_MINIMUM_BLOSC_VERSION 1.17.0)
# set(FUTURE_MINIMUM_PYTHON_VERSION 3.11)
# set(FUTURE_MINIMUM_TBB_VERSION 2020.3)
set(FUTURE_MINIMUM_PYTHON_VERSION 3.11)
set(FUTURE_MINIMUM_NUMPY_VERSION 1.26.0)
# set(FUTURE_MINIMUM_HOUDINI_VERSION 20.0)
set(FUTURE_MINIMUM_LLVM_VERSION 18.0.0)
set(FUTURE_MINIMUM_LLVM_VERSION 15.0.0)
+22 -100
View File
@@ -7,7 +7,7 @@
#]=======================================================================]
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
project(OpenVDBDocs LANGUAGES NONE)
include(GNUInstallDirs)
@@ -25,16 +25,8 @@ option(OPENVDB_DOXYGEN_NANOVDB "Build NanoVDB documentation" ON)
option(OPENVDB_DOXYGEN_INTERNAL [=[
Enable documentation of methods and classes which have been explicitly marked as internal
]=] OFF)
# When enabled, Doxygen's WARN_AS_ERROR=FAIL_ON_WARNINGS makes any warning fail
# the docs build (it still generates the docs and writes the full warning log
# first, then exits non-zero). CI turns this ON -- see .github/workflows/docs.yml
# -- so net-new doc warnings fail the PR that introduces them. Defaults OFF so a
# local doc build isn't blocked by a stray warning from a different Doxygen
# version; pass -DOPENVDB_DOXYGEN_WARN_AS_ERROR=ON to gate locally too.
option(OPENVDB_DOXYGEN_WARN_AS_ERROR
"Treat Doxygen warnings as errors" OFF)
find_package(Doxygen 1.0...<1.15.0 REQUIRED doxygen)
find_package(Doxygen REQUIRED doxygen)
if(MINIMUM_DOXYGEN_VERSION)
if(DOXYGEN_VERSION VERSION_LESS MINIMUM_DOXYGEN_VERSION)
message(WARNING "The doxygen-config doxyfile has been generated with version "
@@ -49,11 +41,12 @@ set(DOXY_FILES
openvdb/openvdb/io
openvdb/openvdb/math
openvdb/openvdb/points
openvdb/openvdb/thread
openvdb/openvdb/points/impl
openvdb/openvdb/python/pyopenvdb.h
openvdb/openvdb/tools
openvdb/openvdb/tools/impl
openvdb/openvdb/tree
openvdb/openvdb/util
ext/imath/openvdb/math
doc/build.txt
doc/changes.txt
doc/codingstyle.txt
@@ -65,93 +58,28 @@ set(DOXY_FILES
doc/points.txt
doc/python.txt)
if(OPENVDB_DOXYGEN_INTERNAL)
list(APPEND
openvdb/openvdb/points/impl
openvdb/openvdb/tools/impl)
endif()
if(NOT OPENVDB_DOXYGEN_INTERNAL)
# Hide implementation-detail symbols in the lowercase `internal` namespaces
# (the project convention for non-public helpers). Note: do NOT add a
# capital-I "*Internal*" glob here -- it also matches the public
# tree::InternalNode (and nanovdb::InternalNode) class, silently dropping it
# from the docs and breaking every \link to it (e.g. InternalNode::childCount
# in doc/changes.txt) while its RootNode/LeafNode siblings resolve fine.
set(DOXYGEN_EXCLUDE_SYMBOLS
"*internal*")
endif()
set(DOXYGEN_PROJECT_NAME "OpenVDB")
set(DOXYGEN_PROJECT_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/img/openvdb_logo.png")
set(DOXYGEN_PROJECT_NUMBER "${OpenVDB_VERSION}")
set(DOXYGEN_PROJECT_BRIEF "")
set(DOXYGEN_FILE_PATTERNS *.h *h.in) # headers only
set(DOXYGEN_EXTENSION_MAPPING .in=C) # parse CMake config headers as C
set(DOXYGEN_IMAGE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/img")
set(DOXYGEN_IMAGE_PATH "doc/img")
set(DOXYGEN_RECURSIVE NO)
set(DOXYGEN_NUM_PROC_THREADS 0) # detects from system
# Enable \snippet resolution against the on-disk example sources. Paths in
# \snippet directives are resolved relative to EXAMPLE_PATH, so referring to
# `nanovdb/nanovdb/examples/ex_xxx/yyy.cc` from a doc page works as written.
set(DOXYGEN_EXAMPLE_PATH "${CMAKE_SOURCE_DIR}")
set(DOXYGEN_EXAMPLE_PATTERNS *.cc *.cpp *.cu *.cuh *.h *.txt)
set(DOXYGEN_EXAMPLE_RECURSIVE YES)
# Always capture Doxygen warnings to a logfile so CI can publish it as an
# artifact and contributors can see exactly what's broken.
set(DOXYGEN_WARN_LOGFILE "${CMAKE_CURRENT_BINARY_DIR}/doxygen.warnings.log")
if(OPENVDB_DOXYGEN_WARN_AS_ERROR)
# FAIL_ON_WARNINGS keeps generating docs but exits non-zero at the end if
# any warning was emitted. Requires Doxygen >= 1.9.x.
set(DOXYGEN_WARN_AS_ERROR FAIL_ON_WARNINGS)
# Don't suppress messages so contributors can see warnings during the build.
set(DOXYGEN_QUIET NO)
else()
set(DOXYGEN_QUIET YES)
endif()
set(DOXYGEN_QUIET YES)
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_GENERATE_MAN NO)
set(DOXYGEN_GENERATE_LATEX NO)
set(DOXYGEN_GENERATE_TODOLIST NO)
set(DOXYGEN_HTML_TIMESTAMP NO) # for simpler website diffs
# Render math formulas via MathJax instead of LaTeX -> PNG. This removes the
# entire `latex`/`dvips`/`gs` toolchain dependency from both local doc builds
# and CI (see .github/workflows/docs.yml), eliminates a class of cross-platform
# install pain, and produces crisper, selectable math in the rendered HTML.
set(DOXYGEN_USE_MATHJAX YES)
set(DOXYGEN_MATHJAX_VERSION MathJax_3) # default JS bundle loaded from a CDN
set(DOXYGEN_HTML_COLORSTYLE_HUE 4)
set(DOXYGEN_HTML_COLORSTYLE_SAT 222)
set(DOXYGEN_HTML_TIMESTAMP NO) # for simpler website diffs
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_EXTRACT_STATIC YES)
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO)
# Configuration for doxygen-awesome-css
# {
set(DOXYGEN_HTML_COLORSTYLE_HUE 209)
set(DOXYGEN_HTML_COLORSTYLE_SAT 255)
set(DOXYGEN_HTML_COLORSTYLE_GAMMA 113)
set(DOXYGEN_GENERATE_TREEVIEW YES)
set(DOXYGEN_DISABLE_INDEX NO)
set(DOXYGEN_FULL_SIDEBAR NO)
set(DOXYGEN_HTML_HEADER
"${CMAKE_CURRENT_SOURCE_DIR}/header.html")
set(DOXYGEN_HTML_EXTRA_STYLESHEET
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome.css"
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-sidebar-only.css"
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-sidebar-only-darkmode-toggle.css"
"${CMAKE_CURRENT_SOURCE_DIR}/openvdb.css")
set(DOXYGEN_HTML_EXTRA_FILES
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-paragraph-link.js"
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-fragment-copy-button.js"
"${CMAKE_SOURCE_DIR}/ext/doxygen-awesome/doxygen-awesome-darkmode-toggle.js")
set(DOXYGEN_HTML_COPY_CLIPBOARD NO) # required with Doxygen >= 1.10.0
set(DOXYGEN_HTML_COLORSTYLE LIGHT) # required with Doxygen >= 1.9.5
# }
# Allow for root directory paths to be listed (e.g. openvdb/io/File.h)
# Rather than just the file names (e.g. File.h). This makes it far
# easier to navigate the docs
@@ -182,13 +110,12 @@ set(DOXYGEN_HIDE_SCOPE_NAMES YES)
set(DOXYGEN_INLINE_INHERITED_MEMB YES)
set(DOXYGEN_MACRO_EXPANSION YES)
# @todo use dot with class diagrams for relevant classes
set(DOXYGEN_HAVE_DOT NO)
set(DOXYGEN_CLASS_GRAPH NO)
set(DOXYGEN_CLASS_DIAGRAMS NO)
set(DOXYGEN_ALIASES
[[ijk="(<i>i</i>,&nbsp\;<i>j</i>,&nbsp\;<i>k</i>)"]]
[[xyz="(<i>x</i>,&nbsp\;<i>y</i>,&nbsp\;<i>z</i>)"]]
[[ijk="(<i>i</i>,&nbsp;<i>j</i>,&nbsp;<i>k</i>)"]]
[[xyz="(<i>x</i>,&nbsp;<i>y</i>,&nbsp;<i>z</i>)"]]
[[const="<tt>const</tt>"]]
"\"vdbnamespace=openvdb::v${OpenVDB_MAJOR_VERSION}_${OpenVDB_MINOR_VERSION}\""
[["hunamespace=houdini_utils"]]
@@ -216,18 +143,12 @@ set(DOXYGEN_PREDEFINED
"OPENVDB_VERSION_NAME=v${OpenVDB_MAJOR_VERSION}_${OpenVDB_MINOR_VERSION}"
"OPENVDB_ABI_VERSION_NUMBER=${OpenVDB_MAJOR_VERSION}"
[[__declspec(x):= __attribute__(x):=]]
# Strip the symbol-visibility/export macro so Doxygen doesn't fold it into a
# declaration's name. Doxygen tolerates `class OPENVDB_API X` but mis-parses
# `enum OPENVDB_API X` (e.g. half::FromBitsTag in ext/imath/.../Half.h),
# reporting the enum as a documented-but-undeclared symbol.
"OPENVDB_API="
# Replace the deprecated macros with doxygen deprecated comments. This ensures
# that every bit of deprecated C++ is listed in the doxygen deprecated list,
# even if it was not properly tagged
[["OPENVDB_DEPRECATED=/** \deprecated */"]]
[["OPENVDB_DEPRECATED_MESSAGE(x)=/** \deprecated x */"]]
"OPENVDB_USE_LOG4CPLUS="
"OPENVDB_UBSAN_SUPPRESS=")
"OPENVDB_USE_LOG4CPLUS=")
set(DOXYGEN_ENABLED_SECTIONS "")
@@ -269,9 +190,9 @@ if(OPENVDB_DOXYGEN_HOUDINI)
list(APPEND DOXY_FILES
doc/houdini.txt
openvdb_houdini/openvdb_houdini/AttributeTransferUtil.h
openvdb_houdini/openvdb_houdini/reference/GEO_PrimVDB.h
openvdb_houdini/openvdb_houdini/reference/GU_PrimVDB.h
openvdb_houdini/openvdb_houdini/GEO_PrimVDB.h
openvdb_houdini/openvdb_houdini/GT_GEOPrimCollectVDB.h
openvdb_houdini/openvdb_houdini/GU_PrimVDB.h
openvdb_houdini/openvdb_houdini/GU_VDBPointTools.h
openvdb_houdini/openvdb_houdini/GeometryUtil.h
openvdb_houdini/openvdb_houdini/ParmFactory.h
@@ -284,9 +205,7 @@ if(OPENVDB_DOXYGEN_HOUDINI)
endif()
if(OPENVDB_DOXYGEN_AX)
# AX docs use @f$ inline and @f[ block math. Formula font size also applies
# under MathJax (set above). The amsmath package the AX docs assume is
# bundled by default in MathJax v3, so no extra extensions are required.
set(DOXYGEN_EXTRA_PACKAGES amsmath) # for math formatting
set(DOXYGEN_FORMULA_FONTSIZE 14)
list(APPEND DOXYGEN_ENABLED_SECTIONS "OPENVDB_AX")
@@ -302,7 +221,8 @@ if(OPENVDB_DOXYGEN_AX)
openvdb_ax/openvdb_ax/compiler
openvdb_ax/openvdb_ax/grammar
openvdb_ax/openvdb_ax/grammar/generated
openvdb_ax/openvdb_ax/math)
openvdb_ax/openvdb_ax/math
openvdb_ax/openvdb_ax/test)
endif()
if(OPENVDB_DOXYGEN_NANOVDB)
@@ -316,6 +236,7 @@ if(OPENVDB_DOXYGEN_NANOVDB)
doc/nanovdb/HelloWorld.md
nanovdb/nanovdb
nanovdb/nanovdb/util
nanovdb/nanovdb/examples/benchmark
nanovdb/nanovdb/examples/ex_bump_pool_buffer
nanovdb/nanovdb/examples/ex_collide_level_set
nanovdb/nanovdb/examples/ex_make_custom_nanovdb
@@ -334,7 +255,8 @@ if(OPENVDB_DOXYGEN_NANOVDB)
nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda
nanovdb/nanovdb/examples/ex_util
nanovdb/nanovdb/examples/ex_vox_to_nanovdb
nanovdb/nanovdb/examples/ex_write_nanovdb_grids)
nanovdb/nanovdb/examples/ex_write_nanovdb_grids
nanovdb/nanovdb/unittest)
endif()
set(DOXYGEN_VERBATIM_VARS DOXYGEN_ALIASES DOXYGEN_PREDEFINED)
+287 -225
View File
@@ -1,13 +1,14 @@
/**
<div style="width:800px;text-align:justify;">
@page ax AX Language Documentation
@page ax AX
@section axlanguage Intro
@section axlanguage AX Language Documentation
@par
Welcome to the AX Language documentation. These docs provide detailed
information on the AX language including syntax, data types, available
functionality (including OpenVDB specific methods) execution structure and
control flow. See the @ref axcplusplus documentation for the C++ developer
control flow. See the @subpage axcplusplus documentation for the C++ developer
documentation.
@note
Some sections of this document are still to be completed. Please get in touch
@@ -107,8 +108,8 @@ function (see @ref axprogramexample) and whilst there are ways to achieve
reductions, it is an example which would be better suited to a custom C++
implementation.
@par
For details of extending AX for custom geometry, see the @ref axcplusplus
developer documentation. Note that custom geometry support requires `C++` extension.
For details of extending AX for custom geometry, see the @subpage axcplusplus
developer documentation. Note that custom geometry support requires C++ extension.
@subsection axprogramexample A Program Example
@@ -132,20 +133,20 @@ The following explains the above example in relation to OpenVDB data; OpenVDB
points and OpenVDB volumes. The example demonstrates reading from a value on
some input, either a point attribute or a voxel value, and storing the
result in a @ref axdecls "local variable". Importantly, the attribute being
accessed has the name `myattribute` and the type `float`. The first statement:
accessed has the name @b `myattribute` and the type @b `float`. The first statement:
<!-- A -->@code{.c}
float temp = float@myattribute;
@endcode
Invokes a @b read from this attribute (see @ref axattribaccess), retrieving the
value from the geometry and storing it in the variable `temp` to be used in
value from the geometry and storing it in the variable @b `temp` to be used in
the AX program. The second statement:
@code{.c}
if (temp > 0.0f) float@myattribute = 0.0f;
@endcode
Performs a comparison of this value with `0.0f` and, if the value is greater
than `0.0f`, performs a @b write to the geometry in the form of
`float@myattribute = 0.0f;` which sets the value of this attribute on the
geometry to `0.0f`.
Performs a comparison of this value with @b `0.0f` and, if the value is greater
than @b `0.0f`, performs a @b write to the geometry in the form of
<b>`float@myattribute = 0.0f;`</b> which sets the value of this attribute on the
geometry to @b `0.0f`.
@par
For OpenVDB Points, this kernel is run over every point in an OpenVDB Points
Grid. In simple pseudo code:
@@ -154,7 +155,7 @@ foreach(point in pointgrid)
run_ax_kernel(point)
done()
@endcode
Where `pointgrid` is a single Point Data Grid. For OpenVDB volumes the kernel
Where @b `pointgrid` is a single Point Data Grid. For OpenVDB volumes the kernel
is run over each voxel in a provided grid:
@code{.unparsed}
foreach(grid in grids)
@@ -164,8 +165,8 @@ foreach(grid in grids)
done()
@endcode
@par
Where `grids` can comprise of any number of OpenVDB volumes. In this program,
only a floating point grid with the name `myattribute` will be updated. Each
Where @b `grids` can comprise of any number of OpenVDB volumes. In this program,
only a floating point grid with the name @b `myattribute` will be updated. Each
voxel in this grid will have it's value compared in the same way as the points
example given above.
@@ -281,9 +282,9 @@ missing types from OpenVDB.
@subsection axscalars Scalars
@par
AX Supports boolean, integer and floating point scalar types. `int` and
`int32` represent 32-bit integer values and `int64` represents a 64-bit
value. `float` and `double` represent 32-bit and 64-bit floating point
AX Supports boolean, integer and floating point scalar types. @b `int` and
@b `int32` represent 32-bit integer values and @b `int64` represents a 64-bit
value. @b `float` and @b `double` represent 32-bit and 64-bit floating point
values respectively. All scalars, excluding bools, are signed; there are no
other unsigned scalar types in AX.
@par Integer Overflow and Floating Point Truncation
@@ -308,10 +309,10 @@ int64 a = 2147483648l; // one more than can be held in an int (note the last let
int b = a; // implicit conversion. "b" is set to -2147483648
@endcode
@par Infinite and NaN values
Floating point values have two additional intrinsic states; `inf` and `nan`.
Floating point values have two additional intrinsic states; @b `inf` and @b `nan`.
These states can occur during invalid floating point arithmetic. AX performs no
checks on arithmetic to catch these values. A typical example of both `inf`
and `nan` values are division by zero expressions:
checks on arithmetic to catch these values. A typical example of both @b `inf`
and @b `nan` values are division by zero expressions:
@code
float a = 1.0f/0.0f;
print(a); // prints "inf"
@@ -336,16 +337,16 @@ There is currently support for vectors of sizes 2, 3 and 4 elements. The suffix
letter on the vector types denotes the contained elements precision, with the
number corresponding to the vector size. For example, @b `vec2i` denotes a vector
of two 32-bit integer elements. There are no native types for vectors with
`bool`, `int16` or `int64` elements, so these are not supported.
@b `bool`, @b `int16` or @b `int64` elements, so these are not supported.
@par Matrices
Matrices are stored in row major layout (lexographical access order) which
matches the representation of a matrix in OpenVDB. Matrix support consists of
`float` and `double` precision elements with dimensions either `3x3` or
`4x4` (total size of 9 and 16 elements respectively). There are no integer or
@b `float` and @b `double` precision elements with dimensions either @b `3x3` or
@b `4x4` (total size of 9 and 16 elements respectively). There are no integer or
boolean matrix types. Similiar to vectors, the suffix letter on the type denotes
the contained elements precision, with the number corresponding to the matrix
dimension. A matrix of type `mat3d` therefor corresponds to a `3x3` matrix
(9 elements) with `double` precision elements.
dimension. A matrix of type @b `mat3d` therefor corresponds to a @b `3x3` matrix
(9 elements) with @b `double` precision elements.
@par Element Access
As elements of all matrix and vector types are stored contiguously, they can be
accessed by the @ref axvecaccessop "[]&nbsp;operator". Vector elements can also be
@@ -369,10 +370,10 @@ performing matrix projections (transformations) on vector arguments.
Strings are an array of characters stored in a unique AX type which is
incompatible with @ref axopaccess "container accesses". As such, string support
is currently fairly limited. Characters themselves (users may know this as a
`char` type) have no frontend type, so a `string` type must be used for
@b `char` type) have no frontend type, so a @b `string` type must be used for
any number of characters (including the empty string). String literals are
represented by enclosing any number of @ref axtokens "supported AX characters"
by quotes&nbsp;`" "`.
by quotes <b>\"&nbsp;\"</b>.
@subsection axtypeprecedence Implicit conversion / type precedence
@par
@@ -440,9 +441,9 @@ depending on the operand types.
<th colspan="9"> Operators
</th></tr>
<tr style="text-align:center">
<td style="border-right-width: thick" colspan="4"> @ref axopbinary </td>
<td style="border-right-width: thick" colspan="3"> @ref axopunary </td>
<td colspan="2"> Other </td></tr>
<td bgcolor="#ffc4c4" style="border-right-width: thick" colspan="4"> @ref axopbinary </td>
<td bgcolor="#ffc4c4" style="border-right-width: thick" colspan="3"> @ref axopunary </td>
<td bgcolor="#ffc4c4" colspan="2"> Other </td></tr>
<tr style="text-align:center">
<td> @ref axopassignment </td>
<td> @ref axopbinarithmetic </td>
@@ -455,33 +456,50 @@ depending on the operand types.
<td> @ref axopother </td></tr>
<tr style="text-align:center">
<td><p> <!-- *********************** COLUMN ASSIGNMENT *********************** -->
`a = b`<br/>`a += b`<br/>`a -= b`<br/>`a *= b`<br/>`a /= b`<br/>`a %= b`<br/>
`a &= b`<br/>`a |= b`<br/>`a ^= b`<br/>`a <<= b`<br/>`a >>= b`
<code>
a = b<br/>a += b<br/>a -= b<br/>a *= b<br/>a /= b<br/>a %= b<br/>
a &amp;= b<br/>a |= b<br/>a ^= b<br/>a &lt;&lt;= b<br/>a &gt;&gt;= b
</code>
</p></td>
<td><p> <!-- *********************** COLUMN ARITH *********************** -->
`a + b`<br/>`a - b`<br/>`a * b`<br/>`a / b`<br/>`a % b`<br/>`a & b`<br/>`a | b`<br/>
`a ^ b`<br/>`a << b`<br/>`a >> b`
</p></td>
<code>
a + b<br/>a - b<br/>a * b<br/>a / b<br/>a % b<br/>a &amp; b<br/>a | b<br/>
a ^ b<br/>a &lt;&lt; b<br/>a &gt;&gt; b
</code></p></td>
<td><p> <!-- *********************** COLUMN COMP *********************** -->
`a == b`<br/>`a != b`<br/>`a < b`<br/>`a > b`<br/>`a <= b`<br/>`a >= b`
<code>
a == b<br/>a != b<br/>a &lt; b<br/>a &gt; b<br/>a &lt;= b<br/>a &gt;= b
</code>
</p></td>
<td style="border-right-width: thick"><p> <!-- *********************** COLUMN LOGICAL *********************** -->
`a && b`<br/>`a || b`
<code>
a&nbsp;&amp;&amp;&nbsp;b<br/>a&nbsp;||&nbsp;b
</code>
</p></td>
<td><p> <!-- *********************** COLUMN ARITH *********************** -->
`+a`<br/>`-a`<br/>`~a`
<code>
+a<br/>-a<br/>~a
</code>
</p></td>
<td><p> <!-- *********************** COLUMN LOGICAL *********************** -->
`!a`
<code>
!a
</code>
</p></td>
<td style="border-right-width: thick"><p> <!-- *********************** COLUMN INC/DEC *********************** -->
`++a`<br/>`--a`<br/>`a++`<br/>`a--`
<code>
++a<br/>\-\-a<br/>a++<br/>a\-\-
</code>
</p></td>
<td><p> <!-- *********************** COLUMN OTHER *********************** -->
`a[]`<br/>`a[,]`<br/>`a.b`
<code>
a[]<br/>a[,]<br/>a.b
</code>
</p></td>
<td><p> <!-- *********************** COLUMN OTHER *********************** -->
`a(...)`<br/>`a, b`<br/>`a ? b : c`<br/>`a ?: c`<br/>`{ a,b ... }`
<code>
a(...)<br/>a, b<br/>a ? b : c<br/>{&nbsp;a,b&nbsp;...&nbsp;}
</code>
</p></td>
</tr>
</table>
@@ -504,34 +522,34 @@ assignment operators have the following forms:
@par
<table>
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr><td>Simple assignment</td><td> @a lhs <b>`=`</b> @a rhs </td>
<td rowspan="11">Reference to @a lhs</td></tr>
<tr><td>Addition assignment</td><td> @a lhs <b>`+=`</b> @a rhs </td></tr>
<tr><td>Subtraction assignment</td><td> @a lhs <b>`-=`</b> @a rhs </td></tr>
<tr><td>Multiplication assignment</td><td> @a lhs <b>`*=`</b> @a rhs </td></tr>
<tr><td>Division assignment</td><td> @a lhs <b>`/=`</b> @a rhs </td></tr>
<tr><td>Modulo assignment</td><td> @a lhs <b>`%=`</b> @a rhs </td></tr>
<tr><td>Bitwise AND assignment</td><td> @a lhs <b>`&=`</b> @a rhs </td></tr>
<tr><td>Bitwise OR assignment</td><td> @a lhs <b>`|=`</b> @a rhs </td></tr>
<tr><td>Bitwise XOR assignment</td><td> @a lhs <b>`^=`</b> @a rhs </td></tr>
<tr><td>Bitwise shift left assignment</td><td> @a lhs <b>`<<=`</b> @a rhs </td></tr>
<tr><td>Bitwise shift right assignment</td><td> @a lhs <b>`>>=`</b> @a rhs </td></tr>
<tr><td>Simple assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Addition assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`+=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Subtraction assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`-=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Multiplication assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`*=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Division assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`/=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Modulo assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`%=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Bitwise AND assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&amp;=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Bitwise OR assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`|=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Bitwise XOR assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`^=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Bitwise shift left assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&lt;&lt;=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
<tr><td>Bitwise shift right assignment</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&gt;&gt;=`</b> @a `rhs` </td><td>Reference to @a `lhs`</td></tr>
</table>
@par
These can be further categorised into two types; direct assignment, which is
comprised only of the <b>simple assignment</b> operator, and compound assignments,
which is the set of all other assignment operators.
@par Direct Assignment
Direct assignments replace the contents of the `lhs` with a copy of the `rhs`:
Direct assignments replace the contents of the @b `lhs` with a copy of the @b
`rhs`:
@par
<table><tr>
<td> @a lhs <b>=</b> @a rhs </td>
<td bgcolor="#ffc4c4"> @a `lhs` <b>= </b> @a `rhs` </td>
</tr></table>
@par
The `rhs` side is not modified and the `lhs` is not read - only written
to. If the `rhs` type does not match the `lhs` type, the `rhs` is first
implicitly converted into a new temporary with the `lhs` type before being
copied into the `lhs`. The following combination of AX type categories are
The @b `rhs` side is not modified and the @b `lhs` is not read - only written
to. If the @b `rhs` type does not match the @b `lhs` type, the @b `rhs` is first
implicitly converted into a new temporary with the @b `lhs` type before being
copied into the @b `lhs`. The following combination of AX type categories are
supported for direct assignment (if an operation is not listed, it is not
supported):
@par
@@ -551,14 +569,15 @@ supported):
<td style="border-top-width: thick">@ref axscalars "scalar"</td>
<td style="border-top-width:thick;text-align:left">
Each element of the vector is set to the right hand side scalar. i.e.
`a[0] = b; ... a[n-1] = b;` where `n` is the size of the vector. If the
scalar type does not match element type of vector, the scalar is copied and
@ref axtypeprecedence "implicitly cast" to that type.</td>
<br/> `a[0]&nbsp;=&nbsp;b;&nbsp;...&nbsp;a[n-1]&nbsp;=&nbsp;b;` <br/>
where `n` is the size of the vector. If the scalar type does not match
element type of vector, the scalar is copied and @ref axtypeprecedence
"implicitly cast" to that type.</td>
</tr>
<tr style="text-align:center"><td>@ref axvecmats "vector"</td>
<td style="text-align:left">
Component wise assignment i.e. `a[0] = b; ... a[n-1] = b;` where `n` is the size
of the vector.
<td style="text-align:left">Component wise assignment i.e.
<br/> `a[0]&nbsp;=&nbsp;b;&nbsp;...&nbsp;a[n-1]&nbsp;=&nbsp;b;` <br/>
where `n` is the size of the vector.
<!-- A -->@code{.c}
vec3f a = 0, b = 1;
a = b;
@@ -593,7 +612,7 @@ of matrix, the scalar is copied and @ref axtypeprecedence "implicitly cast" to
that type.</td>
<tr style="text-align:center"><td>@ref axvecmats "matrix"</td>
<td style="text-align:left">Component wise assignment i.e.
<br/> `a[0] = b[0]; ... a[n-1] = b[n-1];` <br/>
<br/> `a[0]&nbsp;=&nbsp;b[0];&nbsp;...&nbsp;a[n-1]&nbsp;=&nbsp;b[n-1];` <br/>
where `n` is the @b total size of the matrix.
<!-- A -->@code{.c}
mat4f a = 0, b = 1;
@@ -626,27 +645,25 @@ int a = 1; // assign a from an integer literal of value 1
c = a; // assign components of c (x/y/z) to the result of float(a)
@endcode
@par Compound Assignment
Compound assignments replace the the contents of the `lhs` with the result of
a @ref axopbinarithmetic "binary arithmetic" operation of the `lhs` with the
`rhs`:
Compound assignments replace the the contents of the @b `lhs` with the result of
a @ref axopbinarithmetic "binary arithmetic" operation of the @b `lhs` with the
@b `rhs`:
@par
<table>
<tr><td> @a lhs @b op @a rhs </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b op @a `rhs` </td></tr>
</table>
Where @b op is one of:
Where @b op is one of :
<table><tr>
<td> <b>`+=`</b></td>
<td> <b>`-=`</b></td>
<td> <b>`*=`</b></td>
<td> <b>`/=`</b></td>
<td> <b>`%=`</b></td>
<td> <b>`&=`</b></td>
<td> <b>`|=`</b></td>
<td> <b>`^=`</b></td>
<td> <b>`<<=`</b></td>
<td> <b>`>>= `</b></td>
<td bgcolor="#ffc4c4"> <b>`+=`</b></td>
<td bgcolor="#ffc4c4"> <b>`-=`</b></td>
<td bgcolor="#ffc4c4"> <b>`*=`</b></td>
<td bgcolor="#ffc4c4"> <b>`/=`</b></td>
<td bgcolor="#ffc4c4"> <b>`%=`</b></td>
<td bgcolor="#ffc4c4"> <b>`&amp;=`</b></td>
<td bgcolor="#ffc4c4"> <b>`|=`</b></td>
<td bgcolor="#ffc4c4"> <b>`^=`</b></td>
<td bgcolor="#ffc4c4"> <b>`&lt;&lt;=`</b></td>
<td bgcolor="#ffc4c4"> <b>`&gt;&gt;= `</b></td>
</tr></table>
@par
The behaviour of a given compound assignment (for example `a += b`) is similar
@@ -663,8 +680,8 @@ int a = 1;
++a += 1; // equal to a = ++a + 1 which is equal to 3
@endcode
@par
The `rhs` side is not modified, however the `lhs` is both read from and
written to. Note that the arithmetic operation may cast either `lhs` or
The @b `rhs` side is not modified, however the @b `lhs` is both read from and
written to. Note that the arithmetic operation may cast either @b `lhs` or @b
`rhs` following the rules of AX's @ref axopbinarithmetic
"arithmetic type precedence". See the @ref axopbinarithmetic
"arithmetic operations" section for more information on arithmetic type
@@ -703,7 +720,7 @@ b = c; // b becomes 4
a = b; // a becomes float(4)
@endcode
@par
Importantly, `a` receives the result of any previous implicit casts to the
Importantly, @b `a` receives the result of any previous implicit casts to the
right hand side of its binary assignment.
@@ -720,20 +737,20 @@ container types). Binary arithmetic operations have the following forms:
@par
<table>
<tr><th>Operator&nbsp;Name</th><th>Operator&nbsp;Syntax</th><th>Returns</th></tr>
<tr><td>Addition</td><td> @a lhs <b>`+`</b> @a rhs </td><td>The sum of both operands</td></tr>
<tr><td>Subtraction</td><td> @a lhs <b>`-`</b> @a rhs </td><td>The first operand minus the second operand</td></tr>
<tr><td>Multiplication</td><td> @a lhs <b>`*`</b> @a rhs </td><td>The product of both operands</td></tr>
<tr><td>Division</td><td> @a lhs <b>`/`</b> @a rhs </td><td>The first operand divided by the second operand</td></tr>
<tr><td>Modulo</td><td> @a lhs <b>`%`</b> @a rhs </td><td>The @b floored modulo operator. See @ref axbinmultop "Multiplicative operands"</td></tr>
<tr><td>Bitwise AND</td><td> @a lhs <b>`&`</b> @a rhs </td>
<tr><td>Addition</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`+`</b> @a `rhs` </td><td>The sum of both operands</td></tr>
<tr><td>Subtraction</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`-`</b> @a `rhs` </td><td>The first operand minus the second operand</td></tr>
<tr><td>Multiplication</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`*`</b> @a `rhs` </td><td>The product of both operands</td></tr>
<tr><td>Division</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`/`</b> @a `rhs` </td><td>The first operand divided by the second operand</td></tr>
<tr><td>Modulo</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`%`</b> @a `rhs` </td><td>The @b floored modulo operator. See @ref axbinmultop "Multiplicative operands"</td></tr>
<tr><td>Bitwise AND</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&amp;`</b> @a `rhs` </td>
<td>The @b integral bitwise AND result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
<tr><td>Bitwise OR</td><td> @a lhs <b>`|`</b> @a rhs </td>
<tr><td>Bitwise OR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`|`</b> @a `rhs` </td>
<td>The @b integral bitwise OR result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
<tr><td>Bitwise XOR</td><td> @a lhs <b>`^`</b> @a rhs </td>
<tr><td>Bitwise XOR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`^`</b> @a `rhs` </td>
<td>The @b integral bitwise XOR result of each bit in the first operand applied to the bit at the same location in the second operand</td></tr>
<tr><td>Bitwise shift left</td><td> @a lhs <b>`<<`</b> @a rhs </td>
<tr><td>Bitwise shift left</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&lt;&lt;`</b> @a `rhs` </td>
<td>The @b integral bitwise left shift of the first operand by the second operand</td></tr>
<tr><td>Bitwise shift right</td><td> @a lhs <b>`>>`</b> @a rhs </td>
<tr><td>Bitwise shift right</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&gt;&gt;`</b> @a `rhs` </td>
<td>The @b integral bitwise right shift of the first operand by the second operand</td></tr>
</table>
@anchor axbinadditiveop
@@ -742,13 +759,13 @@ Binary additive operations perform summations on the input arguments. They have
the following forms:
@par
<table>
<tr><td> @a lhs @b + @a rhs </td></tr>
<tr><td> @a lhs @b - @a rhs </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `+` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `-` @a `rhs` </td></tr>
</table>
@par
After @ref axtypeprecedence "implicit conversion", the result of the binary
operation with the arithmetic `+` (@ref axtokens "plus token") is the sum of
the operands, and the result of the binary operation with the arithmetic `-`
operation with the arithmetic @b `+` (@ref axtokens "plus token") is the sum of
the operands, and the result of the binary operation with the arithmetic @b `-`
(@ref axtokens "minus token") token is the second operand subtracted from the
first operand. The following combination of AX type categories are supported for
additive operations (if an operation is not listed, it is not supported):
@@ -853,19 +870,19 @@ c - b; // valid vec - scalar
The binary multiplicative operands have the following forms:
@par
<table>
<tr><td> @a lhs `*` @a rhs </td></tr>
<tr><td> @a lhs `/` @a rhs </td></tr>
<tr><td> @a lhs `%` @a rhs </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `*` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `/` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `%` @a `rhs` </td></tr>
</table>
@par
After @ref axtypeprecedence "implicit conversion", the result of the binary
operation:
- with the arithmetic `*` (@ref axtokens "asterisk token") is:
- with the arithmetic @b `*` (@ref axtokens "asterisk token") is:
- the product of the operands
- @b OR performs matrix multiplication for vector and matrix types.
- with the arithmetic `/` (@ref axtokens "forward slash token") is the first
- with the arithmetic @b `/` (@ref axtokens "forward slash token") is the first
operand divided by the second operand.
- with the arithmetic `%` (@ref axtokens "percentage token") is the
- with the arithmetic @b `%` (@ref axtokens "percentage token") is the
@b floored modulo operations .i.e. the expression `d % D` returns the result
`D - d * floor(D/d)`. This is in contrast to truncated modulo operations
`D - d * (D/d)` where the division is truncated.
@@ -877,7 +894,7 @@ mean that the relationship properties between `%` and `/` differ when either
@b `d` or @b `D` is negative. i.e.:
`(d/D)*D + (d%D) != d`
@note
The multiplicative operation `*` has important behaviour for vectors and
The multiplicative operation @b `*` has important behaviour for vectors and
matrix types.
@par
The following combination of AX type categories are supported for multiplicative
@@ -890,7 +907,7 @@ operations (if an operation is not listed, it is not supported):
<tr style="text-align:center"><td rowspan="3">@ref axscalars "scalar"</td><td rowspan="2">`* / %`</td><td rowspan="1">@ref axscalars "scalar"</td>
<td style="text-align:left">Returns the result of the scalar multiplication, division or remainder of the division respectively. </td>
</tr>
<tr style="text-align:center"><td>@ref axvecmats "vector"</td>
<tr style="text-align:center"><td>@ref axvecmats "vector"</td></td>
<td style="text-align:left" rowspan="1">
Performs per component binary operations (after
@ref axtypeprecedence "implicit conversion") with the left hand side scalar to
@@ -1079,27 +1096,27 @@ Floating point multiplication is communicative (`a * b = b * a`) but is not
Binary bitwise operations have the following forms:
@par
<table>
<tr><td> @a lhs <b> `&` </b> @a rhs </td></tr>
<tr><td> @a lhs <b> `|` </b> @a rhs </td></tr>
<tr><td> @a lhs <b> `^` </b> @a rhs </td></tr>
<tr><td> @a lhs <b> `<<` </b> @a rhs </td></tr>
<tr><td> @a lhs <b> `>>` </b> @a rhs </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `&` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` <b> `|` </b> @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `^` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `<<` @a `rhs` </td></tr>
<tr><td bgcolor="#ffc4c4"> @a `lhs` @b `>>` @a `rhs` </td></tr>
</table>
@par
These operations only run on @b integral operands. After @ref axtypeprecedence
"implicit conversion", the result of the binary operation:
- with the @b & (@ref axtokens "ampersand token") is the result of the
- with the @b `&` (@ref axtokens "ampersand token") is the result of the
logical AND operation on each pair of the corresponding bits of the input
operands.
- with the <b> | </b> (@ref axtokens "pipe token") is the result of the
- with the <b> `|` </b> (@ref axtokens "pipe token") is the result of the
logical OR operation on each pair of the corresponding bits of the input
operands.
- with the @b ^ (@ref axtokens "hat token") is the result of the
- with the @b `^` (@ref axtokens "hat token") is the result of the
logical XOR operation on each pair of the corresponding bits of the input
operands.
- with the @b << (@ref axtokens "less than tokens") is the value shifted left
- with the @b `<<` (@ref axtokens "less than tokens") is the value shifted left
with zeros shifted in on the right.
- with the @b >> (@ref axtokens "greater than tokens") is the value shifted
- with the @b `>>` (@ref axtokens "greater than tokens") is the value shifted
right with zeros shifted in on the left.
@par
<table>
@@ -1127,17 +1144,17 @@ is of type @b `bool`. Binary comparison operations have the following forms:
@par
<table>
<tr><th>Operator&nbsp;Name</th><th>Operator&nbsp;Syntax</th><th>Returns</th></tr>
<tr><td>Equal to</td><td> @a lhs <b>`==`</b> @a rhs </td>
<tr><td>Equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`==`</b> @a `rhs` </td>
<td>Returns `true` if both operands are equal</td></tr>
<tr><td>Not equal to</td><td> @a lhs <b>`!=`</b> @a rhs </td>
<tr><td>Not equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`!=`</b> @a `rhs` </td>
<td>Returns `true` if operands are not equal</td></tr>
<tr><td>Less than</td><td> @a lhs <b>`<`</b> @a rhs </td>
<tr><td>Less than</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<`</b> @a `rhs` </td>
<td>Returns `true` the left hand side value is less than the right hand side</td></tr>
<tr><td>Greater than</td><td> @a lhs <b>`>`</b> @a rhs </td>
<tr><td>Greater than</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>`</b> @a `rhs` </td>
<td>Returns `true` the left hand side value is greater than the right hand side</td></tr>
<tr><td>Less than or equal to</td><td> @a lhs <b>`<=`</b> @a rhs </td>
<tr><td>Less than or equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`<=`</b> @a `rhs` </td>
<td>Returns `true` the left hand side value is less than or equal to the right hand side</td></tr>
<tr><td>Greater than or equal to</td><td> @a lhs <b>`>=`</b> @a rhs </td>
<tr><td>Greater than or equal to</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`>=`</b> @a `rhs` </td>
<td>Returns `true` the left hand side value is greater than or equal to the right hand side</td></tr>
</table>
@par
@@ -1247,10 +1264,10 @@ They have the following forms:
@par
<table>
<tr><th>Operator&nbsp;Name</th><th>Operator&nbsp;Syntax</th><th>Returns</th></tr>
<tr><td>AND</td><td> @a lhs <b>`&&`</b> @a rhs </td>
<tr><td>AND</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`&&`</b> @a `rhs` </td>
<td>Returns true if both operands are true. Otherwise, the result is false. This
operator is short-circuiting.</td></tr>
<tr><td>Inclusive OR</td><td> @a lhs <b>`||`</b> @a rhs </td>
<tr><td>Inclusive OR</td><td bgcolor="#ffc4c4"> @a `lhs` <b>`||`</b> @a `rhs` </td>
<td>Returns true if either the first or the second operand is true. This operator
is short-circuiting.</td></tr>
</table>
@@ -1283,14 +1300,14 @@ Arithmetic unary operators are comprised of arithemtic and bitwise operators.
@par
<table>
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr><td>Unary plus</td><td> `+a` </td>
<td>Returns the value of its operand, `a`</td>
<tr><td>Unary plus</td><td bgcolor="#ffc4c4"> <b>`+`</b>@a `a` </td>
<td>Returns the value of its operand, @b `a`</td>
</tr>
<tr><td>Unary minus</td><td> `-a` </td>
<td>Returns the negative representation of `a`</td>
<tr><td>Unary minus</td><td bgcolor="#ffc4c4"> <b>`-`</b>@a `a` </td>
<td>Returns the negative representation of @b `a`</td>
</tr>
<tr><td>Bitwise NOT</td><td> `~a` </td>
<td>Returns the bitwise NOT (one's complement) value of `a`. This operator
<tr><td>Bitwise NOT</td><td bgcolor="#ffc4c4"> <b>`~`</b>@a `a` </td>
<td>Returns the bitwise NOT (one's complement) value of @b `a`. This operator
is only valid on integral element types.</td>
</tr>
</table>
@@ -1348,7 +1365,7 @@ Logical unary operators consist of a single operand.
@par
<table>
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr><td>Logical NOT</td><td> `!a` </td>
<tr><td>Logical NOT</td><td bgcolor="#ffc4c4"> <b>`!`</b>@a `a` </td>
<td>Returns true if the operand is false. Otherwise, returns false.</td>
</tr>
</table>
@@ -1392,10 +1409,10 @@ each component of a vector or matrix. They have the following forms:
@par
<table>
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr><td>Pre-increment</td><td> `++a` </td><td>Returns a reference to the incremented result.</td>
<tr><td>Post-increment</td><td> `a++` </td><td>Returns a copy of the incremented result.</td>
<tr><td>Pre-decrement</td><td> `--a` </td><td>Returns a reference to the decremented result.</td>
<tr><td>Post-decrement</td><td> `a--` </td><td>Returns a copy of the decremented result.</td>
<tr><td>Pre-increment</td><td bgcolor="#ffc4c4"> <b>`++`</b>@a `a` </td><td>Returns a reference to the incremented result.</td>
<tr><td>Post-increment</td><td bgcolor="#ffc4c4">@a `a`<b>`++`</b> </td><td>Returns a copy of the incremented result.</td>
<tr><td>Pre-decrement</td><td bgcolor="#ffc4c4"> <b>`--`</b>@a `a` </td><td>Returns a reference to the decremented result.</td>
<tr><td>Post-decrement</td><td bgcolor="#ffc4c4"> @a `a`<b>`--`</b> </td><td>Returns a copy of the decremented result.</td>
</tr>
</table>
@par
@@ -1427,20 +1444,20 @@ the following forms:
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr style="text-align:left">
<td>Dot&nbsp;Component&nbsp;Access</td>
<td> <em>`vector`</em>&nbsp;<b>.</b>&nbsp;`component` </td>
<td>Reference to component `component` of `vector`</td>
<td bgcolor="#ffc4c4"> <em>`vector`</em>&nbsp;<b>.</b>&nbsp;@a `component` </td>
<td>Reference to component @a `component` of @a `vector`</td>
</tr>
<tr style="text-align:left">
<td>Container&nbsp;Component&nbsp;Access</td>
<td> <em>`container`</em>&nbsp;<b>[</b>&nbsp;`exp` <b>]</b> </td>
<td>Reference to component at index `exp` of `container`</td>
<td bgcolor="#ffc4c4"> <em>`container`</em>&nbsp;<b>[</b>&nbsp;@a `exp` <b>]</b> </td>
<td>Reference to component at index @a `exp` of @a `container`</td>
</tr>
<tr style="text-align:left">
<td>Matrix&nbsp;Component&nbsp;Access</td>
<td> <em>`matrix`</em>&nbsp;<b>[</b>&nbsp;`exp1`,&nbsp;<em>`exp2`</em>&nbsp;<b>]</b> </td>
<td bgcolor="#ffc4c4"> <em>`matrix`</em>&nbsp;<b>[</b>&nbsp;@a `exp1`,&nbsp;<em>`exp2`</em>&nbsp;<b>]</b> </td>
<td>Reference to component in row <b><em>`exp1`</em></b>, column <b><em>`exp2`</em></b>.
Also equal to returning a reference to component at index: <b><em> `[exp1 * dimension + exp2]` </em></b>
of `matrix` where `dimension` is the the size of the matrix</td>
Also equal to returning a reference to component at index: <b><em> `[exp1&nbsp;*&nbsp;dimension&nbsp;+&nbsp;exp2]` </em></b>
of @a `matrix` where @a `dimension` is the the size of the matrix</td>
</tr>
</table>
@par
@@ -1454,11 +1471,11 @@ container.
The dot operator <b>.</b> is only valid for vector types. It has the form:
@par
<table><tr>
<td> `vector` <b>.</b> `component` </td>
<td bgcolor="#ffc4c4"> @a `vector` <b>.</b> @a `component` </td>
</tr></table>
@par
Where component is one of the below supported component letters. It only provides
access for the first three elements of any vector (for `vec2` types, only the
access for the first three elements of any vector (for @b `vec2` types, only the
first 2 components are accessible). Accessing a vector using the dot operator is
fundamentally the same as using the <b>`[]`</b> operator with the corresponding
integer index.
@@ -1475,12 +1492,12 @@ a_{0}\quad a_{1}\quad a_{2}
@f]
| Component | Access Index | Result |
|:-----------:|:--------------:|:-------------:|
| `A.x` | 0 | @f$ a_{0} @f$ |
| `A.r` | 0 | @f$ a_{0} @f$ |
| `A.y` | 1 | @f$ a_{1} @f$ |
| `A.g` | 1 | @f$ a_{1} @f$ |
| `A.z` | 2 | @f$ a_{2} @f$ |
| `A.b` | 2 | @f$ a_{2} @f$ |
| @b `A.x` | 0 | @f$ a_{0} @f$ |
| @b `A.r` | 0 | @f$ a_{0} @f$ |
| @b `A.y` | 1 | @f$ a_{1} @f$ |
| @b `A.g` | 1 | @f$ a_{1} @f$ |
| @b `A.z` | 2 | @f$ a_{2} @f$ |
| @b `A.b` | 2 | @f$ a_{2} @f$ |
</center>
@par
This operator can provide more immediately readability when working with
@@ -1490,12 +1507,12 @@ expressions that focus on colour or Cartesian coordinate systems.
The <b>`[]`</b> operator is valid for both vectors and matrices. It has the form:
@par
<table><tr>
<td> `container` <b>[</b><em>`exp`</em><b>]</b> </td>
<td bgcolor="#ffc4c4"> @a `container` <b>[</b><em>`exp`</em><b>]</b> </td>
</tr></table>
@par
`exp` is expected to evaluate to a value which is castable to an integer
@a `exp` is expected to evaluate to a value which is castable to an integer
following the @ref axopassignment "assignment casting" rules and falls within
the valid size of the `container`. <b>No bounds checking is performed</b>.
the valid size of the @a `container`. <b>No bounds checking is performed</b>.
@par
As matrices are also an array of contigous values, they can be accessed in the
same way. This can make some operations much simplier; a typical example being
@@ -1516,16 +1533,16 @@ for (int i = 0; i < 16; ++i) b[i] = i;
The <b>`[,]`</b> operator is only valid for matrices. It has the form:
@par
<table><tr>
<td> `matrix` <b>[</b><em>`exp1`</em>, <em>`exp2`</em><b>]</b> </td>
<td bgcolor="#ffc4c4"> @a `matrix` <b>[</b><em>`exp1`</em>, <em>`exp2`</em><b>]</b> </td>
</tr></table>
@par
`exp1` and `exp2` are expected to evaluate to a value which is castable to
@a `exp1` and @a `exp2` are expected to evaluate to a value which is castable to
an integer following the @ref axopassignment "assignment casting" rules and
falls within the valid size of the `matrix` dimensions. <b>No bounds checking
falls within the valid size of the @a `matrix` dimensions. <b>No bounds checking
is performed</b>. In general it is more readable to use this operator when
accessing specific elements, where `exp1` is the row index and `exp2` is
accessing specific elements, where @b `exp1` is the row index and @b `exp2` is
the column index. The tables below show the different access patterns for
`3x3` and `4x4` matrices.
@b `3x3` and @b `4x4` matrices.
@par
<!-- A -->@code{.c}
mat3f a;
@@ -1538,26 +1555,22 @@ for (int i = 0; i < 3; ++i)
<tr style="text-align:center">
<td style="border:none" colspan=3>
@f[
{
A=\begin{bmatrix}
a_{00}\quad a_{01}\quad a_{02}\\
a_{10}\quad a_{11}\quad a_{12}\\
a_{20}\quad a_{21}\quad a_{22}\\
\end{bmatrix}
}
@f]
</td>
<td style="border:none"></td>
<td style="border:none" colspan=3>
@f[
{
A=\begin{bmatrix}
a_{00}\quad a_{01}\quad a_{02}\quad a_{03}\\
a_{10}\quad a_{11}\quad a_{12}\quad a_{13}\\
a_{20}\quad a_{21}\quad a_{22}\quad a_{23}\\
a_{30}\quad a_{31}\quad a_{32}\quad a_{33}\\
\end{bmatrix}
}
@f]
</td>
</tr>
@@ -1571,62 +1584,112 @@ a_{30}\quad a_{31}\quad a_{32}\quad a_{33}\\
<th>Result</th>
</tr>
<tr style="text-align:center">
<td>`A[0]`</td><td>`A[0,0]`</td><td>@f$ a_{00} @f$</td>
<td>`A[0]`</td><td>`A[0,0]`</td><td>@f$ a_{00} @f$</td>
<td><code>A[0]</code></td>
<td><code>A[0,0]</code></td>
<td>@f$ a_{00} @f$</td>
<td><code>A[0]</code></td>
<td><code>A[0,0]</code></td>
<td>@f$ a_{00} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[1]`</td><td>`A[0,1]`</td><td>@f$ a_{01} @f$</td>
<td>`A[1]`</td><td>`A[0,1]`</td><td>@f$ a_{01} @f$</td>
<td><code>A[1]</code></td>
<td><code>A[0,1]</code></td>
<td>@f$ a_{01} @f$</td>
<td><code>A[1]</code></td>
<td><code>A[0,1]</code></td>
<td>@f$ a_{01} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[2]`</td><td>`A[0,2]`</td><td>@f$ a_{02} @f$</td>
<td>`A[2]`</td><td>`A[0,2]`</td><td>@f$ a_{02} @f$</td>
<td><code>A[2]</code></td>
<td><code>A[0,2]</code></td>
<td>@f$ a_{02} @f$</td>
<td><code>A[2]</code></td>
<td><code>A[0,2]</code></td>
<td>@f$ a_{02} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[3]`</td><td>`A[1,0]`</td><td>@f$ a_{10} @f$</td>
<td>`A[3]`</td><td>`A[0,3]`</td><td>@f$ a_{03} @f$</td>
<td><code>A[3]</code></td>
<td><code>A[1,0]</code></td>
<td>@f$ a_{10} @f$</td>
<td><code>A[3]</code></td>
<td><code>A[0,3]</code></td>
<td>@f$ a_{03} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[4]`</td><td>`A[1,1]`</td><td>@f$ a_{10} @f$</td>
<td>`A[4]`</td><td>`A[1,0]`</td><td>@f$ a_{10} @f$</td>
<td><code>A[4]</code></td>
<td><code>A[1,1]</code></td>
<td>@f$ a_{10} @f$</td>
<td><code>A[4]</code></td>
<td><code>A[1,0]</code></td>
<td>@f$ a_{10} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[5]`</td><td>`A[1,2]`</td><td>@f$ a_{12} @f$</td>
<td>`A[5]`</td><td>`A[1,1]`</td><td>@f$ a_{11} @f$</td>
<td><code>A[5]</code></td>
<td><code>A[1,2]</code></td>
<td>@f$ a_{12} @f$</td>
<td><code>A[5]</code></td>
<td><code>A[1,1]</code></td>
<td>@f$ a_{11} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[6]`</td><td>`A[2,0]`</td><td>@f$ a_{20} @f$</td>
<td>`A[6]`</td><td>`A[1,2]`</td><td>@f$ a_{12} @f$</td>
<td><code>A[6]</code></td>
<td><code>A[2,0]</code></td>
<td>@f$ a_{20} @f$</td>
<td><code>A[6]</code></td>
<td><code>A[1,2]</code></td>
<td>@f$ a_{12} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[7]`</td><td>`A[2,1]`</td><td>@f$ a_{21} @f$</td>
<td>`A[7]`</td><td>`A[1,3]`</td><td>@f$ a_{13} @f$</td>
<td><code>A[7]</code></td>
<td><code>A[2,1]</code></td>
<td>@f$ a_{21} @f$</td>
<td><code>A[7]</code></td>
<td><code>A[1,3]</code></td>
<td>@f$ a_{13} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[8]`</td><td>`A[2,2]`</td><td>@f$ a_{22} @f$</td>
<td>`A[8]`</td><td>`A[2,0]`</td><td>@f$ a_{20} @f$</td>
<td><code>A[8]</code></td>
<td><code>A[2,2]</code></td>
<td>@f$ a_{22} @f$</td>
<td><code>A[8]</code></td>
<td><code>A[2,0]</code></td>
<td>@f$ a_{20} @f$</td>
</tr> <!-- ******************** MAT4 DATA ONLY ******************** -->
<tr style="text-align:center">
<td style="border:right;" colspan="4" rowspan="7"></td>
<td>`A[9]`</td><td>`A[2,1]`</td><td>@f$ a_{21} @f$</td>
<td style="border:none;" colspan="3" rowspan="7"></td>
<td><code>A[9]</code></td>
<td><code>A[2,1]</code></td>
<td>@f$ a_{21} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[10]`</td><td>`A[2,2]`</td><td>@f$ a_{22} @f$</td>
<td><code>A[10]</code></td>
<td><code>A[2,2]</code></td>
<td>@f$ a_{22} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[11]`</td><td>`A[2,3]`</td><td>@f$ a_{23} @f$</td>
<td><code>A[11]</code></td>
<td><code>A[2,3]</code></td>
<td>@f$ a_{23} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[12]`</td><td>`A[3,0]`</td><td>@f$ a_{30} @f$</td>
<td><code>A[12]</code></td>
<td><code>A[3,0]</code></td>
<td>@f$ a_{30} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[13]`</td><td>`A[3,1]`</td><td>@f$ a_{31} @f$</td>
<td><code>A[13]</code></td>
<td><code>A[3,1]</code></td>
<td>@f$ a_{31} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[14]`</td><td>`A[3,2]`</td><td>@f$ a_{32} @f$</td>
<td><code>A[14]</code></td>
<td><code>A[3,2]</code></td>
<td>@f$ a_{32} @f$</td>
</tr>
<tr style="text-align:center">
<td>`A[15]`</td><td>`A[3,3]`</td><td>@f$ a_{33} @f$</td>
<td><code>A[15]</code></td>
<td><code>A[3,3]</code></td>
<td>@f$ a_{33} @f$</td>
</tr>
</table>
@@ -1640,27 +1703,22 @@ section. They have the following forms:
<tr><th>Operator Name</th><th>Operator Syntax</th><th>Returns</th></tr>
<tr style="text-align:left">
<td>Call / Explicit Cast</td>
<td> `a(...)` </td>
<td bgcolor="#ffc4c4"> <em>`a`</em><b>`(...)`</b></td>
<td>Returns the result of a function call or inbuilt explicit cast</td>
</tr>
<tr style="text-align:left">
<td>Comma</td>
<td> `a, b, ...` </td>
<td>Returns the value of the last expression after chained evaluation</td>
<td bgcolor="#ffc4c4"> <em>`a`</em><b>,</b>&nbsp; <em>`b`</em></td>
<td>Returns the value of @b `b` after chained evaluation</td>
</tr>
<tr style="text-align:left">
<td>Ternary Conditional</td>
<td> `a ? b : c` </td>
<td> `b` if `a` is true, `c` otherwise.</td>
</tr>
<tr style="text-align:left">
<td>Ternary Conditional</td>
<td> `a ? : c` </td>
<td> `a` if `a` is true, `c` otherwise.</td>
<td bgcolor="#ffc4c4"> <em>`a`</em>&nbsp;<b>`?`</b>&nbsp;<em>`b`</em>&nbsp;<b>`:`</b><em>`c`</em></td>
<td>@b `b` if @b `a` is @b true, @b `c` otherwise.</td>
</tr>
<tr>
<td>Vector/Matrix Initializer</td>
<td>`{ a, b, ... }`</td>
<td bgcolor="#ffc4c4"> <b>`{`</b>&nbsp;<em> `a,&nbsp; `</em> `b&nbsp; `<b>`...&nbsp;}`</b> </td>
<td>Returns a temporary vector or matrix</td>
</tr>
</table>
@@ -1670,10 +1728,10 @@ The function call operator provides the ability to invoke functions @b or invoke
a supported explicit cast. It has the form:
@par
<table><tr>
<td> `func(a, b, c, ...)` </td>
<td bgcolor="#ffc4c4"> <em> `func(a, b, c, ...)` </em></td>
</tr></table>
@par
Where `func` is a function name @b or a valid explicit cast typename. Explicit
Where @b `func` is a function name @b or a valid explicit cast typename. Explicit
casts are only supported for @ref axscalars "scalar types". For example:
<!-- A -->@code{.c}
int a = int(1.1f);
@@ -1682,7 +1740,7 @@ a = int(b.x);
@endcode
@par
Whilst explicit casts take only a single argument, the operator itself supports
multiple or empty arguments for function calls. When multiple arguments are
multiple or empty arguments for function calls. Whe multiple arguments are
provided, they are parsed from first to last and processed in reverse order.
@b However, the order of runtime evaluation is @b unspecified i.e. they may
evaluate in any order. Each function parameter is initialized with its
@@ -1695,10 +1753,10 @@ functions.
The Comma operator has the form:
@par
<table><tr>
<td>`a, b, ...`</td>
<td bgcolor="#ffc4c4"><em>`a`</em><b>`,` </b><em>`b`</em></td>
</tr></table>
@par
Where `a` and `b` are expressions. Chained expressions evaluate each
Where @b `a` and @b `b` are expressions. Chained expressions evaluate each
expression in syntactical order (first to last), discarding any return value
except for the last expression, which is returned from the entire list. Note that
although return values for any expression but the last are discarded, their side
@@ -1722,33 +1780,32 @@ The ternary conditional operator can be thought of as an in-line @ref axbranchin
a single expression that will be returned. It has the form:
@par
<table><tr>
<td>`a ? b : c`</td>
<td bgcolor="#ffc4c4"><em>`a`</em>&nbsp;<b>`?`</b>&nbsp;<em>`b`</em>&nbsp;<b>`:`</b><em>`c`</em></td>
</tr></table>
Where @b `a` is the condition, evaluated and converted to @b bool, and @b `b` and @b
`c` are expressions of the same or implicit-castable types. @b `b` is evaluated and
returned if the condition is @b true, @b `c` is evaluated and returned if the
condition is @b false. Only the expression out of @b `b` and @b `c` that is
returned will be evaluated. Expressions with no return value (a.k.a @b `void`)
are supported as long as @b `b` and @b `c` are both of this type.
@par
Where `a` is the condition, evaluated and converted to @b bool, and `b` and
`c` are expressions of the same or implicit-castable types. `b` is evaluated and
returned if the condition is @b true, `c` is evaluated and returned if the
condition is @b false. Only the expression out of `b` and `c` that is
returned will be evaluated. Expressions with no return value (a.k.a `void`)
are supported as long as `b` and `c` are both of this type.
@par
Also supported is the 'Elvis' operator, `a ? : c` (or `?:`).
Here, `a` is evaluated once, and if when converted to @b bool is @b true, `a` is
returned, otherwise `c` is evaluated and returned. In this case, `a` and
Also supported is the 'Elvis' operator, <b>`a` `?` `:` `c`</b> (or `?:`).
Here, @b `a` is evaluated once, and if when converted to @b bool is @b true, @b `a` is
returned, otherwise @b `c` is evaluated and returned. In this case, @b `a` and @b
`c` must be the same or implicit-castable types, and both implicit-castable to @b bool.
@anchor axvecmatinit
@par Vector/Matrix Initializer
@ref axvecmats "Vectors and matrices" can be represented as local variables (e.g.
`vec3f`), external attributes or parameters (e.g. `vec3f@attrib`) or as
@b `vec3f`), external attributes or parameters (e.g. @b `vec3f\@attrib`) or as
temporary values using the vector/matrix initializer syntax. This operator has
the form:
@par
<table><tr>
<td> `{ a, b, ... }`</td>
<td bgcolor="#ffc4c4"> <b>`{`</b>&nbsp; <em>`a,&nbsp; b&nbsp; `</em><b>`...&nbsp;}`</b> </td>
</tr></table>
@par
Where `a` and `b` are expressions returning a scalar value. When this
Where @b `a` and @b `b` are expressions returning a scalar value. When this
operator is invoked with a specific number of arguments, a vector or matrix is
implicitly created with a copy of those arguments which can be assigned to an
existing container of matching size. Expression in the operator are evaluated
@@ -1776,7 +1833,7 @@ The temporary container evaluates all expressions and uses the @b highest rankin
type (as defined by @ref axtypeprecedence "arithmetic type precedence") to infer
the element type of the container, implicitly casting all other types to that
type where necessary. In the above example, the temporary created forms a
`mat3d`, before being implicitly cast to a `mat3f` due to the assignment.
@b `mat3d`, before being implicitly cast to a @b `mat3f` due to the assignment.
@subsection axopprecedence Operator Precedence
@@ -1947,10 +2004,10 @@ can be used to assign any scalar a value.
@par
<table>
<tr><th>Type</th><th>Literal Tokens</th></tr>
<tr><td>`bool`</td><td>Tokens `true` and `false`</td></tr>
<tr><td>`bool`</td><td>Tokens @b `true` and @b `false`</td></tr>
<tr><td>`int32`</td><td>No suffix, automatically infered from integral literals</td></tr>
<tr><td>`int64`</td><td>The letter `l` e.g. @code int64 a = 10l; @endcode</td></tr>
<tr><td>`float`</td><td>The letter `f` e.g. @code float a = 0.0f; @endcode</td></tr>
<tr><td>`int64`</td><td>The letter @b `l` e.g. @code int64 a = 10l; @endcode</td></tr>
<tr><td>`float`</td><td>The letter @b `f` e.g. @code float a = 0.0f; @endcode</td></tr>
<tr><td>`double`</td><td>No suffix, automatically infered from floating point literals.</td></tr>
<tr><td>`string`</td><td>Character strings wrapped in double quotes @b \" @b \"</td></tr>
</table>
@@ -1968,6 +2025,7 @@ can be used to assign any scalar a value.
@subsection axattribaccess Attribute Access
<!-- codecs not supported, how are points and volumes sampled (point vs volume) -->
<!--
Further, the active states of
OpenVDB voxels change which voxels AX will process. The defined behavior for all
cases is shown below.
@@ -2006,6 +2064,8 @@ foreach(ActiveVoxel in surface)
DensityIndexSpaceCoord = density.transformToIndex(SurfaceWorldSpaceCoord);
ActiveVoxel = density.getValue(DensityIndexSpaceCoord);
@endcode
done()
-->
@subsection axexternalaccess External Parameter Access
@@ -2048,4 +2108,6 @@ AX Roadmap as a near future feature.
@section axvexsupport AX VEX Support
</div>
*/
+12 -9
View File
@@ -1,8 +1,9 @@
/**
<div style="width:800px;text-align:justify;">
@page axcplusplus AX C++ Documentation
@page axcplusplus OpenVDB AX
@section axcdocs Intro
@section axcdocs AX C++ Documentation
@par
The following documentation focuses on the C++ design and API of OpenVDB AX,
@b not the front end AX language. For the latter, see the
@@ -26,6 +27,7 @@ API doxygen comments or contact us for more information.
- @ref vdbaxcompiler
- @ref vdbaxbinary
- @ref vdbaxtoaxtypes
- @ref vdbaxextend
<hr>
@@ -116,7 +118,7 @@ parser is accessed through the @b ast module.
@par
The @b ast module provides:
- The complete implemenation of an @ref AST.h "AX abstract syntax tree"
- The @vdblink::ax::ast::parse ax::ast::parse()@endlink method
- The openvdb::ax::ast::parse() method
- The @vdblink::ax::ast::Visitor AST Visitor@endlink
- AST scanners and tools
@par
@@ -126,7 +128,7 @@ The complete AST hierarchy is visualized by the @vdblink::ax::ast::Node doxygen
class graph for an openvdb::ax::ast::Node@endlink, which represents the top most
node in the AST. The AST API exists in a nested namespace (`openvdb::ax::ast`)
and can be used by clients for more granular control and modifications to an AST.
Importantly, the AST API contains the `openvdb::ax::ast::parse()` method, which
Importantly, the AST API contains the openvdb::ax::ast::parse() method, which
invokes the C/C++ functions built by the grammar to iteratively construct an
AST from a provided character string.
@par
@@ -137,7 +139,7 @@ branches. All these methods use the @vdblink::ax::ast::Visitor AX visitor
framework@endlink, a visitor pattern traversal class strongly influenced by
<A HREF="https://clang.llvm.org/doxygen/classclang_1_1RecursiveASTVisitor.html">
Clang's RecursiveVisitor</A>. Clients can use the AX visitor to implement their
own AST analysis or modifications.
own AST analysis or modifications (see @ref vdbaxextend).
@subsubsection vdbaxastscanners Scanners
@par
@@ -283,11 +285,11 @@ AX ASTs to verify access patterns of your data.
@subsubsection vdbaxcompilercustomdata Custom Data
@par
The AX language provides two main tokens to access memory which has not been
allocated by AX itself. The first token, `@` (the "at" symbol), is designed to
allocated by AX itself. The first token, @b \@ (the "at" symbol), is designed to
provide read/write access to geometry attributes. The second token is the dollar
character `$`. This allows <b>read only</b> access to custom data that can be
character @b $. This allows <b>read only</b> access to custom data that can be
modified in C++ i.e. outside the scope of an AX program. In the same way as the
`@attribute` syntax, the value of this data can change without the need for AX
@b \@attribute syntax, the value of this data can change without the need for AX
to re-compile the program. It is, however, solely on the C++ clients of AX to
make sure that this data is setup correctly when integrating AX into their
applications.
@@ -485,9 +487,10 @@ Vec4IGrid::registerGrid();
@endcode
<hr>
<!--@section vdbaxextend Extending OpenVDB AX-->
@section vdbaxextend Extending OpenVDB AX
<!--@subsection vdbaxcustomtraversal Custom AST Traversal-->
<!--@subsection vdbaxcustomtraversal Designing an Executable-->
<!--@subsection vdbaxcustomtraversal Geometry Callbacks-->
<!--@subsection vdbaxcustomtraversal Custom Code Generation-->
</div>
*/
+16 -14
View File
@@ -1,4 +1,5 @@
/**
<div style="width:800px;text-align:justify;">
@page axexamples AX Code Examples
@@ -29,12 +30,12 @@ These examples demonstrate how to use AX on OpenVDB points grids.
@subsection axexamplepointbasic Basic point attributes
@par
Below is a small example which demonstrates working with a few point attributes.
The `@` symbol is the identifier for an AX attribute. The type of each attribute
is specified before the `@` symbol and the name is specified afterwards. For
example: `int@count` would imply an @b integer attribute called @b count.
The @ symbol is the identifier for an AX attribute. The type of each attribute
is specified before the @ symbol and the name is specified afterwards. For
example: @b `int\@count` would imply an @b integer attribute called @b count.
@par
In this example there are three point attributes: a @b float attribute @b speed,
a `vec3f` float attribute @b velocity and a `vec3f` float attribute @b colour.
a @b vec3f float attribute @b velocity and a @b vec3f float attribute @b colour.
@par
This snippet uses the functions @ref axlength "length" and @ref axfit "fit" to
give points a colour between black and white based on their speed.
@@ -67,8 +68,8 @@ special attribute.
@subsection axexamplepointdelete Deleting Points
@par
This example demonstrates a simple way of removing points from a VDB points grid.
It uses a combination of @ref axrand "rand()" and @ref axdeletepoint "deletepoint()"
to randomly delete roughly half of the points in the input VDB points grid.
It uses a combination of @ref axrand and @ref axdeletepoint to randomly delete
roughly half of the points in the input VDB points grid.
@par
<!-- P -->@code{.c}
float threshold = 0.5f;
@@ -82,7 +83,7 @@ if (rand(int64@id) > threshold) {
@endcode
@par
The @b id attribute in this example is assumed to be a unique @b integer for
each point in the VDB points grid such that @ref axrand "rand()" will receive a
each point in the VDB points grid such that @ref axrand will receive a
different seed value per point producing a good distribution of random values.
@subsection axexamplepointdrag Applying Drag
@@ -113,7 +114,7 @@ v@P += v@v * dt;
@endcode
@par
The final AX command, `v@P += v@v * dt;` writes to the position attribute of
the points `v@P`. Whenever position is written to in this way, the AX
the points @b `v\@P`. Whenever position is written to in this way, the AX
`PointExecutable` will move (re-bucket) points in PointDataGrids.
@subsection axexamplepointcurlnoise Curl Noise
@@ -197,12 +198,12 @@ These examples demonstrate how to use AX on VDB volume grids.
@subsection axexamplevolumeclamp Volume Clamping
@par
Below is a small example of reading adn writing to voxels within a VDB volume.
As with points, the `@` symbol specifies an access to a named volume, with the
As with points, the @ symbol specifies an access to a named volume, with the
type of each volume preceding it and the name appearing as a suffix. For
example: `float@density` would imply a @b float volume called @b density.
@par
This snippet uses @ref axclamp "clamp()" function to constrain the @b density
attribute between zero and one.
This snippet uses @ref axclamp function to constrain the @b density attribute
between zero and one.
@par
<!-- V -->@code{.c}
float@density = clamp(float@density, 0.f, 1.f);
@@ -233,10 +234,10 @@ vec3f@vel += dt * massInverse * vec3f@force;
@par
Here we demonstrate how AX can be used to blend two volumes together. Note that
only the volumes which are written to are executed over. In the below code,
only `@surface_a` is written to. This means that the final blended result,
only @b `\@surface_a` is written to. This means that the final blended result,
stored in `surface_a`, will only be updated in `surface_a`'s topology. Should
we want a combined blend of @b non @b overlapping areas of both surface `a` and
`b`, we would need to activate `a`'s topology with respect to `b` first.
we want a combined blend of @b non @b overlapping areas of both surface a and b,
we would need to activate a's topology with respect to b first.
@par
<!-- V -->@code{.c}
// time constants for each run.
@@ -262,4 +263,5 @@ mask = clamp(mask, 0.0f, 1.0f);
@surface_a = a + (b-a) * mask;
@endcode
</div>
*/
+4 -1
View File
@@ -1,4 +1,5 @@
/**
<div style="width:800px;text-align:justify;">
@page axfunctionlist AX Supported Functions
@@ -720,7 +721,7 @@ double(int64 seed);
@anchor axrand32
@par rand32
Creates a random number based on the provided 32 bit seed. The number will be in the range of 0 to
1\. The same number is produced for the same seed. NOTE: This function does not share the same
1. The same number is produced for the same seed. NOTE: This function does not share the same
random number generator as rand(). rand32() may provide a higher throughput on some
architectures, but will produce different results to rand(). NOTE: If rand32 is called without
a seed the previous state of the random number generator is advanced for the currently
@@ -880,4 +881,6 @@ int64(int64 dividend; int64 divisor);
int32(int32 dividend; int32 divisor);
@endcode
</div>
*/
+3 -1
View File
@@ -1,4 +1,5 @@
/**
<div style="width:800px;text-align:justify;">
@page openvdbax OpenVDB AX
@@ -40,6 +41,7 @@ provided:
@par
- @subpage axexamples "Code Examples" for examples of OpenVDB AX in action.
- @subpage axfunctionlist "AX Functions" for a list of all available AX functions.
- @ref build "Building OpenVDB" and @ref dependencies "OpenVDB Dependencies" for information on building OpenVDB and <b>OpenVDB AX</b>.
- @subpage build "Building OpenVDB" and @subpage dependencies "OpenVDB Dependencies" for information on building OpenVDB and <b>OpenVDB AX</b>.
</div>
*/
+19 -16
View File
@@ -238,8 +238,8 @@ it's a good idea to read the above section on
DCC | Supported Version | OpenVDB ABI |
-------- | ----------------- | ----------- |
Houdini | 20.0 | 10 |
Houdini | 20.5 | 11 |
Houdini | 21.0 | 12 |
@subsection buildBuildHou Building Against Houdini
@@ -257,10 +257,12 @@ CMake | Cross-platform family of tools designed to help build software
C++17 Compiler | Matching Houdini compiler and version | All |
Boost | Components: iostreams | All |
GoogleTest | A unit testing framework module for C++ | Unit Tests |
CppUnit | A unit testing framework module for C++ | Unit Tests (AX) |
GLFW | Simple API for OpenGL development | OpenVDB View |
Doxygen | Documentation generation from C++ | Documentation |
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
nanobind | C++/python bindings | Optional (Python) |
NumPy | Scientific computing with Python | Optional (Python) |
LLVM | Target-independent code generation | OpenVDB AX |
At a minimum a matching C++17 compiler and CMake will be required. See
@@ -288,7 +290,7 @@ Required:
Optional:
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
the link for default values.
- @b OPENVDB_HOUDINI_INSTALL_PREFIX =`/path/to/install/dir` # The location to
@@ -347,12 +349,14 @@ Boost | Components: iostreams
ZLIB | Compression library for disk serialization compression | All |
Blosc | Recommended dependency for improved disk compression | All* |
GoogleTest | A unit testing framework module for C++ | Unit Tests |
CppUnit | A unit testing framework module for C++ | Unit Tests (AX) |
GLFW | Simple API for OpenGL development | OpenVDB View |
Doxygen | Documentation generation from C++ | Documentation |
OpenEXR | EXR serialization support | OpenVDB Render |
Imath | Used half precision floating points and EXR serialization support | Optional (All) |
Log4cplus | An optional dependency for improved OpenVDB Logging | Optional (All) |
nanobind | C++/python bindings | Optional (Python) |
NumPy | Scientific computing with Python | Optional (Python) |
LLVM | Target-independent code generation | OpenVDB AX |
@@ -381,7 +385,7 @@ Required:
Optional:
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
the link for default values.
- @b OPENVDB_MAYA_INSTALL_PREFIX =`/path/to/install/dir` # The location to
@@ -449,7 +453,7 @@ Now you can call CMake by providing the absolute or relative path to the root
of the OpenVDB source tree. Below are some common options you may want to
provide:
- [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
- @b [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html)
=`/path/to/install/dir` # The location you wish to install OpenVDB to. See
the link for default values.
- @b Xxx_ROOT =`/path/to/Xxx/` # Give CMake a path to where a package has been
@@ -508,7 +512,7 @@ You can add the below CMake snippet to your main `CMakeLists.txt` to bring in
OpenVDB as a dependency:
@code{.cmake}
cmake_minimum_required(VERSION 3.24)
cmake_minimum_required(VERSION 3.20)
list(APPEND CMAKE_MODULE_PATH "/location/of/openvdb/install/lib/cmake/OpenVDB")
find_package(OpenVDB REQUIRED)
target_link_libraries(myapp OpenVDB::openvdb)
@@ -579,7 +583,8 @@ bypass these checks with `-D DISABLE_DEPENDENCY_VERSION_CHECKS=ON` if necessary.
Note that using older or untested dependencies may produce undesired behavior.
Older versions in particular are not supported by OpenVDB.
@b Note: Boost will produce a version error in the format: `Detected version of Boost is too old.`
@b Note: Boost will produce a version error in the format `Detected version of
Boost is too old.`
@subsection troubleshoot3 CMake warnings/errors in FindBoost.cmake
@@ -600,12 +605,10 @@ OpenVDB uses [imported targets](https://cmake.org/cmake/help/latest/command/add_
for all its dependencies. For imported Boost compatibility, the following
versions of CMake are required:
- Boost 1.80 requires CMake 3.24.2 or newer.
- Boost 1.81 requires CMake 3.25.2 or newer.
- Boost 1.82 requires CMake 3.27.0 or newer.
- Boost 1.83 requires CMake 3.27.4 or newer.
- Boost 1.84 requires CMake 3.28.2 or newer.
- Boost 1.85 requires CMake 3.29.3 or newer.
- Boost 1.86 requires CMake 3.30.6, 3.31.1, or newer.
- Boost 1.87 requires CMake 3.31.4 or newer.
Use the above list to identify the version of CMake you require for your version
of Boost. Note that this may be implemented into the OpenVDB CMake in the future.
@@ -631,9 +634,9 @@ Note that you can provide a value for `CMAKE_MSVC_RUNTIME_LIBRARY` which is a
native CMake variable to override any CRT selection done by OpenVDB.
For more information, see the following articles:
- Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
- In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
- Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
`CMAKE_MSVC_RUNTIME_LIBRARY` docs: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
@subsection troubleshoot5 Unexpected value for the Windows CRT with target build artifacts.
@@ -655,9 +658,9 @@ usage, it is strongly encouraged to match the selection against your desired
build type.
For more information, see the following articles:
- Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
- In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
- Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
Description of CRT selection: https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library
In depth descriptopn of the CRT on Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features
Related errors: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2038
`CMAKE_MSVC_RUNTIME_LIBRARY` docs: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
@subsection troubleshoot6 error LNK2038: mismatch detected for 'RuntimeLibrary'
+44 -355
View File
@@ -2,322 +2,9 @@
@page changes Release Notes
@htmlonly <a name="v13_0_1_changes"></a>@endhtmlonly
@htmlonly <a name="v12_0_2_changes"></a>@endhtmlonly
@par
<B>Version 13.0.1</B> - <I>In Development</I>
@htmlonly <a name="v13_0_0_changes"></a>@endhtmlonly
@par
<B>Version 13.0.0</B> - <I>November 3, 2025</I>
@par
<BLOCKQUOTE>
This version introduces ABI changes relative to older major releases, so to
preserve ABI compatibility it might be necessary to define the macro
<TT>OPENVDB_ABI_VERSION_NUMBER=</TT><I>N</I>, where, for example,
<I>N</I> is 11 for Houdini&nbsp;20.5 and 12 for Houdini&nbsp;21.0.
</BLOCKQUOTE>
@par
<BLOCKQUOTE>
Support for reading <TT>.vdb</TT> files written prior to VDB&nbsp;1.0 has been
removed. To read older <TT>.vdb</TT> files, please use VDB&nbsp;12.x or older
and re-write them, so that they use the newer file format and can be read in
VDB&nbsp;13+.
</BLOCKQUOTE>
@par
Highlights:
- OpenVDB now includes in-memory support for Half Grids and the file format
has been extended to add I/O serialization for half grids. More work is
planned on adapting algorithms when using Half Grids for better performance
and improved precision.
- NanoVDB is no longer limited to static applications, such as rendering, but
can increasingly be applied to problems that involve dynamic topology, such
as level set tracking, grid building, morphology operations and merging of
grids. This is due to the fact that we keep adding more and more tools to
NanoVDB that facilitates tree modification. However, unlike OpenVDB, these
operations generate new NanoVDB grids (as oppose to in-palace modifications
in OpenVDB), yet are typically much faster since they are performed on the
GPU. Many of these exciting new features are the foundation of fVDB.
@par
OpenVDB:
- New features:
- Added native registration of HalfGrid type.
- Added customization of the output transformation attribute for
@vdblink::points::pca points::pca@endlink. Can be output as a quaternion
or as a combined affine transform with the scale/stretch ommitted.
- Added support for input quaternions attributes and affine transformations
(that include scale) in
@vdblink::points::rasterizeSdf points::rasterizeSdf@endlink for
ellipsoidal rasterizations.
- API Changes:
- Added @c openvdb::tree::LeafBuffer::storage()
for direct const access to the raw data buffer when using the bool LeafNode.
- Removed Grid::evalMinMax(), use
@vdblink::tools::minMax tools::minMax@endlink for superior threaded
performance.
- Removed points::rasterize() that took a custom filter and interrupter.
- Removed LeafNodeBool TopologyCopy constructor in favor of using explicit
mask/buffer constructors.
- Removed @vdblink::tree::ValueAccessor ValueAccessor@endlink NodeT0,
NodeT1, NodeT2 aliases, use NodeTypeAtLevel instead.
- Add @vdblink::tree::InternalNode::setValueMaskUnsafe() InternalNode::setValueMaskUnsafe()@endlink
to write a value mask directly.
- LegacyFrustum and RootNodeMask have been removed. These classes were
only used for reading old .vdb files, which is no longer supported.
- @vdblink::io::writeCompressedValues() io::writeCompressedValues()@endlink
now takes a const ValueT* source buffer for improved const-correctness.
- Bug Fixes:
- Fix a bug in the
@vdblink::tools::LevelSetRayIntersector LevelSetRayIntersector@endlink class
where two of the methods were incorrectly adjusting the time even when an
intersection was not found.
- Fixed an assertion in @vdblink::math::Quat math::Quat@endlink where a
vector length check was using too small a tolerance.
- Fixed a bug in the unit tests where detecting if assertions were enabled
was using @c NDEBUG rather than OpenVDB assertions.
- Build:
- Removed the unnecessary @c USE_NUMPY build option for the OpenVDB Python
module. All functions which take numpy arrays are now always generated
(numpy is not required at compile time for this support).
- Bumped minimum supported CMake version to 3.24, and new future minimum to
4.0.0.
- Bumped minimum supported OpenEXR and Imath versions to 3.2, and new
future minimum to 3.3.
- Bumped minimum supported Boost version to 1.82, and new future minimum to
1.85.
- Bumped minimum supported Python version to 3.11
- Bumped minimum supported Log4cplus version to 2.0
- Bumped minimum supported Houdini version to 20.5
- Bumped minimum supported GLFW version to 3.3
- Bumped future minimum for TBB to 2021 (oneapi).
- Bumped future minimum for nanobind to 2.5.0.
@par
OpenVDB AX:
- New:
- Added support for LLVM 21.
@par
NanoVDB:
- Highlights:
- NanoVDB is no longer limited to static applications, such as rendering,
but can increasingly be applied to problems that involve dynamic topology,
such as level set tracking, grid building, morphology operations and
merging of grids. This is due to the fact that we keep adding more and
more tools to NanoVDB that facilitates tree modification. However, unlike
OpenVDB, these operations generate new NanoVDB grids (as oppose to
in-palace modifications in OpenVDB), yet are typically much faster since
they are performed on the GPU. Many of these exciting new features are the
foundation of fVDB.
- New features:
- Added <TT>nanovdb/tools/cuda/DilateGrid.cuh</TT>, which performs topology
dilation on the GPU.
- Added <TT>nanovdb/tools/cuda/MergeGrids.cuh</TT>, which merges the topology
of two grids on the GPU.
- Added <TT>nanovdb/tools/cuda/CoarsenGrid.cuh</TT>, which performs topological
coarsening of grids on the GPU.
- Added <TT>nanovdb/tools/cuda/RefineGrid.cuh</TT>, which performs topological
refinement of grids on the GPU.
- Added <TT>nanovdb/tools/cuda/PruneGrid.cuh</TT>, which prunes the topology of
a grid using a sidecar mask on the GPU.
- Added <TT>nanovdb/util/cuda/Injection.cuh</TT>, which facilitates sidecar
data copying - on the GPU - in the overlap of two grids with different
topology.
- Added Mat classes and other math types to NanoVDB.
- Major rewrite of nanovdb::NanoToOpenVDB, which now allows
nanovdb::IndexGrids and blind (or sidecar) data to be converted into
an openvdb grid.
- Added support for LevelSet, FogVolume, and Staggered grid semantics.
Added toGridClass and toSemantic to map Grid Blind data semantic to
Grid class and vice versa.
- Improvements:
- Improvements to mGPU grid building and introduction of a separate test
executable for mGPU tests
- Added stand-alone function nanovdb::writeUncompressedGrid that allows
nanovdb::IndexGrids and blind (or sidecar) data to be written directly
to a stream.
- @c nanovdb_print now (optionally) prints the blind data count per grid.
- Extended nanovdb::GridBlindDataSemantic with nanovdb::GridClass types
to support conversion between IndexGrid and regular grids.
- Improvements and bugfixes to PNanoVDB.
- API Changes:
- Removed nanovdb::ValueIndexMask and nanovdb::ValueOnIndexMask since
they are no longer used by fVDB (or elsewhere).
- NanoVDB version is now 32.9.0, so the ABI of the grid is preserved
but not the API. However, the API changes are very minor!
- Bug Fixes:
- Several fixes for compiler warnings.
- Fixed error in <TT>nanovdb/io/IO.h</TT> related to missing throws.
@par
Houdini:
- Remove support for openvdb_houdini::Interrupter, use
openvdb_houdini::HoudiniInterrupter instead.
- Remove input-stealing via duplicateSourceStealable(), SideFX have since
introduced verbification and compiled SOPs to provide zero-copy node
evaluation.
@htmlonly <a name="v12_1_1_changes"></a>@endhtmlonly
@par
<B>Version 12.1.1</B> - <I>September 30, 2025</I>
@par
OpenVDB AX:
- Fixes:
- Fixed an issue which was causing host specific optimization passes to be
omitted when using LLVM 16 and higher.
@par
Houdini:
- Fixed a compilation issue with the OpenVDB Activate SOP with Houdini 21
[Reported by \@callen128]
@htmlonly <a name="v12_1_0_changes"></a>@endhtmlonly
@par
<B>Version 12.1.0</B> - <I>August 8, 2025</I>
@par
OpenVDB:
- New features:
- New level set constructor tools::createLevelSetCapsule creates a grid
containing a narrow-band level set representation of a capsule (tube
with constant radius and sphere caps).
- New level set constructor tools::createLevelSetTaperedCapsule creates a
grid containing a narrow-band level set representation of a tapered
capsule (tube with sphere caps and different radii at both ends, or
equivalently the convex hull of two spheres with possibly different
centers and radii).
- New level set constructor tools::createLevelSetTubeComplex creates a grid
containing a narrow-band level set representation of a tube complex (a
collection of capsules or tapered capsules defined by endpoint coordinates
and segment indices).
- New level set constructor tools::createLevelSetDilatedMesh creates a grid
containing a narrow-band level set representation of a dilated surface
mesh (dilated by a radius in all directions).
- New class tools::ConvexVoxelizer, used by the above methods, which can be
inherited to implement a convex level set constructor.
- Introduced anisotropic surfacing tools in points/PointRasterizeSDF.h and
principal component analysis (PCA) methods in points/PrincipalComponentAnalysis.h.
The latter tool analyses point neighborhoods and computes affine
transformations representing elliptical distributions. The prior tool
takes rotational and stretch point attributes (optionally computed from
the prior PCA methods) and generates anisotropic surfaces.
- Improvements:
- Significantly improved the performance of all LeafNode ValueIterators,
up to 5x on some platforms and up to 10x when delay loading is enabled.
Construction of a ValueIterator from a leaf node now requests the leaf
buffers ahead of iteration to avoid potentially expensive API calls.
- Improved the performance of PointRasterizeSDF.h tools with larger radii
with better bound computation approximations.
- Significant performance improvement to delay loaded files - the warning
logic which checks the underlying mapped file for the last modified time
has been removed, resulting in performance gains upwards of 10x when
loading in node data buffers. Note that the check that was removed is
entirely redundant on Windows and would only print a warning on other
system.
[Contributed by jjtParadox]
- Added OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION and OPENVDB_HAS_MEMBER_FUNCTION
macros to help determine the presence and compatibility of interface
member functions at compile time.
- Added OPENVDB_ASSUME macros to mimic builtin assume and C++23 assume
attributes.
- Improved read and write of PLY files with vdb_tool so they support Vec3d
and 64 bit attributes. Changed vdb_tool version number from 10.6.1 to
10.7.0.
- API Changes:
- Mat3 and Mat4 functions have been marked [[nodiscard]] where it may be
confusing if they are operating in place or returning a result, in
particular tranpose, invert, adjoint, and timesDiagonal.
- Re-worked the API in PointRasterizeSDF.h with the addition of anisotropic
surfacing kernels. The new API exposes more concise free functions which
take structs of parameters. The old API remains supported but is
deprecated.
- Deprecated providing a filter or interrupter as arguments to
points::rasterize. These can instead be implemented on user transfer
schemes.
- Transfer schemes provided to points::rasterize can now optionally
implement a rasterizePoints callback that takes a range of points per
voxel.
- Fixes:
- Fixed a bug in points::rasterizeSpheres and points::rasterizeSmoothSpheres
which could cause sections of the generated surface to incorrectly be
marked as negative interior values.
- Fixed a bug in points::rasterizeSmoothSpheres which could result in
incomplete surface reconstruction with significantly larger search
distances.
- Fixed some precision issues in various Matrix methods.
- Fixed bugs in vdb_tool that prevented build with newer namespaces in
nanovdb.
@par
OpenVDB AX:
- Improvements:
- Added support for LLVM versions greater than 15. Upgraded CI to test with
LLVM versions 16, 17, 18, 19 and 20.
- As of this release, LLVM 15 is the minimum required version for OpenVDB
AX. Note that there is an issue with LLVM 17 symbols which makes it
incompatible with the OpenVDB Python plugin. AS such, LLVM version 18 and
greater are the recommended LLVM versions to use, with LLVM 18 being the
new future minimum version.
- Significant performance improvement to the compilation of AX kernels when
using LLVM 18 and greater.
- Significant backend refactoring to AX IR generation to support newer
versions of LLVM. In particular, parts of the codegen::Function and
codegen::FunctionBuilder API require new usage from LLVM 16 due to
the LLVM opaque pointer changes. If you're not using the OpenVDB AX
Function codegen API then no client changes should be necessary.
- Migrated OpenVDB AX unit tests from cppunit to gtest
[Contributed by Tim Straubinger]
- Fixes:
- Fixed a case of undefined behaviour when explicitly casting variables to
the same type as their storage type e.g:
double a; double b = double(a);
- Fixed an AX compiler error which would produce invalid IR when using 64bit
integer variables for matrix array offsetting e.g:
int64 a = 0; mat4f b = 1; float c = b[a,a];
@par
NanoVDB:
- Added nanovdb::openToIndexVDB, which can convert an OpenVDB grid into a
NanoVDB IndexGrid.
- Added new options "--index" and "--onIndex" to the command-line tool
nanovdb_convert so it can produce IndexGrids.
- Fixed memory leak in DeviceBuffer.
- Added constructor for DeviceBuffer from an existing HostBuffer.
- Added VoxelBlockManager, an acceleration structure for sequential access
and stencil ops over active voxels.
- Added helper functions for kernel launches with shared memory.
- Added support for CUDA 13.0.
- Fix warnings and compilation errors for GCC and Clang.
- Fixed inconsistent usage of util::cuda::mallocAsync/freeAsync that
affected vGPUs.
- Added support for custom memory resources in PointsToGrid.
- Fixed race condition in split/mergeGridHandles.
- Fixed offset bug in nanovdb::tools::cuda::IndexToGrid related to non-POD
build types.
[Contributed by Andreas Henne]
@par
Houdini:
- Define OP_InputIdx and OP_OutputIdx for Houdini 21.0 compatibility
- Add Houdini 21 style camera interface to support LOP cameras
- Include env flag for avoiding stream writing (was backported to 19.5)
<B>Version 12.0.2</B> - <I>In development</I>
@htmlonly <a name="v12_0_1_changes"></a>@endhtmlonly
@@ -351,7 +38,7 @@ NanoVDB:
- Fixed a call to a non-existent method in GridBuild.h
@htmlonly <a name="v12_0_0_changes"></a>@endhtmlonly
@htmlonly <a name="v1_changes"></a>@endhtmlonly
@par
<B>Version 12.0.0</B> - <I>October 31, 2024</I>
@@ -740,10 +427,10 @@ OpenVDB:
- Fixed a bug with LeafManager which wouldn't correctly
initialize its LeafNode array for single level Tree configurations
i.e. RootNode<LeafNode> (bug introduced in 7.2.0).
[Reported by \@lanwatch]
[Reported by @lanwatch]
- Fixed a bug with LeafNodeBool Topology constructor with designated
on/off values which wouldn't apply them correctly.
[Reported by \@hozhaoea]
[Reported by @hozhaoea]
@par
OpenVDB AX:
@@ -2802,13 +2489,13 @@ Improvements:
util::PagedArray@endlink.
- Added an @c install_lib build target to the Makefile.
<I>[Contributed&nbsp;by&nbsp;Double&nbsp;Negative]</I>
- Added @ref points "documentation" and Cookbook
- Added @subpage points "documentation" and Cookbook
@ref openvdbPointsHelloWorld "examples" for OpenVDB&nbsp;Points.
<I>[Contributed&nbsp;by&nbsp;Double&nbsp;Negative]</I>
- Registration of OpenVDB&nbsp;Points grid and attribute types is now
handled in @vdblink::initialize() openvdb::initialize@endlink,
and @c openvdb::points::initialize()
and @c openvdb::points::uninitialize()
and @vdblink::points::initialize() points::initialize@endlink
and @vdblink::points::uninitialize() points::uninitialize@endlink
are therefore deprecated.
- Extended multi-pass I/O to handle a variable number of passes per leaf node.
<I>[Contributed&nbsp;by&nbsp;Double&nbsp;Negative]</I>
@@ -3526,10 +3213,11 @@ Houdini:
- @vdblink::tools::volumeToMesh() tools::volumeToMesh@endlink now compiles
for all grid types but throws an exception if the input grid does not
have a scalar value type.
- Added an <TT>openvdb::io::File::readGrid(const Name&, const BBoxd&)</TT>
overload and <TT>openvdb::GridBase::readBuffers(std::istream&, const CoordBBox&)</TT>
overloads to the grid, tree and node classes that allow one to specify a
bounding box against which to clip a grid while reading it.
- Added a
@vdblink::io::File::readGrid(const Name&, const BBoxd&) File::readGrid@endlink
overload and @vdblink::GridBase::readBuffers(std::istream&, const CoordBBox&)
readBuffers@endlink overloads to the grid, tree and node classes that allow
one to specify a bounding box against which to clip a grid while reading it.
For large grids, clipping while reading can result in significantly lower
memory usage than clipping after reading.
- Added @vdblink::GridBase::clipGrid() GridBase::clipGrid@endlink, which
@@ -3588,11 +3276,10 @@ Houdini:
- Added constructors and methods to both
@vdblink::math::RandInt RandInt@endlink and
@vdblink::math::Rand01 Rand01@endlink to set and reset the random seed value.
- Added convenience methods
<TT>openvdb::math::Transform::indexToWorld(const BBoxd&)</TT>,
<TT>openvdb::math::Transform::worldToIndex(const BBoxd&)</TT> and
<TT>openvdb::math::Transform::worldToIndexCellCentered(const BBoxd&)</TT>
for transforming bounding boxes
- Added convenience methods for
@vdblink::math::Transform::indexToWorld(const BBoxd&) const transforming@endlink
@vdblink::math::Transform::worldToIndex(const BBoxd&) const bounding@endlink
@vdblink::math::Transform::worldToIndexCellCentered(const BBoxd&) const boxes@endlink
to @vdblink::math::Transform math::Transform@endlink.
- @c vdb_view is now compatible with both GLFW&nbsp;2 and GLFW&nbsp;3.
- Made many small changes to address type conversion and other warnings
@@ -3612,9 +3299,9 @@ Houdini:
@par
API changes:
- The addition of an
<TT>openvdb::GridBase::readBuffers(std::istream&, const CoordBBox&)</TT>
virtual function overload and the
- The addition of a
@vdblink::GridBase::readBuffers(std::istream&, const CoordBBox&)
GridBase::readBuffers@endlink virtual function overload and the
@vdblink::GridBase::clip() GridBase::clip@endlink
@vdblink::GridBase::readNonresidentBuffers()
GridBase::readNonresidentBuffers@endlink and
@@ -3719,15 +3406,16 @@ Houdini:
extractSparseTreeWithMask@endlink, which copies data from the index-space
intersection of a sparse tree and a dense input grid.
- Added copy constructors to the
<TT>openvdb::Grid::Grid(const Grid&lt;OtherTreeType&gt;&)</TT>,
<TT>openvdb::tree::Tree::Tree(const Tree&lt;OtherRootType&gt;&)</TT>,
<TT>openvdb::tree::RootNode::RootNode(const RootNode&lt;OtherChildType&gt;&)</TT>,
<TT>openvdb::tree::InternalNode::InternalNode(const InternalNode&lt;OtherChildNodeType, Log2Dim&gt;&)</TT>
and
<TT>openvdb::tree::LeafNode::LeafNode(const LeafNode&lt;OtherValueType, Log2Dim&gt;&)</TT>
@vdblink::Grid::Grid(const Grid<OtherTreeType>&) Grid@endlink,
@vdblink::tree::Tree::Tree(const Tree<OtherRootType>&) Tree@endlink,
@vdblink::tree::RootNode::RootNode(const RootNode<OtherChildType>&)
RootNode@endlink,
@vdblink::tree::InternalNode::InternalNode(const InternalNode<OtherChildNodeType, Log2Dim>&)
InternalNode@endlink and
@vdblink::tree::LeafNode::LeafNode(const LeafNode<OtherValueType, Log2Dim>&) LeafNode@endlink
classes, and an assignment operator overload to
<TT>openvdb::tree::RootNode::operator=(const RootNode&lt;OtherChildType&gt;&)</TT>,
that allow the source and destination to have different
@vdblink::tree::RootNode::operator=(const RootNode<OtherChildType>&)
RootNode@endlink, that allow the source and destination to have different
value types.
- Modified @vdblink::tree::Tree::combine2() Tree::combine2@endlink to permit
combination of trees with different value types.
@@ -3779,7 +3467,7 @@ API changes:
LeafManager::LeafRange::Iterator@endlink,
@vdblink::util::BaseMaskIterator::operator=() BaseMaskIterator@endlink,
@vdblink::util::NodeMask::operator=() NodeMask@endlink and
@c openvdb::util::RootNodeMask::operator=()
@vdblink::util::RootNodeMask::operator=() RootNodeMask@endlink
now return references to the respective objects.
- Removed a number of methods that were deprecated in version&nbsp;2.0.0
or earlier.
@@ -4245,7 +3933,7 @@ API changes:
- @vdblink::tree::LeafManager tree::LeafManager@endlink can now be
instantiated with a @const tree, although buffer swapping with @const trees
is disabled.
- Added an @c openvdb::Grid::signedFloodFill()
- Added a @vdblink::Grid::signedFloodFill() Grid::signedFloodFill@endlink
overload that allows one to specify inside and outside values.
- Fixed a bug in Grid::setBackground() so that now only the values of
inactive voxels change.
@@ -4255,9 +3943,9 @@ API changes:
that relied on input and output grids having compatible tree topology.
- @vdblink::math::Transform math::Transform@endlink now includes an
@vdblink::math::Transform::isIdentity() isIdentity@endlink predicate
and methods <TT>openvdb::math::Transform::preMult(const Mat4d&)</TT> and
<TT>openvdb::math::Transform::postMult(const Mat4d&)</TT>
to pre- and postmultiply by a matrix.
and methods to @vdblink::math::Transform::preMult(const Mat4d&) pre-@endlink
and @vdblink::math::Transform::postMult(const Mat4d&) postmultiply@endlink
by a matrix.
- Modified the @link NodeMasks.h node mask@endlink classes to permit
octree-like tree configurations (i.e., with a branching factor of two)
and to use 64-bit operations instead of 32-bit operations.
@@ -4330,7 +4018,7 @@ API changes:
faster for high-resolution meshes where the polygon/voxel size ratio
is small.
- Added @vdblink::createLevelSet() createLevelSet@endlink and
@vdblink::tools::createLevelSetSphere() createLevelSetSphere@endlink
@vdblink::createLevelSetSphere() createLevelSetSphere@endlink
factory functions for level set grids.
- @vdblink::tree::ValueAccessor tree::ValueAccessor@endlink is now faster
for trees of height 2, 3 and 4 (the latter is the default), and it now
@@ -4443,7 +4131,7 @@ API changes:
- Added @vdblink::tools::compReplace() tools::compReplace@endlink,
which copies the active values of one grid into another, and added
a "Replace A With Active B" mode to the Combine SOP.
- @c openvdb::Grid::signedFloodFill()
- @vdblink::Grid::signedFloodFill() Grid::signedFloodFill@endlink
no longer enters an infinite loop when filling an empty grid.
- Fixed a bug in the particle to level set converter that sometimes
produced level sets with holes, and fixed a bug in the SOP that
@@ -4706,8 +4394,8 @@ API changes:
math library and a method to return the
@vdblink::math::Mat3::trace trace@endlink of a @c Mat3.
- Fixed a bug in the
<TT>openvdb::tree::ValueAccessor::ValueAccessor(const ValueAccessor&)</TT>
copy constructor that caused the copy to reference
@vdblink::tree::ValueAccessor::ValueAccessor(const ValueAccessor&)
ValueAccessor@endlink copy constructor that caused the copy to reference
the original.
- Fixed a bug in @vdblink::tree::RootNode::setActiveState()
RootNode::setActiveState@endlink that caused a crash
@@ -4715,7 +4403,7 @@ API changes:
- Added a @c Tree::pruneLevelSet method that is similar to but faster than
Tree::pruneInactive() for level set grids.
- Added fast leaf node voxel access
<TT>openvdb::tree::LeafNode::getValue(Index)</TT> methods
@vdblink::tree::LeafNode::getValue(Index) const methods@endlink
that index by linear offset (as returned by
@vdblink::tree::LeafNode::ValueOnIter::pos() ValueIter::pos@endlink)
instead of by @ijk coordinates.
@@ -4768,7 +4456,7 @@ API changes:
just the active states of voxels from one grid with those of
another grid of a possibly different type.
- Fixed an incorrect scale factor in the Laplacian diffusion
@c openvdb::tools::Filter::laplacian() filter.
@vdblink::tools::Filter::laplacian() filter@endlink.
- Fixed a bug in @vdblink::tree::Tree::merge() Tree::merge@endlink
that could leave a tree with invalid value accessors.
- Added @vdblink::tree::TreeValueIteratorBase::setActiveState()
@@ -4803,7 +4491,7 @@ API changes:
@par
<B>Version 0.92.0</B> - <I>August 23 2012</I>
- Added a Laplacian diffusion
@c openvdb::tools::Filter::laplacian() filter.
@vdblink::tools::Filter::laplacian() filter@endlink.
- Fixed a bug in the initialization of the sparse contour tracer
that caused mesh-to-volume conversion to fail in certain cases.
- Fixed a bug in the curvature stencil that caused mean curvature
@@ -4831,8 +4519,9 @@ API changes:
method that replaces a grid&rsquo;s tree with a new, empty tree of the
correct type.
- Fixed a crash in
<TT>openvdb::tree::Tree::setValueOff(const Coord& xyz, const ValueType& value)</TT>
when the new value was equal to the background value.
@vdblink::tree::Tree::setValueOff(const Coord& xyz, const ValueType& value)
Tree::setValueOff@endlink when the new value was equal to the
background value.
- Fixed bugs in Tree::prune() that could result in output tiles with
incorrect active states.
- Added @c librt to the link dependencies to address build failures
+51 -58
View File
@@ -36,69 +36,61 @@ Reference Platform, but for those that do, their specified versions are
Component | Requirements | Optional
----------------------- | ----------------------------------------------- | --------
OpenVDB Core Library | CMake, C++17 compiler, TBB::tbb | Blosc, ZLib, Log4cplus, Imath::Imath (included), Boost::iostream, VCL (included)
OpenVDB Core Library | CMake, C++17 compiler, TBB::tbb | Blosc, ZLib, Log4cplus, Imath::Imath, Boost::iostream
OpenVDB Print | Core Library dependencies | -
OpenVDB LOD | Core Library dependencies | -
OpenVDB Render | Core Library dependencies | OpenEXR, Imath::Imath, libpng
OpenVDB View | Core Library dependencies, OpenGL, GLFW3, GLEW* | -
OpenVDB Python | Core Library dependencies, Python, nanobind | -
OpenVDB Python | Core Library dependencies, Python, nanobind | NumPy
OpenVDB AX | Core Library dependencies, LLVM | Bison, Flex
NanoVDB | - | Core Library, CUDA, TBB, Blosc, ZLib
OpenVDB UnitTests | Core Library dependencies, GoogleTest, numpy* | -
OpenVDB Documentation | Doxygen, Doxygen Awesome (included) | -
OpenVDB UnitTests | Core Library dependencies, GoogleTest | CppUnit**
OpenVDB Documentation | Doxygen | -
- @b * GLEW is only required for building the vdb_view binary on Windows.
- @b * numpy only required for python binding unit tests
- @b ** CppUnit is only required for building the AX unit tests.
- @b Note - Bison and Flex are only required for re-generation of the AX
grammar which is not typically necessary for the majority of users.
Note that OpenVDB comes bundled with the following dependencies. Please see
their respective license documentation in `ext/THIRD-PARTY.md` for license
information.
- Doxygen Awesome
- Imath::Imath
- VCL
@subsection depDependencyTable Dependency Table
Package | Minimum | Recommended | Description | apt-get | Homebrew | Source
--------------- | ------- | ----------- | ----------------------------------------------------------------- | ------- | -------- | ------
CMake | 3.24 | Latest | Cross-platform family of tools designed to help build software | Y | Y | https://cmake.org
GCC | 11.2.1 | 11.2.1 | C++ 17 Compiler: The GNU Compiler Collection | Y | Y | https://www.gnu.org/software/gcc
Clang | 5.0 | Latest | C++ 17 Compiler: A C language family frontend for LLVM | Y | Y | https://clang.llvm.org
Intel ICC | 19 | Latest | C++ 17 Compiler: Intels C++ Compiler | Y | Y | https://software.intel.com/en-us/c-compilers
MSVC | 19.30 | 19.30 | C++ 17 Compiler: Microsoft Visual C++ Compiler | Y | Y | https://visualstudio.microsoft.com/vs
Imath | 3.2 | >= 3.3 | Half precision floating points | Y | Y | http://www.openexr.com
OpenEXR | 3.2 | >= 3.3 | EXR serialization support | Y | Y | http://www.openexr.com
TBB | 2020.3 | >= 2021 | Threading Building Blocks - template library for task parallelism | Y | Y | https://www.threadingbuildingblocks.org
ZLIB | 1.2.7 | Latest | Compression library for disk serialization compression | Y | Y | https://www.zlib.net
Boost | 1.82 | >= 1.85 | Components: iostreams | Y | Y | https://www.boost.org
VCL | 2.02.0 | >= 2.02.0 | x86 intrinsics and SIMD class wrappers and | Y | Y | https://github.com/vectorclass/version2
LLVM | 15.0.0* | 18.0.0 | Target-independent code generation | Y | Y | https://llvm.org/
Bison | 3.7.0 | 3.7.0 | General-purpose parser generator | Y | Y | https://www.gnu.org/software/gcc
Flex | 2.6.4 | 2.6.4 | Fast lexical analyzer generator | Y | Y | https://github.com/westes/flex
Python | 3.10 | 3.11 | The python interpreter and libraries | Y | Y | https://www.python.org
nanobind** | 2.0.0 | >= 2.5.0 | C++/python bindings | Y | Y | https://nanobind.readthedocs.io
GoogleTest | 1.10 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest
Blosc | 1.17.0* | Latest | Recommended dependency for improved disk compression | Y | Y | https://github.com/Blosc/c-blosc/releases
Log4cplus | 1.1.2 | Latest | An optional dependency for improved OpenVDB Logging | Y | Y | https://github.com/log4cplus/log4cplus
libpng | - | Latest | Library for manipulating PNG images | Y | Y | http://www.libpng.org/pub/png/libpng.html
GLFW | 3.3 | Latest | Simple API for OpenGL development | Y | Y | https://www.glfw.org
OpenGL | 3.2 | Latest | Environment for developing portable graphics applications | Y | Y | https://www.opengl.org
GLEW | 1.0.0 | Latest | A cross-platform OpenGL extension loading library. | Y | Y | http://glew.sourceforge.net
CUDA | - | Latest | Parallel computing platform for graphical processing units. | Y | N | https://developer.nvidia.com/cuda-downloads
Doxygen | 1.8.8 | <= 1.14.0 | Documentation generation from C++ | Y | Y | http://www.doxygen.nl
Doxygen Awesome | 2.0.0 | >= 2.0.0 | Documentation generation from C++ | Y | Y | https://github.com/jothepro/doxygen-awesome-css
Package | Minimum | Recommended | Description | apt-get | Homebrew | Source
-------------- | ------- | ----------- | ----------------------------------------------------------------- | ------- | -------- | ------
CMake | 3.20 | Latest | Cross-platform family of tools designed to help build software | Y | Y | https://cmake.org
GCC | 11.2.1 | 11.2.1 | C++ 17 Compiler: The GNU Compiler Collection | Y | Y | https://www.gnu.org/software/gcc
Clang | 5.0 | Latest | C++ 17 Compiler: A C language family frontend for LLVM | Y | Y | https://clang.llvm.org
Intel ICC | 19 | Latest | C++ 17 Compiler: Intels C++ Compiler | Y | Y | https://software.intel.com/en-us/c-compilers
MSVC | 19.30 | 19.30 | C++ 17 Compiler: Microsoft Visual C++ Compiler | Y | Y | https://visualstudio.microsoft.com/vs
Imath | 3.1 | Latest | Half precision floating points | Y | Y | http://www.openexr.com
OpenEXR | 3.1 | Latest | EXR serialization support | Y | Y | http://www.openexr.com
TBB | 2020.3 | 2020.3 | Threading Building Blocks - template library for task parallelism | Y | Y | https://www.threadingbuildingblocks.org
ZLIB | 1.2.7 | Latest | Compression library for disk serialization compression | Y | Y | https://www.zlib.net
Boost | 1.80 | 1.82 | Components: iostreams | Y | Y | https://www.boost.org
LLVM | 13.0.0 | 15.0.0* | Target-independent code generation | Y | Y | https://llvm.org/
Bison | 3.7.0 | 3.7.0 | General-purpose parser generator | Y | Y | https://www.gnu.org/software/gcc
Flex | 2.6.4 | 2.6.4 | Fast lexical analyzer generator | Y | Y | https://github.com/westes/flex
Python | 3.10 | 3.11 | The python interpreter and libraries | Y | Y | https://www.python.org
nanobind | 2.0.0 | 2.1.0 | C++/python bindings | Y | Y | https://nanobind.readthedocs.io
NumPy | 1.23.0 | 1.26.0 | Scientific computing with Python | Y | Y | http://www.numpy.org
GoogleTest | 1.10 | Latest | A unit testing framework module for C++ | Y | Y | https://github.com/google/googletest
CppUnit | 1.10 | Latest | A unit testing framework module for C++ | N | Y | https://freedesktop.org/wiki/Software/cppunit
Blosc | 1.17.0* | 1.17.0 | Recommended dependency for improved disk compression | Y | Y | https://github.com/Blosc/c-blosc/releases
Log4cplus | 1.1.2 | Latest | An optional dependency for improved OpenVDB Logging | Y | Y | https://github.com/log4cplus/log4cplus
libpng | - | Latest | Library for manipulating PNG images | Y | Y | http://www.libpng.org/pub/png/libpng.html
GLFW | 3.1 | > 3.3 | Simple API for OpenGL development | Y | Y | https://www.glfw.org
OpenGL | 3.2 | Latest | Environment for developing portable graphics applications | Y | Y | https://www.opengl.org
GLEW | 1.0.0 | Latest | A cross-platform OpenGL extension loading library. | Y | Y | http://glew.sourceforge.net
CUDA | - | Latest | Parallel computing platform for graphical processing units. | Y | N | https://developer.nvidia.com/cuda-downloads
Doxygen | 1.8.8 | 1.8.11 | Documentation generation from C++ | Y | Y | http://www.doxygen.nl
- @b * See the note in [known issues](@ref depKnownIssues) regarding supported blosc/llvm versions.
- @b ** See the note in [known issues](@ref depKnownIssues) regarding supported nanobind build issues.
- @b * See the note in [known issues](@ref depKnownIssues) regarding supported blosc/llvm versions.
@subsection depKnownIssues Known Issues
- @b On Linux, LLVM == 17 has symbol issues which makes it incompatible when
used with the OpenVDB Python plugin. LLVM versions greater than 18 should be
preferred.
- @b LLVM >= 15. LLVM has recently changed their IR pointer data types to be
completely opaque. Some support is provided in LLVM 15 but tests with AX show
that this is extremely unstable. AX currently only supports LLVM versions up
until 14.X.X. See https://llvm.org/docs/OpaquePointers.html for more details.
- @b GLFW: Crash with GLFW 3.2.1 when used with EGL on Linux. OpenVDB View may
segfault on closure. Fixed in GLFW 3.3
@@ -110,18 +102,15 @@ Doxygen Awesome | 2.0.0 | >= 2.0.0 | Documentation generation from C++
Additionally these versions of blosc may generally not be compatible with OpenVDB
itself. Avoid using these versions and upgrade to the new minimum of 1.17.0 where
possible.
- All versions from 1.11.0 through to, but excluding, 1.14.0.
- Versions 1.16.0 and 1.16.1.
.
For more information see:
- https://www.blosc.org/posts/new-forward-compat-policy/
- https://github.com/Blosc/c-blosc/issues/260
- https://github.com/Blosc/c-blosc/issues/261
- @b nanobind: Nanobind requires a fast-hash-map implementation library called
tsl-robin-map. If you're installing nanobind through homebrew, this library
may not be installed correctly and OpenVDB's CMake will only produce a warning.
Make sure to also: `brew install robin-map`.
- All versions from 1.11.0 through to, but excluding, 1.14.0.
- Versions 1.16.0 and 1.16.1.
For more information see:
- https://www.blosc.org/posts/new-forward-compat-policy/
- https://github.com/Blosc/c-blosc/issues/260
- https://github.com/Blosc/c-blosc/issues/261
@section depInstallingDependencies Installing Dependencies
@@ -159,12 +148,14 @@ apt-get install libblosc-dev # Blosc
apt-get install llvm-15-dev # LLVM
# Python
apt-get install python-dev # Python
apt-get install python-numpy # NumPy
pip install nanobind # nanobind
# Optional
apt-get install libpng-dev # libpng
apt-get install libopenexr-dev # OpenEXR
apt-get install liblog4cplus-dev # Log4cplus
apt-get install googletest # GoogleTest
apt-get install libcppunit-dev # CppUnit
# vdb_view
apt-get install libglfw3-dev # GLFW
# Documentation
@@ -190,9 +181,11 @@ brew install c-blosc # blosc
brew install llvm # LLVM
# Python
brew install python # Python
brew install nanobind robin-map # nanobind
brew install numpy # NumPy
brew install nanobind # nanobind
# Unit Tests
brew install gtest # GoogleTest
brew install cppunit # CppUnit
# vdb_view
brew install glfw # GLFW
# vdb_render
+29 -18
View File
@@ -22,30 +22,44 @@ primarily by
- Mihai Ald&eacute;n
- David Hill
@par Quick Links
- @subpage changes "Release Notes"
- @subpage dependencies "Dependencies"
- @subpage build "Building OpenVDB"
- @subpage overview "Overview"
- @ref transformsAndMaps "Transforms and Maps"
- @ref codeExamples "Cookbook"
- @ref faq "FAQ"
- @subpage python "OpenVDB Python"
- @subpage points "OpenVDB Points"
See the @subpage changes "Release Notes" for what&rsquo;s new in this version
of @b OpenVDB.
See the @subpage dependencies "Dependencies" page for @b OpenVDB requirements.
See @subpage build "Building OpenVDB" for information on building @b OpenVDB.
See the @subpage overview "Overview" for an introduction to the library.
See @subpage transformsAndMaps "Transforms and Maps" for more
discussion of the transforms used in @b OpenVDB.
See the @subpage faq "FAQ" for frequently asked questions about @b OpenVDB.
See the @subpage codeExamples "Cookbook" to get started using @b OpenVDB.
See @subpage points "OpenVDB Points" to store point data using @b OpenVDB.
See @subpage python "Using OpenVDB in Python" to get started with the
@b OpenVDB Python module.
@if OPENVDB_AX
- @subpage openvdbax "OpenVDB AX"
See @subpage openvdbax "OpenVDB AX" for the AX documentation.
@endif
@if OPENVDB_HOUDINI
- @subpage houdini "Houdini Cookbook"
See the @subpage houdini "Houdini Cookbook" for help on implementing Houdini nodes.
@endif
@if NANOVDB
- @subpage NanoVDB_MainPage "NanoVDB"
See @subpage NanoVDB_MainPage "NanoVDB" for the NanoVDB documentation.
@endif
- <a href="../code_coverage/index.html">Code Coverage</a>
Contributors, please familiarize yourselves with our
@subpage codingStyle "coding standards".
<a href="../code_coverage/index.html">Code Coverage</a>
@page overview OpenVDB Overview
@@ -67,9 +81,6 @@ Contributors, please familiarize yourselves with our
- @ref subsecNodeIter
- @ref subsecValueAccessor
- @ref subsecTraversal
- @subpage transformsAndMaps "Transforms and Maps"
<!-- - @ref secRegistry -->
@@ -309,7 +320,7 @@ as level sets.
(The lower-level @vdblink::tools::GridResampler GridResampler@endlink does not,
but it is optimized for level set grids in that it transforms only voxels
in the narrow band and relies on
@vdblink::tools::signedFloodFill() signed flood fill@endlink to reconstruct
@vdblink::Grid::signedFloodFill() signed flood fill@endlink to reconstruct
the inside and outside regions.)
Other tools whose behavior is affected by the grid class include the
@vdblink::tools::divergence() divergence@endlink operator (which has an
+1 -1
View File
@@ -196,7 +196,7 @@ For multithreaded insertion operations we typically assign a separate grid
to each thread and then merge the grids as threads terminate.
This technique works remarkably well: because OpenVDB
is sparse and hierarchical, merging is very efficient.
For more details, please consult the @ref codeExamples and
For more details, please consult the @subpage codeExamples and
Appendix&nbsp;B in the <i>Transactions on Graphics</i> paper.
@section sMaxRes Is OpenVDB unbounded?
-88
View File
@@ -1,88 +0,0 @@
<!-- HTML header for doxygen 1.15.0-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen $doxygenversion"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!--BEGIN PROJECT_ICON-->
<link rel="icon" href="$relpath^$projecticon" type="image/x-icon" />
<!--END PROJECT_ICON-->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<!--BEGIN FULL_SIDEBAR-->
<script type="text/javascript">var page_layout=1;</script>
<!--END FULL_SIDEBAR-->
<script type="text/javascript" src="$relpath^jquery.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
<!--BEGIN COPY_CLIPBOARD-->
<script type="text/javascript" src="$relpath^clipboard.js"></script>
<!--END COPY_CLIPBOARD-->
$treeview
$search
$mathjax
$darkmode
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
$extrastylesheet
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
</script>
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript">
DoxygenAwesomeFragmentCopyButton.init()
</script>
<script type="text/javascript" src="$relpath^doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeParagraphLink.init()
</script>
</head>
<body>
<!--BEGIN FULL_SIDEBAR-->
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
<!--END FULL_SIDEBAR-->
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!--BEGIN TITLEAREA-->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<!--BEGIN PROJECT_LOGO-->
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"$logosize/></td>
<!--END PROJECT_LOGO-->
<!--BEGIN PROJECT_NAME-->
<td id="projectalign">
<div id="projectname">$projectname<!--BEGIN PROJECT_NUMBER--><span id="projectnumber">&#160;$projectnumber</span><!--END PROJECT_NUMBER-->
</div>
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
</td>
<!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME-->
<!--BEGIN PROJECT_BRIEF-->
<td>
<div id="projectbrief">$projectbrief</div>
</td>
<!--END PROJECT_BRIEF-->
<!--END !PROJECT_NAME-->
<!--BEGIN DISABLE_INDEX-->
<!--BEGIN SEARCHENGINE-->
<!--BEGIN !FULL_SIDEBAR-->
<td>$searchbox</td>
<!--END !FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
<!--END DISABLE_INDEX-->
</tr>
<!--BEGIN SEARCHENGINE-->
<!--BEGIN FULL_SIDEBAR-->
<tr><td colspan="2">$searchbox</td></tr>
<!--END FULL_SIDEBAR-->
<!--END SEARCHENGINE-->
</tbody>
</table>
</div>
<!--END TITLEAREA-->
<!-- end header part -->
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

+1 -1
View File
@@ -26,7 +26,7 @@
* **Does NanoVDB depend on and require CUDA?**
No, NanoVDB is by design agnostic and works with most graphics APIs, e.g. OpenGL, OpenCL, OptiX, CUDA, HLSL, GLSL, DirectX, and even the CPU! The data structure itself (defined in [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) and [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h)) only depends on C++11 or C99. However, some of the auxiliary math classes are optionally optimized with intrinsic CUDA calls (e.g. fma in Vec3) and the [DeviceBuffer](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/cuda/DeviceBuffer.h) allocator uses CUDA for explicit memory management. It should be straightforward to replace (or remove) these CUDA dependencies if you so desire.
No, NanoVDB is by design agnostic and works with most graphics APIs, e.g. OpenGL, OpenCL, OptiX, CUDA, HLSL, GLSL, DirectX, and even the CPU! The data structure itself (defined in [NanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/NanoVDB.h) and [PNanoVDB.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/PNanoVDB.h)) only depends on C++11 or C99. However, some of the auxiliary math classes are optionally optimized with intrinsic CUDA calls (e.g. fma in Vec3) and some of the [Allocator](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/util/CudaDeviceBuffer.h) uses CUDA for explicit memory management. It should be straightforward to replace (or remove) these CUDA dependencies if you so desire.
* **How does the data structure of NanoVDB compare to that of OpenVDB?**
+141 -25
View File
@@ -1,38 +1,154 @@
# NanoVDB Hello World Examples {#NanoVDB_HelloWorld}
The example snippets below are pulled directly from compiled example source
files via Doxygen's `\snippet` mechanism, so the code shown here is always
in sync with what is built and tested in CI. Enable
`-DNANOVDB_BUILD_EXAMPLES=ON` to build them locally.
[The first example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor/openvdb_to_nanovdb_accessor.cc) shows how to convert an OpenVDB level set sphere into a NanoVDB level set, use accessors to print out multiple values from both grids, and save the NanoVDB grid to file. Note that **this example depends on both OpenVDB and NanoVDB**.
## Convert an OpenVDB grid to NanoVDB and use accessors
```cpp
#include <openvdb/tools/LevelSetSphere.h> // replace with your own dependencies for generating the OpenVDB grid
#include <nanovdb/util/CreateNanoGrid.h> // converter from OpenVDB to NanoVDB (includes NanoVDB.h and GridManager.h)
#include <nanovdb/util/IO.h>
[The first example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor/openvdb_to_nanovdb_accessor.cc)
shows how to convert an OpenVDB level set sphere into a NanoVDB level set, use
accessors to print out multiple values from both grids, and save the NanoVDB
grid to file. Note that **this example depends on both OpenVDB and NanoVDB**.
// Convert an openvdb level set sphere into a nanovdb, use accessors to print out multiple values from both
// grids and save the NanoVDB grid to file.
// Note, main depends on BOTH OpenVDB and NanoVDB.
int main()
{
try {
// Create an OpenVDB grid (here a level set surface but replace this with your own code)
auto srcGrid = openvdb::tools::createLevelSetSphere<openvdb::FloatGrid>(100.0f, openvdb::Vec3f(0.0f), 1.0f);
\snippet nanovdb/nanovdb/examples/ex_openvdb_to_nanovdb_accessor/openvdb_to_nanovdb_accessor.cc openvdb_to_nanovdb_accessor
// Convert the OpenVDB grid, srcGrid, into a NanoVDB grid handle.
auto handle = nanovdb::createNanoGrid(*srcGrid);
## Read a NanoVDB grid from a file (host only)
// Define a (raw) pointer to the NanoVDB grid on the host. Note we match the value type of the srcGrid!
auto* dstGrid = handle.grid<float>();
[The second example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor/read_nanovdb_sphere_accessor.cc)
reads a NanoVDB grid from a file (the one saved in the previous example) and
prints out multiple values. Note that **this example does not depend on
OpenVDB (nor CUDA), only NanoVDB**.
if (!dstGrid)
throw std::runtime_error("GridHandle does not contain a grid with value type float");
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor/read_nanovdb_sphere_accessor.cc read_nanovdb_sphere_accessor
// Get accessors for the two grids. Note that accessors only accelerate repeated access!
auto dstAcc = dstGrid->getAccessor();
auto srcAcc = srcGrid->getAccessor();
## Read a NanoVDB grid and access it on the CPU and GPU
// Access and print out a cross-section of the narrow-band level set from the two grids
for (int i = 97; i < 104; ++i) {
printf("(%3i,0,0) OpenVDB cpu: % -4.2f, NanoVDB cpu: % -4.2f\n", i, srcAcc.getValue(openvdb::Coord(i, 0, 0)), dstAcc.getValue(nanovdb::Coord(i, 0, 0)));
}
[The third example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cu)
reads a NanoVDB grid from a file (the one saved in the first example) and
prints out multiple values on both the CPU and GPU. Note that **this example
does NOT depend on OpenVDB, only NanoVDB and CUDA**.
nanovdb::io::writeGrid("data/sphere.nvdb", handle); // Write the NanoVDB grid to file and throw if writing fails
}
catch (const std::exception& e) {
std::cerr << "An exception occurred: \"" << e.what() << "\"" << std::endl;
}
return 0;
}
```
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cu read_nanovdb_sphere_accessor_cuda
[The second example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor/read_nanovdb_sphere_accessor.cc) reads a NanoVDB grid from a file (the one saved in the previous example) and prints out multiple values. Note that **this example does not depend on OpenVDB (nor CUDA), only NanoVDB**.
NVCC requires the CUDA kernel to be defined in
[a separate .cu file](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda_kernel.cu):
```cpp
#include <nanovdb/util/IO.h> // this is required to read (and write) NanoVDB files on the host
\snippet nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda_kernel.cu read_nanovdb_sphere_accessor_cuda_kernel
/// @brief Read a NanoVDB grid from a file and print out multiple values.
///
/// @note Note This example does NOT depend on OpenVDB (nor CUDA), only NanoVDB.
int main()
{
try {
auto handle = nanovdb::io::readGrid("data/sphere.nvdb"); // reads first grid from file
auto* grid = handle.grid<float>(); // get a (raw) pointer to a NanoVDB grid of value type float
if (!grid)
throw std::runtime_error("File did not contain a grid with value type float");
auto acc = grid->getAccessor(); // create an accessor for fast access to multiple values
for (int i = 97; i < 104; ++i) {
printf("(%3i,0,0) NanoVDB cpu: % -4.2f\n", i, acc.getValue(nanovdb::Coord(i, 0, 0)));
}
}
catch (const std::exception& e) {
std::cerr << "An exception occurred: \"" << e.what() << "\"" << std::endl;
}
return 0;
}
```
[The third example](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cc) reads a NanoVDB grid from a file (the one saved in the first example) and prints out multiple values on both the CPU and GPU. Note that **this example does NOT depend on OpenVDB, only NanoVDB and CUDA**.
```cpp
#include <nanovdb/util/IO.h> // this is required to read (and write) NanoVDB files on the host
#include <nanovdb/util/cuda/CudaDeviceBuffer.h> // required for CUDA memory management
extern "C" void launch_kernels(const nanovdb::NanoGrid<float>*,
const nanovdb::NanoGrid<float>*,
cudaStream_t stream);
/// @brief Read a NanoVDB grid from a file and print out multiple values on both the cpu and gpu.
///
/// @note Note This example does NOT depend on OpenVDB, only NanoVDB and CUDA.
int main()
{
try {
// returns a GridHandle using CUDA for memory management.
auto handle = nanovdb::io::readGrid<nanovdb::CudaDeviceBuffer>("data/sphere.nvdb");
cudaStream_t stream; // Create a CUDA stream to allow for asynchronous copy of pinned CUDA memory.
cudaStreamCreate(&stream);
handle.deviceUpload(stream, false); // Copy the NanoVDB grid to the GPU asynchronously
auto* cpuGrid = handle.grid<float>(); // get a (raw) pointer to a NanoVDB grid of value type float on the CPU
auto* deviceGrid = handle.deviceGrid<float>(); // get a (raw) pointer to a NanoVDB grid of value type float on the GPU
if (!deviceGrid || !cpuGrid)
throw std::runtime_error("GridHandle did not contain a grid with value type float");
launch_kernels(deviceGrid, cpuGrid, stream); // Call a host method to print a grid values on both the CPU and GPU
cudaStreamDestroy(stream); // Destroy the CUDA stream
}
catch (const std::exception& e) {
std::cerr << "An exception occurred: \"" << e.what() << "\"" << std::endl;
}
return 0;
}
```
NVCC requires the CUDA kernel to be defined in [a separate .cu file](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/examples/ex_read_nanovdb_sphere_accessor_cuda/read_nanovdb_sphere_accessor_cuda.cu):
```cpp
#include <nanovdb/NanoVDB.h> // this defined the core tree data structure of NanoVDB accessible on both the host and device
#include <stdio.h> // for printf
// This is called by the host only
void cpu_kernel(const nanovdb::NanoGrid<float>* cpuGrid)
{
auto cpuAcc = cpuGrid->getAccessor();
for (int i = 97; i < 104; ++i) {
printf("(%3i,0,0) NanoVDB cpu: % -4.2f\n", i, cpuAcc.getValue(nanovdb::Coord(i, 0, 0)));
}
}
// This is called by the device only
__global__ void gpu_kernel(const nanovdb::NanoGrid<float>* deviceGrid)
{
if (threadIdx.x > 6)
return;
int i = 97 + threadIdx.x;
auto gpuAcc = deviceGrid->getAccessor();
printf("(%3i,0,0) NanoVDB gpu: % -4.2f\n", i, gpuAcc.getValue(nanovdb::Coord(i, 0, 0)));
}
// This is called by the client code on the host
extern "C" void launch_kernels(const nanovdb::NanoGrid<float>* deviceGrid,
const nanovdb::NanoGrid<float>* cpuGrid,
cudaStream_t stream)
{
// Launch the device kernel asynchronously
gpu_kernel<<<1, 64, 0, stream>>>(deviceGrid);
// Launch the host "kernel" (synchronously)
cpu_kernel(cpuGrid);
}
```
+3 -4
View File
@@ -12,8 +12,8 @@
* [math/HDDA.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/math/HDDA.h) HDDA related.
* [math/SampleFromVoxels.h](https://github.com/AcademySoftwareFoundation/openvdb/blob/master/nanovdb/nanovdb/math/SampleFromVoxels.h) interpolation.
```
$ tree
```bash
foo@bar:~$ tree
.
├── CMakeLists.txt
├── cmd
@@ -175,5 +175,4 @@ $ tree
├── SampleFromVoxels.h
├── Stencils.h
├── Timer.h
└── Util.h
```
└── Util.h
-26
View File
@@ -1,26 +0,0 @@
html {
/* override light-mode variables here */
}
html.dark-mode {
/* define dark-mode variable overrides here */
--openvdb-group-header-override: white;
}
/* Fix @name group sections in dark theme appearing strangely */
div.groupHeader
{
box-shadow: none;
color: var(--openvdb-group-header-override);
}
/* Apply invert to all images in tables, regardless of nesting, required to
properly handle latex formulas in dark theme (for some reason
doxygen-awesome only applies this to the first level of nested tables via:
html.dark-mode div.contents > table img)
*/
html.dark-mode div.contents table img
{
filter: brightness(89%) hue-rotate(180deg) invert();
}
+1
View File
@@ -21,6 +21,7 @@
- @ref secPtIndexFilters
- @ref secPtSpaceAndTrans
@section secPtOverview Introduction
@anchor openvdbPointsOverview
+6 -4
View File
@@ -1,6 +1,6 @@
/**
@page python OpenVDB Python
@page python Using OpenVDB in Python
This section describes the OpenVDB Python module and includes Python code
snippets and some complete programs that illustrate how to perform common tasks.
@@ -441,9 +441,11 @@ not on their active states or other attributes.
Large data sets are often handled in Python using
<a href="http://www.numpy.org/">NumPy</a>.
The @b copyFromArray and @b copyToArray grid methods can be used to exchange
data efficiently between scalar-valued grids and three-dimensional NumPy
arrays and between vector-valued grids and four-dimensional NumPy arrays.
The OpenVDB Python module can optionally be compiled with NumPy support.
With NumPy enabled, the @b copyFromArray and @b copyToArray grid methods
can be used to exchange data efficiently between scalar-valued grids
and three-dimensional NumPy arrays and between vector-valued grids and
four-dimensional NumPy arrays.
@code{.py}
>>> import pyopenvdb as vdb
>>> import numpy
-126
View File
@@ -1,126 +0,0 @@
See [LICENSE](LICENSE) for the main open source license of original
code written for the OpenVDB project.
The remainder of this file reproduces the open source licensing details
of other projects that have been imported, incorporated into, or derived
into parts of OpenVDB.
In no particular order:
-------------------------------------------------------------------------
BSD 3-Clause License
SPDX-License-Identifier: BSD-3-Clause
* Imath, Copyright (c) Contributors to the Imath Project.
https://github.com/AcademySoftwareFoundation/Imath
OpenVDB includes a copy of Half.h from the Imath project. This copy can
be disabled in favour of using Half.h from the Imath project - but one
must be provided either way.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------
MIT License
* doxygen-awesome Copyright (c) 2021 - 2023 jothepro
https://github.com/jothepro/doxygen-awesome-css
OpenVDB uses doxygen-awesome for stylized html output with doxygen and
comes bundled with copies of the css provided by doxygen-awesome. Usage
of this css can be disabled.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-------------------------------------------------------------------------
Apache 2.0
* VCL (c) Copyright 2012-2022 Agner Fog.
https://github.com/vectorclass/version2
OpenVDB includes a copy of vectorclass for x86 SIMD intrinsic usage. Usage
of VCL is disabled by default and requires the VCL headers to be shipped with
OpenVDB installations. This behaviour and usage of VCL can be controlled
during OpenVDB configuration. See the full LICENSE terms in:
vcl/openvdb/ext/vcl/LICENSE
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------
Public domain
* The simplex noise implementation included in OpenVDB AX is Copyright (c)
Arthur Tombs. It bears the following notice:
This is a derivative work based on OpenSimplex by Kurt Spencer:
https://gist.github.com/KdotJPG/b1270127455a94ac5d19
Anyone is free to make use of this software in whatever way they want.
Attribution is appreciated, but not required.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------
If we have left anything out, it is unintentional. Please let us know.
@@ -1,138 +0,0 @@
// SPDX-License-Identifier: MIT
/**
Doxygen Awesome
https://github.com/jothepro/doxygen-awesome-css
Copyright (c) 2021 - 2025 jothepro
*/
class DoxygenAwesomeDarkModeToggle extends HTMLElement {
// SVG icons from https://fonts.google.com/icons
// Licensed under the Apache 2.0 license:
// https://www.apache.org/licenses/LICENSE-2.0.html
static lightModeIcon = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FCBF00"><rect fill="none" height="24" width="24"/><circle cx="12" cy="12" opacity=".3" r="3"/><path d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"/></svg>`
static darkModeIcon = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#FE9700"><rect fill="none" height="24" width="24"/><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27 C17.45,17.19,14.93,19,12,19c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z" opacity=".3"/><path d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"/></svg>`
static title = "Toggle Light/Dark Mode"
static prefersLightModeInDarkModeKey = "prefers-light-mode-in-dark-mode"
static prefersDarkModeInLightModeKey = "prefers-dark-mode-in-light-mode"
static _staticConstructor = function() {
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.userPreference)
// Update the color scheme when the browsers preference changes
// without user interaction on the website.
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged()
})
// Update the color scheme when the tab is made visible again.
// It is possible that the appearance was changed in another tab
// while this tab was in the background.
document.addEventListener("visibilitychange", visibilityState => {
if (document.visibilityState === 'visible') {
DoxygenAwesomeDarkModeToggle.onSystemPreferenceChanged()
}
});
}()
static init() {
$(function() {
$(document).ready(function() {
const toggleButton = document.createElement('doxygen-awesome-dark-mode-toggle')
toggleButton.title = DoxygenAwesomeDarkModeToggle.title
toggleButton.updateIcon()
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
toggleButton.updateIcon()
})
document.addEventListener("visibilitychange", visibilityState => {
if (document.visibilityState === 'visible') {
toggleButton.updateIcon()
}
});
$(document).ready(function(){
document.getElementById("MSearchBox").parentNode.appendChild(toggleButton)
})
$(window).resize(function(){
document.getElementById("MSearchBox").parentNode.appendChild(toggleButton)
})
})
})
}
constructor() {
super();
this.onclick=this.toggleDarkMode
}
/**
* @returns `true` for dark-mode, `false` for light-mode system preference
*/
static get systemPreference() {
return window.matchMedia('(prefers-color-scheme: dark)').matches
}
/**
* @returns `true` for dark-mode, `false` for light-mode user preference
*/
static get userPreference() {
return (!DoxygenAwesomeDarkModeToggle.systemPreference && localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey)) ||
(DoxygenAwesomeDarkModeToggle.systemPreference && !localStorage.getItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey))
}
static set userPreference(userPreference) {
DoxygenAwesomeDarkModeToggle.darkModeEnabled = userPreference
if(!userPreference) {
if(DoxygenAwesomeDarkModeToggle.systemPreference) {
localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey, true)
} else {
localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey)
}
} else {
if(!DoxygenAwesomeDarkModeToggle.systemPreference) {
localStorage.setItem(DoxygenAwesomeDarkModeToggle.prefersDarkModeInLightModeKey, true)
} else {
localStorage.removeItem(DoxygenAwesomeDarkModeToggle.prefersLightModeInDarkModeKey)
}
}
DoxygenAwesomeDarkModeToggle.onUserPreferenceChanged()
}
static enableDarkMode(enable) {
if(enable) {
DoxygenAwesomeDarkModeToggle.darkModeEnabled = true
document.documentElement.classList.add("dark-mode")
document.documentElement.classList.remove("light-mode")
} else {
DoxygenAwesomeDarkModeToggle.darkModeEnabled = false
document.documentElement.classList.remove("dark-mode")
document.documentElement.classList.add("light-mode")
}
}
static onSystemPreferenceChanged() {
DoxygenAwesomeDarkModeToggle.darkModeEnabled = DoxygenAwesomeDarkModeToggle.userPreference
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled)
}
static onUserPreferenceChanged() {
DoxygenAwesomeDarkModeToggle.enableDarkMode(DoxygenAwesomeDarkModeToggle.darkModeEnabled)
}
toggleDarkMode() {
DoxygenAwesomeDarkModeToggle.userPreference = !DoxygenAwesomeDarkModeToggle.userPreference
this.updateIcon()
}
updateIcon() {
if(DoxygenAwesomeDarkModeToggle.darkModeEnabled) {
this.innerHTML = DoxygenAwesomeDarkModeToggle.darkModeIcon
} else {
this.innerHTML = DoxygenAwesomeDarkModeToggle.lightModeIcon
}
}
}
customElements.define("doxygen-awesome-dark-mode-toggle", DoxygenAwesomeDarkModeToggle);
@@ -1,66 +0,0 @@
// SPDX-License-Identifier: MIT
/**
Doxygen Awesome
https://github.com/jothepro/doxygen-awesome-css
Copyright (c) 2022 - 2025 jothepro
*/
class DoxygenAwesomeFragmentCopyButton extends HTMLElement {
constructor() {
super();
this.onclick=this.copyContent
}
static title = "Copy to clipboard"
static copyIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M23.04,10.322c0,-2.582 -2.096,-4.678 -4.678,-4.678l-6.918,-0c-2.582,-0 -4.678,2.096 -4.678,4.678c0,-0 0,8.04 0,8.04c0,2.582 2.096,4.678 4.678,4.678c0,-0 6.918,-0 6.918,-0c2.582,-0 4.678,-2.096 4.678,-4.678c0,-0 0,-8.04 0,-8.04Zm-2.438,-0l-0,8.04c-0,1.236 -1.004,2.24 -2.24,2.24l-6.918,-0c-1.236,-0 -2.239,-1.004 -2.239,-2.24l-0,-8.04c-0,-1.236 1.003,-2.24 2.239,-2.24c0,0 6.918,0 6.918,0c1.236,0 2.24,1.004 2.24,2.24Z"/><path d="M5.327,16.748c-0,0.358 -0.291,0.648 -0.649,0.648c0,0 0,0 0,0c-2.582,0 -4.678,-2.096 -4.678,-4.678c0,0 0,-8.04 0,-8.04c0,-2.582 2.096,-4.678 4.678,-4.678l6.918,0c2.168,0 3.994,1.478 4.523,3.481c0.038,0.149 0.005,0.306 -0.09,0.428c-0.094,0.121 -0.239,0.191 -0.392,0.191c-0.451,0.005 -1.057,0.005 -1.457,0.005c-0.238,0 -0.455,-0.14 -0.553,-0.357c-0.348,-0.773 -1.128,-1.31 -2.031,-1.31c-0,0 -6.918,0 -6.918,0c-1.236,0 -2.24,1.004 -2.24,2.24l0,8.04c0,1.236 1.004,2.24 2.24,2.24l0,-0c0.358,-0 0.649,0.29 0.649,0.648c-0,0.353 -0,0.789 -0,1.142Z" style="fill-opacity:0.6;"/></svg>`
static successIcon = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M8.084,16.111c-0.09,0.09 -0.212,0.141 -0.34,0.141c-0.127,-0 -0.249,-0.051 -0.339,-0.141c-0.746,-0.746 -2.538,-2.538 -3.525,-3.525c-0.375,-0.375 -0.983,-0.375 -1.357,0c-0.178,0.178 -0.369,0.369 -0.547,0.547c-0.375,0.375 -0.375,0.982 -0,1.357c1.135,1.135 3.422,3.422 4.75,4.751c0.27,0.27 0.637,0.421 1.018,0.421c0.382,0 0.749,-0.151 1.019,-0.421c2.731,-2.732 10.166,-10.167 12.454,-12.455c0.375,-0.375 0.375,-0.982 -0,-1.357c-0.178,-0.178 -0.369,-0.369 -0.547,-0.547c-0.375,-0.375 -0.982,-0.375 -1.357,0c-2.273,2.273 -9.567,9.567 -11.229,11.229Z"/></svg>`
static successDuration = 980
static init() {
$(function() {
$(document).ready(function() {
if(navigator.clipboard) {
const fragments = document.getElementsByClassName("fragment")
for(const fragment of fragments) {
const fragmentWrapper = document.createElement("div")
fragmentWrapper.className = "doxygen-awesome-fragment-wrapper"
const fragmentCopyButton = document.createElement("doxygen-awesome-fragment-copy-button")
fragmentCopyButton.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon
fragmentCopyButton.title = DoxygenAwesomeFragmentCopyButton.title
fragment.parentNode.replaceChild(fragmentWrapper, fragment)
fragmentWrapper.appendChild(fragment)
fragmentWrapper.appendChild(fragmentCopyButton)
}
}
})
})
}
copyContent() {
const content = this.previousSibling.cloneNode(true)
// filter out line number from file listings
content.querySelectorAll(".lineno, .ttc").forEach((node) => {
node.remove()
})
let textContent = content.textContent
// remove trailing newlines that appear in file listings
let numberOfTrailingNewlines = 0
while(textContent.charAt(textContent.length - (numberOfTrailingNewlines + 1)) == '\n') {
numberOfTrailingNewlines++;
}
textContent = textContent.substring(0, textContent.length - numberOfTrailingNewlines)
navigator.clipboard.writeText(textContent);
this.classList.add("success")
this.innerHTML = DoxygenAwesomeFragmentCopyButton.successIcon
window.setTimeout(() => {
this.classList.remove("success")
this.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon
}, DoxygenAwesomeFragmentCopyButton.successDuration);
}
}
customElements.define("doxygen-awesome-fragment-copy-button", DoxygenAwesomeFragmentCopyButton)
@@ -1,32 +0,0 @@
// SPDX-License-Identifier: MIT
/**
Doxygen Awesome
https://github.com/jothepro/doxygen-awesome-css
Copyright (c) 2022 - 2025 jothepro
*/
class DoxygenAwesomeParagraphLink {
// Icon from https://fonts.google.com/icons
// Licensed under the Apache 2.0 license:
// https://www.apache.org/licenses/LICENSE-2.0.html
static icon = `<svg xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M17 7h-4v2h4c1.65 0 3 1.35 3 3s-1.35 3-3 3h-4v2h4c2.76 0 5-2.24 5-5s-2.24-5-5-5zm-6 8H7c-1.65 0-3-1.35-3-3s1.35-3 3-3h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-2zm-3-4h8v2H8z"/></svg>`
static title = "Permanent Link"
static init() {
$(function() {
$(document).ready(function() {
document.querySelectorAll(".contents a.anchor[id], .contents .groupheader > a[id]").forEach((node) => {
let anchorlink = document.createElement("a")
anchorlink.setAttribute("href", `#${node.getAttribute("id")}`)
anchorlink.setAttribute("title", DoxygenAwesomeParagraphLink.title)
anchorlink.classList.add("anchorlink")
node.classList.add("anchor")
anchorlink.innerHTML = DoxygenAwesomeParagraphLink.icon
node.parentElement.appendChild(anchorlink)
})
})
})
}
}
@@ -1,20 +0,0 @@
/* SPDX-License-Identifier: MIT */
/**
Doxygen Awesome
https://github.com/jothepro/doxygen-awesome-css
Copyright (c) 2021 - 2025 jothepro
*/
@media screen and (min-width: 768px) {
#MSearchBox {
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - var(--searchbar-height) - 1px);
}
#MSearchField {
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - 66px - var(--searchbar-height));
}
}
@@ -1,105 +0,0 @@
/* SPDX-License-Identifier: MIT */
/**
Doxygen Awesome
https://github.com/jothepro/doxygen-awesome-css
Copyright (c) 2021 - 2025 jothepro
*/
html {
/* side nav width. MUST be = `TREEVIEW_WIDTH`.
* Make sure it is wide enough to contain the page title (logo + title + version)
*/
--side-nav-fixed-width: 335px;
--menu-display: none;
--top-height: 120px;
--toc-sticky-top: -25px;
--toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 25px);
}
#projectname {
white-space: nowrap;
}
@media screen and (min-width: 768px) {
html {
--searchbar-background: var(--page-background-color);
}
#side-nav {
min-width: var(--side-nav-fixed-width);
max-width: var(--side-nav-fixed-width);
top: var(--top-height);
overflow: visible;
}
#nav-tree, #side-nav {
height: calc(100vh - var(--top-height)) !important;
}
#top {
display: block;
border-bottom: none;
height: var(--top-height);
margin-bottom: calc(0px - var(--top-height));
max-width: var(--side-nav-fixed-width);
overflow: hidden;
background: var(--side-nav-background);
}
#main-nav {
float: left;
padding-right: 0;
}
.ui-resizable-handle {
display: none;
}
.ui-resizable-e {
width: 0;
}
#nav-path {
position: fixed;
right: 0;
left: calc(var(--side-nav-fixed-width) + 1px);
bottom: 0;
width: auto;
}
#doc-content {
height: calc(100vh - 31px) !important;
padding-bottom: calc(3 * var(--spacing-large));
padding-top: calc(var(--top-height) - 80px);
box-sizing: border-box;
margin-left: var(--side-nav-fixed-width) !important;
}
#MSearchBox {
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)));
}
#MSearchField {
width: calc(var(--side-nav-fixed-width) - calc(2 * var(--spacing-medium)) - 65px);
}
#MSearchResultsWindow {
left: var(--spacing-medium) !important;
right: auto;
}
#nav-sync {
bottom: 4px;
right: auto;
left: 300px;
width: 35px;
top: auto !important;
user-select: none;
position: fixed
}
}
File diff suppressed because it is too large Load Diff
-191
View File
@@ -1,191 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2012-2019 Agner Fog.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-14
View File
@@ -1,14 +0,0 @@
# version2
Vector Class Library, latest version
This is a C++ class library for using the Single Instruction Multiple Data (SIMD) instructions to improve performance on modern microprocessors with the x86 or x86/64 instruction set on Windows, Linux, and Mac platforms. There are no plans to support ARM or other instruction sets.
[Latest release](https://github.com/vectorclass/version2/releases)
[Download manual](https://github.com/vectorclass/manual/raw/master/vcl_manual.pdf)
[Add-on packages for particular applications](https://github.com/vectorclass/add-on)
[Getting-started video.](https://www.youtube.com/watch?v=TKjYdLIMTrI) Video blogger Christopher Rose has made this nice video telling how to get started with the Vector Class Library.
**Help:** You may ask for programming help on [StackOverflow](https://stackoverflow.com) using the tag vector-class-library.
-244
View File
@@ -1,244 +0,0 @@
Change log for Vector class library
-----------------------------------
2026-04-14 version 2.02.03
* conversions Vec8h <-> Vec8f and Vec16h <-> Vec16f converted to templates in vectorfp16e.h
2023-07-04 version 2.02.02
* remove various MS compiler warnings
2022-06-03 version 2.02.01
* minor bug fixes and updates
2022-07-20 version 2.02.00
* support half precision floating point vectors
* new trigonometric functions sinpi, cospi, sincospi, tanpi
* floating point modulo and remainder functions
* functions extend_z and concatenate2
* functions compress_saturated with one integer parameter
* support for Intel compiler
* fix bug for NAN inputs in operator > and >=
* fix bug for underflow in pow function
* fix unsafe optimization in store_partial function
* new add-on package with container class and matrix class templates
* major improvements in add-on package 'complex'
* minor improvements in add-on packages 'random' and 'vector3d'
2021-08-18 version 2.01.04
* fix bug in elementtype for Vec8uq
* improved optimization of permute functions in MS compiler by using constexpr
2020-11-04 version 2.01.03
* fix overflow in sin, cos, tan for large x
* fix bug in is_nan for instruction sets prior to AVX
* warning for MS compiler versions with poor support for AVX512
2020-04-11 version 2.01.02
* only minor fixes
2020-02-25 version 2.01.01
* added function store_nt
* New dispatch_example1.cpp, dispatch_example2.cpp
2019-11-23 version 2.01.00
* problem with performance of permute and blend functions fixed by avoiding
unions in constexpr functions
2019-10-31 version 2.00.02
* bug fix in permute function
* is_nan function improved
* templates constant4ui etc. improved
2019-08-02 version 2.00
Derived from version 1.40
* use C++17
* use compact boolean vectors of all sizes if AVX512VL is enabled
* permute and blend functions improved, using C++17 metaprogramming features
* deprecated functions removed
2019-08-02 version 1.40
* hosted on github
* license changed to Apache 2.0.
* added classes Vec64c, Vec64uc, Vec32s, Vec32us
* test bench and scripts for automatic testing of VCL
* new functions: maximum, minimum, to_float, to_double
* conversion of bitfields to boolean vectors with load_bits. This replaces to_vec4ib etc.
* shift_bytes_up/down functions changed to templates (old versions deprecated)
* removed VECTORMATH define. vectormath_lib.h rewritten. svmlpatch.lib added.
* many improvements and bug fixes
* renamed functions: round_to_int and round_to_int64 functions renamed to roundi,
* renamed functions: the type letter is removed from all permute and blend functions,
e.g. permute4f renamed to permute4.
These changes are made to facilitate generic template programming
* renamed functions: to_Vec.. Replaced by load_bits member functions
* deprecated functions: set_bit, get_bit
* deprecated bit vector classes: Vec128b, Vec256b, Vec512b
2017-07-27 version 1.30
* fixed bug in permute8f for a particular combination of indexes
2017-05-10 version 1.29
* Reversed Apple Clang patch in version 1.28 because the problem has reoccurred in
later versions of Clang
2017-05-02 version 1.28
* Fixed problem with Apple Clang version 6.2 in vectorf128.h
* Fixed return type for Vec8sb operator > (Vec8us, Vec8us)
* cpuid function modified in instrset_detect.cpp
2017-02-19 version 1.27
* fixed problem with scatter functions in MS Visual Studio
2016-12-21 version 1.26
* added constant4ui template
* fixed error for complexvec.h with clang
* fixed error in vectormath_exp.h for MAX_VECTOR_SIZE < 512
2016-11-25 version 1.25
* scatter functions
* new functions to_float for unsigned integer vectors
* instrset_detect function can detect AVX512VL, AVX512BW, AVX512DQ
* functions hasF16C and hasAVX512ER for detecting instruction set extensions
* fix bugs in horizontal_and and pow(0,0) for AVX512
* functions improved for AVX512 and AVX512VL: pow, approx_recipr,
approx_rsqrt
* functions improved for AVX512DQ: 64 bit multiplication, to_double,
32 and 64 bit rotate_left, round_to_int64, truncate_to_int64
* functions improved for AVX512ER: approx_recipr, approx_rsqrt,
exponential functions
2016-10-31 version 1.24
* fix bug in Vec8uq constructor in vectori512e.h
2016-09-27 version 1.23
* temporary fix of a problem in Clang version 3.9 inserted in vectorf128.h
2016-05-03 version 1.22
* added optional namespace
* fixed problem with decimal.h
2016-04-24 version 1.21
* fix problems with XOP option in gcc
* improved horizontal_and/or for sse2
* improved Vec2q and Vec4q constructor on Microsoft Visual Studio 2015
* removed warnings by gcc option -Wcast-qual
2015-12-04 version 1.20
* round functions: suppress precision exception under SSE4.1 and higher
* fix compiler problems with AVX512 multiplication in gcc version 5.1
* fix compiler problems with pow function in Microsoft Visual Studio 2015
2015-11-14 version 1.19
* fix various problems with Clang compiler
2015-09-25 version 1.18
* fix compiler error for Vec8s divide_by_i(Vec8s const & x) under Clang compiler
* fix error in Vec4d::size() in vectorf256e.h
2015-07-31 version 1.17
* improved operator > for Vec4uq
* more special cases in blend4q
* nan_code functions made static inline
* template parameter BTYPE renamed to BVTYPE in mathematical functions to avoid clash
with macro named BTYPE in winnt.h
* fixed bug in Vec4db constructor
2014-10-24 version 1.16
* workaround for problem in Clang compiler extended to version 3.09 because not
fixed yet by Clang (vectorf128.h line 134)
* recognize problem with Apple version of Clang reporting wrong version number
* remove various minor problems with Clang
* function pow(vector, int) modified to strengthen type checking and avoid compiler warnings
* manual discusses dynamic allocation of arrays of vectors
* various minor changes
2014-10-17 version 1.15
* added files ranvec1.h and ranvec1.cpp for random number generator
* constructors to make boolean vectors from their elements
* constructors and = operators to broadcast boolean scalar into boolean vectors
* various lookup functions improved
* operators &, |, ^, ~, etc. defined for various boolean vectors to avoid converson
to integer vectors
* nmul_add functions
* mul_add etc. moved to main header files
* explicit fused multiply-and-add used in math functions to improve performance
on compilers that don't automatically insert FMA
2014-07-24 version 1.14
* support for AVX-512f instruction set and 512-bit vectors:
Vec16i, Vec16ui, Vec8q, Vec8uq, Vec16f, Vec8d, and corresponding boolean vectors
* new define MAX_VECTOR_SIZE, valid values are 128, 256 and 512
* added hyperbolic functions sinh, cosh, tanh, asinh, acosh, atanh
* size() member function on all vector classes returns the number of elements
* functions for conversion between boolean vectors and integer bitfields
* extracting an element from a boolean vector now returns a bool, not an int
* improved precision in exp2 and exp10 functions
* various bug fixes
2014-05-11 version 1.13
* pow function improved
* mul_add, mul_sub, mul_sub_x functions
* propagation of error codes through nan_code function
* "denormal" renamed to "subnormal" everywhere, in accordance with IEEE 754-2008 standard
2014-04-20 version 1.12
* inline implementation of mathematical functions added (vectormath_exp.h vectormath_trig.h
vectormath_common.h)
* vectormath.h renamed to vectormath_lib.h because a new alternative is added
* gather functions with constant indexes
* function sign_combine
* function pow_const(vector, const int)
* function pow_ratio(vector, const int, const int)
* functions horizontal_find_first, horizontal_count
* function recipr_sqrt removed
* functions round_to_int64_limited, truncate_to_int64_limited, to_double_limited
* function cubic_root renamed to cbrt
* function atan(vector,vector) renamed to atan2
* function if_mul
* function Vec4i round_to_int(Vec2d)
* operator & (float vector, boolean vector)
* operator &= (int vector, int vector)
* removed constructor Vec128b(int) and Vec256b(int) to avoid implicit conversion
* removed signalling nan function
* minor improvements in various blend and lookup functions
2014-03-01 version 1.11
* fixed missing unsigned operators >>= in vectori256.h
2013-10-04 version 1.10
* clear distinction between boolean vectors and integer vectors for the sake of
compatibility with mask registers in forthcoming AVX512 instruction set
* added function if_add
* tentative support for clang version 3.3 with workaround for bugs
* remove ambiguity for builtin m128i operator == in clang compiler.
* problems in clang compiler, bug reports filed at clang
(http://llvm.org/bugs/show_bug.cgi?id=17164, 17312)
* instrset.h fixes problem with macros named min and max in MS windows.h
* workaround problem in MS Visual Studio 11.0. Bug report 735861 and 804274
* minor bug fixes
2013-03-31 version 1.03 beta
* bug fix for Vec2d cos (Vec2d const & x), VECTORMATH = 1
2012-08-01 version 1.02 beta
* added file vector3d.h for 3-dimensional vectors
* added file complexvec.h for complex numbers and complex vectors
* added file quaternion.h for quaternions
* added function change_sign for floating point vectors
* added operators +, -, *, / between floating point vectors and scalars to remove
overloading ambiguity
2012-07-08 version 1.01 beta
* added file decimal.h with Number <-> string conversion functions:
bin2bcd, bin2ascii, bin2hex_ascii, ascii2bin
* added andnot function for boolean vectors
* added functions shift_bytes_up and shift_bytes_down
* added operators for unsigned integer vector classes: >>=, &, &&, |, ||, ^, ~
* inteldispatchpatch.cpp removed. Use asmlib instead (www.agner.org/optimize/#asmlib)
* prefix ++ and -- operators now return a reference, postfix operators return a value
* various improvements in permute and blend functions
* minor improvement in abs function
* added version number to VECTORCLASS_H
2012-05-30 version 1.00 beta
* first public release at www.agner.org
File diff suppressed because it is too large Load Diff
-828
View File
@@ -1,828 +0,0 @@
/************************** vector_convert.h *******************************
* Author: Agner Fog
* Date created: 2014-07-23
* Last modified: 2022-07-20
* Version: 2.02.00
* Project: vector class library
* Description:
* Header file for conversion between different vector classes with different
* sizes. Also includes verious generic template functions.
*
* (c) Copyright 2012-2022 Agner Fog.
* Apache License version 2.0 or later.
*****************************************************************************/
#ifndef VECTOR_CONVERT_H
#define VECTOR_CONVERT_H
#ifndef VECTORCLASS_H
#include "vectorclass.h"
#endif
#if VECTORCLASS_H < 20200
#error Incompatible versions of vector class library mixed
#endif
#ifdef VCL_NAMESPACE
namespace VCL_NAMESPACE {
#endif
#if MAX_VECTOR_SIZE >= 256
/*****************************************************************************
*
* Extend from 128 to 256 bit vectors
*
*****************************************************************************/
#if INSTRSET >= 8 // AVX2. 256 bit integer vectors
// sign extend
static inline Vec16s extend (Vec16c const a) {
return _mm256_cvtepi8_epi16(a);
}
// zero extend
static inline Vec16us extend (Vec16uc const a) {
return _mm256_cvtepu8_epi16(a);
}
// sign extend
static inline Vec8i extend (Vec8s const a) {
return _mm256_cvtepi16_epi32(a);
}
// zero extend
static inline Vec8ui extend (Vec8us const a) {
return _mm256_cvtepu16_epi32(a);
}
// sign extend
static inline Vec4q extend (Vec4i const a) {
return _mm256_cvtepi32_epi64(a);
}
// zero extend
static inline Vec4uq extend (Vec4ui const a) {
return _mm256_cvtepu32_epi64(a);
}
#else // no AVX2. 256 bit integer vectors are emulated
// sign extend and zero extend functions:
static inline Vec16s extend (Vec16c const a) {
return Vec16s(extend_low(a), extend_high(a));
}
static inline Vec16us extend (Vec16uc const a) {
return Vec16us(extend_low(a), extend_high(a));
}
static inline Vec8i extend (Vec8s const a) {
return Vec8i(extend_low(a), extend_high(a));
}
static inline Vec8ui extend (Vec8us const a) {
return Vec8ui(extend_low(a), extend_high(a));
}
static inline Vec4q extend (Vec4i const a) {
return Vec4q(extend_low(a), extend_high(a));
}
static inline Vec4uq extend (Vec4ui const a) {
return Vec4uq(extend_low(a), extend_high(a));
}
#endif // AVX2
/*****************************************************************************
*
* Conversions between float and double
*
*****************************************************************************/
#if INSTRSET >= 7 // AVX. 256 bit float vectors
// float to double
static inline Vec4d to_double (Vec4f const a) {
return _mm256_cvtps_pd(a);
}
// double to float
static inline Vec4f to_float (Vec4d const a) {
return _mm256_cvtpd_ps(a);
}
#else // no AVX2. 256 bit float vectors are emulated
// float to double
static inline Vec4d to_double (Vec4f const a) {
Vec2d lo = _mm_cvtps_pd(a);
Vec2d hi = _mm_cvtps_pd(_mm_movehl_ps(a, a));
return Vec4d(lo,hi);
}
// double to float
static inline Vec4f to_float (Vec4d const a) {
Vec4f lo = _mm_cvtpd_ps(a.get_low());
Vec4f hi = _mm_cvtpd_ps(a.get_high());
return _mm_movelh_ps(lo, hi);
}
#endif
/*****************************************************************************
*
* Reduce from 256 to 128 bit vectors
*
*****************************************************************************/
#if INSTRSET >= 10 // AVX512VL
// compress functions. overflow wraps around
static inline Vec16c compress (Vec16s const a) {
return _mm256_cvtepi16_epi8(a);
}
static inline Vec16uc compress (Vec16us const a) {
return _mm256_cvtepi16_epi8(a);
}
static inline Vec8s compress (Vec8i const a) {
return _mm256_cvtepi32_epi16(a);
}
static inline Vec8us compress (Vec8ui const a) {
return _mm256_cvtepi32_epi16(a);
}
static inline Vec4i compress (Vec4q const a) {
return _mm256_cvtepi64_epi32(a);
}
static inline Vec4ui compress (Vec4uq const a) {
return _mm256_cvtepi64_epi32(a);
}
// compress_saturated functions. overflow saturates
static inline Vec16c compress_saturated (Vec16s const a) {
return _mm256_cvtsepi16_epi8(a);
}
static inline Vec16uc compress_saturated (Vec16us const a) {
return _mm256_cvtusepi16_epi8(a);
}
static inline Vec8s compress_saturated (Vec8i const a) {
return _mm256_cvtsepi32_epi16(a);
}
static inline Vec8us compress_saturated (Vec8ui const a) {
return _mm256_cvtusepi32_epi16(a);
}
static inline Vec4i compress_saturated (Vec4q const a) {
return _mm256_cvtsepi64_epi32(a);
}
static inline Vec4ui compress_saturated (Vec4uq const a) {
return _mm256_cvtusepi64_epi32(a);
}
#else // no AVX512
// compress functions. overflow wraps around
static inline Vec16c compress (Vec16s const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec16uc compress (Vec16us const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec8s compress (Vec8i const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec8us compress (Vec8ui const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec4i compress (Vec4q const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec4ui compress (Vec4uq const a) {
return compress(a.get_low(), a.get_high());
}
// compress_saturated functions. overflow saturates
static inline Vec16c compress_saturated (Vec16s const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec16uc compress_saturated (Vec16us const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec8s compress_saturated (Vec8i const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec8us compress_saturated (Vec8ui const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec4i compress_saturated (Vec4q const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec4ui compress_saturated (Vec4uq const a) {
return compress_saturated(a.get_low(), a.get_high());
}
#endif // AVX512
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
/*****************************************************************************
*
* Reduce from 512 to 256 bit vectors
*
*****************************************************************************/
#if INSTRSET >= 10 // AVX512VL
// compress_saturated functions. overflow saturates
static inline Vec32c compress_saturated (Vec32s const a) {
return _mm512_cvtsepi16_epi8(a);
}
static inline Vec32uc compress_saturated (Vec32us const a) {
return _mm512_cvtusepi16_epi8(a);
}
static inline Vec16s compress_saturated (Vec16i const a) {
return _mm512_cvtsepi32_epi16(a);
}
static inline Vec16us compress_saturated (Vec16ui const a) {
return _mm512_cvtusepi32_epi16(a);
}
static inline Vec8i compress_saturated (Vec8q const a) {
return _mm512_cvtsepi64_epi32(a);
}
static inline Vec8ui compress_saturated (Vec8uq const a) {
return _mm512_cvtusepi64_epi32(a);
}
#else // no AVX512
// compress_saturated functions. overflow saturates
static inline Vec32c compress_saturated (Vec32s const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec32uc compress_saturated (Vec32us const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec16s compress_saturated (Vec16i const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec16us compress_saturated (Vec16ui const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec8i compress_saturated (Vec8q const a) {
return compress_saturated(a.get_low(), a.get_high());
}
static inline Vec8ui compress_saturated (Vec8uq const a) {
return compress_saturated(a.get_low(), a.get_high());
}
#endif // AVX512
/*****************************************************************************
*
* Extend from 256 to 512 bit vectors
*
*****************************************************************************/
#if INSTRSET >= 9 // AVX512. 512 bit integer vectors
// sign extend
static inline Vec32s extend (Vec32c const a) {
#if INSTRSET >= 10
return _mm512_cvtepi8_epi16(a);
#else
return Vec32s(extend_low(a), extend_high(a));
#endif
}
// zero extend
static inline Vec32us extend (Vec32uc const a) {
#if INSTRSET >= 10
return _mm512_cvtepu8_epi16(a);
#else
return Vec32us(extend_low(a), extend_high(a));
#endif
}
// sign extend
static inline Vec16i extend (Vec16s const a) {
return _mm512_cvtepi16_epi32(a);
}
// zero extend
static inline Vec16ui extend (Vec16us const a) {
return _mm512_cvtepu16_epi32(a);
}
// sign extend
static inline Vec8q extend (Vec8i const a) {
return _mm512_cvtepi32_epi64(a);
}
// zero extend
static inline Vec8uq extend (Vec8ui const a) {
return _mm512_cvtepu32_epi64(a);
}
#else // no AVX512. 512 bit vectors are emulated
// sign extend
static inline Vec32s extend (Vec32c const a) {
return Vec32s(extend_low(a), extend_high(a));
}
// zero extend
static inline Vec32us extend (Vec32uc const a) {
return Vec32us(extend_low(a), extend_high(a));
}
// sign extend
static inline Vec16i extend (Vec16s const a) {
return Vec16i(extend_low(a), extend_high(a));
}
// zero extend
static inline Vec16ui extend (Vec16us const a) {
return Vec16ui(extend_low(a), extend_high(a));
}
// sign extend
static inline Vec8q extend (Vec8i const a) {
return Vec8q(extend_low(a), extend_high(a));
}
// zero extend
static inline Vec8uq extend (Vec8ui const a) {
return Vec8uq(extend_low(a), extend_high(a));
}
#endif // AVX512
/*****************************************************************************
*
* Reduce from 512 to 256 bit vectors
*
*****************************************************************************/
#if INSTRSET >= 9 // AVX512F
// compress functions. overflow wraps around
static inline Vec32c compress (Vec32s const a) {
#if INSTRSET >= 10 // AVVX512BW
return _mm512_cvtepi16_epi8(a);
#else
return compress(a.get_low(), a.get_high());
#endif
}
static inline Vec32uc compress (Vec32us const a) {
return Vec32uc(compress(Vec32s(a)));
}
static inline Vec16s compress (Vec16i const a) {
return _mm512_cvtepi32_epi16(a);
}
static inline Vec16us compress (Vec16ui const a) {
return _mm512_cvtepi32_epi16(a);
}
static inline Vec8i compress (Vec8q const a) {
return _mm512_cvtepi64_epi32(a);
}
static inline Vec8ui compress (Vec8uq const a) {
return _mm512_cvtepi64_epi32(a);
}
#else // no AVX512
// compress functions. overflow wraps around
static inline Vec32c compress (Vec32s const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec32uc compress (Vec32us const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec16s compress (Vec16i const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec16us compress (Vec16ui const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec8i compress (Vec8q const a) {
return compress(a.get_low(), a.get_high());
}
static inline Vec8ui compress (Vec8uq const a) {
return compress(a.get_low(), a.get_high());
}
#endif // AVX512
/*****************************************************************************
*
* Conversions between float and double
*
*****************************************************************************/
#if INSTRSET >= 9 // AVX512. 512 bit float vectors
// float to double
static inline Vec8d to_double (Vec8f const a) {
return _mm512_cvtps_pd(a);
}
// double to float
static inline Vec8f to_float (Vec8d const a) {
return _mm512_cvtpd_ps(a);
}
#else // no AVX512. 512 bit float vectors are emulated
// float to double
static inline Vec8d to_double (Vec8f const a) {
Vec4d lo = to_double(a.get_low());
Vec4d hi = to_double(a.get_high());
return Vec8d(lo,hi);
}
// double to float
static inline Vec8f to_float (Vec8d const a) {
Vec4f lo = to_float(a.get_low());
Vec4f hi = to_float(a.get_high());
return Vec8f(lo, hi);
}
#endif
#endif // MAX_VECTOR_SIZE >= 512
// double to float
static inline Vec4f to_float (Vec2d const a) {
return _mm_cvtpd_ps(a);
}
/*****************************************************************************
*
* Generic template functions
*
* These templates define functions for multiple vector types in one template
*
*****************************************************************************/
// concatenate two vectors into one vector of double size
template <typename T> auto concatenate2(T const a, T const b) {
static_assert(sizeof(T) * 8 < MAX_VECTOR_SIZE, "Maximum vector size exceeded");
return decltype(extend_z(a))(a, b); // call constructor for double size vector type
}
// horizontal min/max of vector elements
// implemented with universal template, works for all vector types:
template <typename T> auto horizontal_min(T const x) {
if constexpr (T::elementtype() >= 15) {
// T is a float or double vector
if (horizontal_or(is_nan(x))) {
// check for NAN because min does not guarantee NAN propagation
return x[horizontal_find_first(is_nan(x))];
}
}
return horizontal_min1(x);
}
template <typename T> auto horizontal_min1(T const x) {
if constexpr (T::elementtype() <= 3) { // boolean vector type
return horizontal_and(x);
}
else if constexpr (sizeof(T) >= 32) {
// split recursively into smaller vectors
return horizontal_min1(min(x.get_low(), x.get_high()));
}
else if constexpr (T::size() == 2) {
T a = permute2 <1, V_DC>(x); // high half
T b = min(a, x);
return b[0];
}
else if constexpr (T::size() == 4) {
T a = permute4<2, 3, V_DC, V_DC>(x); // high half
T b = min(a, x);
a = permute4<1, V_DC, V_DC, V_DC>(b);
b = min(a, b);
return b[0];
}
else if constexpr (T::size() == 8) {
T a = permute8<4, 5, 6, 7, V_DC, V_DC, V_DC, V_DC>(x); // high half
T b = min(a, x);
a = permute8<2, 3, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = min(a, b);
a = permute8<1, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = min(a, b);
return b[0];
}
else {
static_assert(T::size() == 16); // no other size is allowed
T a = permute16<8, 9, 10, 11, 12, 13, 14, 15, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC >(x); // high half
T b = min(a, x);
a = permute16<4, 5, 6, 7, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = min(a, b);
a = permute16<2, 3, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = min(a, b);
a = permute16<1, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = min(a, b);
return b[0];
}
}
template <typename T> auto horizontal_max(T const x) {
if constexpr (T::elementtype() >= 15) {
// T is a float or double vector
if (horizontal_or(is_nan(x))) {
// check for NAN because max does not guarantee NAN propagation
return x[horizontal_find_first(is_nan(x))];
}
}
return horizontal_max1(x);
}
template <typename T> auto horizontal_max1(T const x) {
if constexpr (T::elementtype() <= 3) { // boolean vector type
return horizontal_or(x);
}
else if constexpr (sizeof(T) >= 32) {
// split recursively into smaller vectors
return horizontal_max1(max(x.get_low(), x.get_high()));
}
else if constexpr (T::size() == 2) {
T a = permute2 <1, V_DC>(x); // high half
T b = max(a, x);
return b[0];
}
else if constexpr (T::size() == 4) {
T a = permute4<2, 3, V_DC, V_DC>(x); // high half
T b = max(a, x);
a = permute4<1, V_DC, V_DC, V_DC>(b);
b = max(a, b);
return b[0];
}
else if constexpr (T::size() == 8) {
T a = permute8<4, 5, 6, 7, V_DC, V_DC, V_DC, V_DC>(x); // high half
T b = max(a, x);
a = permute8<2, 3, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = max(a, b);
a = permute8<1, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = max(a, b);
return b[0];
}
else {
static_assert(T::size() == 16); // no other size is allowed
T a = permute16<8, 9, 10, 11, 12, 13, 14, 15, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC >(x); // high half
T b = max(a, x);
a = permute16<4, 5, 6, 7, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = max(a, b);
a = permute16<2, 3, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = max(a, b);
a = permute16<1, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC, V_DC>(b);
b = max(a, b);
return b[0];
}
}
// Find first element that is true in a boolean vector
template <typename V>
static inline int horizontal_find_first(V const x) {
static_assert(V::elementtype() == 2 || V::elementtype() == 3, "Boolean vector expected");
auto bits = to_bits(x); // convert to bits
if (bits == 0) return -1;
if constexpr (V::size() < 32) {
return bit_scan_forward((uint32_t)bits);
}
else {
return bit_scan_forward(bits);
}
}
// Count the number of elements that are true in a boolean vector
template <typename V>
static inline int horizontal_count(V const x) {
static_assert(V::elementtype() == 2 || V::elementtype() == 3, "Boolean vector expected");
auto bits = to_bits(x); // convert to bits
if constexpr (V::size() < 32) {
return vml_popcnt((uint32_t)bits);
}
else {
return (int)vml_popcnt(bits);
}
}
// maximum and minimum functions. This version is sure to propagate NANs,
// conforming to the new IEEE-754 2019 standard
template <typename V>
static inline V maximum(V const a, V const b) {
if constexpr (V::elementtype() < 15) {
return max(a, b); // integer type
}
else { // float or double vector
V y = select(is_nan(a), a, max(a, b));
#ifdef SIGNED_ZERO // pedantic about signed zero
y = select(a == b, a & b, y); // maximum(+0, -0) = +0
#endif
return y;
}
}
template <typename V>
static inline V minimum(V const a, V const b) {
if constexpr (V::elementtype() < 15) {
return min(a, b); // integer type
}
else { // float or double vector
V y = select(is_nan(a), a, min(a, b));
#ifdef SIGNED_ZERO // pedantic about signed zero
y = select(a == b, a | b, y); // minimum(+0, -0) = -0
#endif
return y;
}
}
// floating point remainder
// -denominator/2 <= result < denominator/2
template <typename V>
static inline V fremainder(V const numerator, double const denominator) {
// (Optimization notice: Calculation of 1/denominator and constants for extended precision reduction
// may be optimized by a compiler moving loop-invariant code. This is intended)
static_assert(V::elementtype() == 16 || V::elementtype() == 17, "wrong vector type"); // supports only float and double
if (denominator > 0.) { // denominator must be positive
if constexpr (V::elementtype() == 16) { // float
#ifdef __FMA__
float recipd = float(1.0 / denominator); // reciprocal denominator
float fd = float(denominator); // denominator rounded to single precision
float d2 = float(denominator - fd); // remaining bits for double precision
V q = round(numerator * recipd); // divide and round
V m = nmul_add(q, d2, nmul_add(q, fd, numerator));// double precision reduction
#else // no FMA. Use extended precision reduction
union {
float f;
uint32_t i;
} u;
u.f = float(denominator);
u.i &= 0xFFFFF000; // remove 12 least significant bits for extended precision reduction
float d2 = denominator - u.f; // remaining bits
float recipd = float(1.0 / denominator); // reciprocal
V q = round(numerator * recipd); // divide and round
V m = nmul_add(q, d2, nmul_add(q, u.f, numerator));// extended precision reduction
#endif // FMA
if (true) { // Check that result is within desired interval. This may be omitted if not essential:
// This check may be needed in extreme cases of numerator > 1.E5 * denominator
auto too_high = m >= float( denominator * 0.5);
auto too_low = m < float(-denominator * 0.5);
m = if_sub(too_high, m, float(denominator));
m = if_add(too_low, m, float(denominator));
}
return m;
}
else if constexpr (V::elementtype() == 17) { // double precision
#ifdef __FMA__
double recipd = 1.0 / denominator; // reciprocal
V q = round(numerator * recipd); // divide and round
V m = nmul_add(q, denominator, numerator); // nmul_add has extended precision
#else // no FMA. Use extended precision reduction
union {
double f;
uint64_t i;
} u;
u.f = denominator;
u.i &= 0xFFFFFFFFFF000000; // remove 24 least significant bits for extended precision reduction
double d2 = denominator - u.f; // remaining bits
double recipd = 1.0 / denominator; // reciprocal
V q = round(numerator * recipd); // divide and round
V m = nmul_add(q, d2, nmul_add(q, u.f, numerator));// extended precision reduction
#endif // FMA
if (true) { // Check that result is within desired interval. This may be omitted if not essential:
// This check is rarely needed except in extreme cases of numerator > 1.E14 * denominator
auto too_high = m >= denominator * 0.5;
auto too_low = m < -denominator * 0.5;
m = if_sub(too_high, m, denominator);
m = if_add(too_low, m, denominator);
}
return m;
}
}
else {
return nan_vec<V>(1); // denominator is not positive
}
}
// floating point modulo
// 0 <= result < denominator
template <typename V>
static inline V fmodulo(V const numerator, double const denominator) {
// (Optimization notice: Calculation of 1/denominator and constants for extended precision reduction
// may be optimized by a compiler moving loop-invariant code. This is intended)
static_assert(V::elementtype() == 16 || V::elementtype() == 17, "wrong vector type"); // supports only float and double
if (denominator > 0.) { // denominator must be positive
if constexpr (V::elementtype() == 16) { // float
#ifdef __FMA__
float recipd = float(1.0 / denominator); // reciprocal denominator
float fd = float(denominator); // denominator rounded to single precision
float d2 = float(denominator - fd); // remaining bits for double precision
V q = floor(numerator * recipd); // divide and floor
V m = nmul_add(q, d2, nmul_add(q, fd, numerator));// double precision reduction
#else // no FMA. Use extended precision reduction
union {
float f;
uint32_t i;
} u;
u.f = float(denominator);
u.i &= 0xFFFFF000; // remove 12 least significant bits for extended precision reduction
float d2 = denominator - u.f; // remaining bits
float recipd = float(1.0 / denominator); // reciprocal
V q = floor(numerator * recipd); // divide and floor
V m = nmul_add(q, d2, nmul_add(q, u.f, numerator));// extended precision reduction
#endif // FMA
if (true) { // Check that result is within desired interval. This may be omitted if not essential:
// This check may be needed in extreme cases of numerator > 1.E5 * denominator
auto too_high = m >= float(denominator);
auto too_low = m < 0.f;
m = if_sub(too_high, m, float(denominator));
m = if_add(too_low, m, float(denominator));
}
return m;
}
else if constexpr (V::elementtype() == 17) { // double precision
#ifdef __FMA__
double recipd = 1.0 / denominator; // reciprocal
V q = floor(numerator * recipd); // divide and floor
V m = nmul_add(q, denominator, numerator); // nmul_add has extended precision
#else // no FMA. Use extended precision reduction
union {
double f;
uint64_t i;
} u;
u.f = denominator;
u.i &= 0xFFFFFFFFFF000000; // remove 24 least significant bits for extended precision reduction
double d2 = denominator - u.f; // remaining bits
double recipd = 1.0 / denominator; // reciprocal
V q = floor(numerator * recipd); // divide and floor
V m = nmul_add(q, d2, nmul_add(q, u.f, numerator));// extended precision reduction
#endif // FMA
if (true) { // Check that result is within desired interval. This may be omitted if not essential:
// This check is rarely needed except in extreme cases of numerator > 1.E14 * denominator
auto too_high = m >= denominator;
auto too_low = m < 0.;
m = if_sub(too_high, m, denominator);
m = if_add(too_low, m, denominator);
}
return m;
}
}
else {
return nan_vec<V>(1); // denominator is not positive
}
}
#ifdef VCL_NAMESPACE
}
#endif
#endif // VECTOR_CONVERT_H
-87
View File
@@ -1,87 +0,0 @@
/**************************** vectorclass.h ********************************
* Author: Agner Fog
* Date created: 2012-05-30
* Last modified: 2026-04-14
* Version: 2.02.03
* Project: vector class library
* Home: https://github.com/vectorclass
* Description:
* Header file defining vector classes as interface to intrinsic functions
* in x86 and x86-64 microprocessors with SSE2 and later instruction sets.
*
* Instructions:
* Use Gnu, Clang, Microsoft, or Intel C++ compiler. Compile for the desired
* instruction set, which must be at least SSE2. Specify the supported
* instruction set by a command line define, e.g. __SSE4_1__ if the
* compiler does not automatically do so.
* For detailed instructions, see vcl_manual.pdf
*
* Each vector object is represented internally in the CPU as a vector
* register with 128, 256 or 512 bits.
*
* This header file includes the appropriate header files depending on the
* selected instruction set.
*
* (c) Copyright 2012-2026 Agner Fog.
* Apache License version 2.0 or later.
******************************************************************************/
#ifndef VECTORCLASS_H
#define VECTORCLASS_H 20203
// Maximum vector size, bits. Allowed values are 128, 256, 512
#ifndef MAX_VECTOR_SIZE
#define MAX_VECTOR_SIZE 512
#endif
// Determine instruction set, and define platform-dependent functions
#include "instrset.h" // Select supported instruction set
#if INSTRSET < 2 // instruction set SSE2 is the minimum
#error Please compile for the SSE2 instruction set or higher
#else
// Select appropriate .h files depending on instruction set
#include "vectori128.h" // 128-bit integer vectors
#include "vectorf128.h" // 128-bit floating point vectors
#if MAX_VECTOR_SIZE >= 256
#if INSTRSET >= 8
#include "vectori256.h" // 256-bit integer vectors, requires AVX2 instruction set
#else
#include "vectori256e.h" // 256-bit integer vectors, emulated
#endif // INSTRSET >= 8
#if INSTRSET >= 7
#include "vectorf256.h" // 256-bit floating point vectors, requires AVX instruction set
#else
#include "vectorf256e.h" // 256-bit floating point vectors, emulated
#endif // INSTRSET >= 7
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
#if INSTRSET >= 9
#include "vectori512.h" // 512-bit vectors of 32 and 64 bit integers, requires AVX512F instruction set
#include "vectorf512.h" // 512-bit floating point vectors, requires AVX512F instruction set
#else
#include "vectori512e.h" // 512-bit integer vectors, emulated
#include "vectorf512e.h" // 512-bit floating point vectors, emulated
#endif // INSTRSET >= 9
#if INSTRSET >= 10
#include "vectori512s.h" // 512-bit vectors of 8 and 16 bit integers, requires AVX512BW instruction set
#else
#include "vectori512se.h" // 512-bit vectors of 8 and 16 bit integers, emulated
#endif
#endif // MAX_VECTOR_SIZE >= 512
#include "vector_convert.h" // conversion between different vector sizes, and common templates
#endif // INSTRSET >= 2
#else // VECTORCLASS_H
#if VECTORCLASS_H < 20000
#error Mixed versions of vector class library
#endif
#endif // VECTORCLASS_H
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-327
View File
@@ -1,327 +0,0 @@
/*************************** vectormath_common.h ****************************
* Author: Agner Fog
* Date created: 2014-04-18
* Last modified: 2022-07-20
* Version: 2.02.00
* Project: vector classes
* Description:
* Header file containing common code for inline version of mathematical functions.
*
* For detailed instructions, see VectorClass.pdf
*
* (c) Copyright 2014-2022 Agner Fog.
* Apache License version 2.0 or later.
******************************************************************************/
#ifndef VECTORMATH_COMMON_H
#define VECTORMATH_COMMON_H 2
#ifdef VECTORMATH_LIB_H
#error conflicting header files. More than one implementation of mathematical functions included
#endif
#include <cmath>
#ifndef VECTORCLASS_H
#include "vectorclass.h"
#endif
#if VECTORCLASS_H < 20200
#error Incompatible versions of vector class library mixed
#endif
/******************************************************************************
Define NAN payload values
******************************************************************************/
#define NAN_LOG 0x101 // logarithm for x<0
#define NAN_POW 0x102 // negative number raised to non-integer power
#define NAN_HYP 0x104 // acosh for x<1 and atanh for abs(x)>1
/******************************************************************************
Define mathematical constants
******************************************************************************/
#define VM_PI 3.14159265358979323846 // pi
#define VM_PI_2 1.57079632679489661923 // pi / 2
#define VM_PI_4 0.785398163397448309616 // pi / 4
#define VM_SQRT2 1.41421356237309504880 // sqrt(2)
#define VM_LOG2E 1.44269504088896340736 // 1/log(2)
#define VM_LOG10E 0.434294481903251827651 // 1/log(10)
#define VM_LOG210 3.321928094887362347808 // log2(10)
#define VM_LN2 0.693147180559945309417 // log(2)
#define VM_LN10 2.30258509299404568402 // log(10)
#define VM_SMALLEST_NORMAL 2.2250738585072014E-308 // smallest normal number, double
#define VM_SMALLEST_NORMALF 1.17549435E-38f // smallest normal number, float
#ifdef VCL_NAMESPACE
namespace VCL_NAMESPACE {
#endif
/******************************************************************************
templates for producing infinite and nan in desired vector type
******************************************************************************/
template <typename VTYPE>
static inline VTYPE infinite_vec();
template <>
inline Vec2d infinite_vec<Vec2d>() {
return infinite2d();
}
template <>
inline Vec4f infinite_vec<Vec4f>() {
return infinite4f();
}
#if MAX_VECTOR_SIZE >= 256
template <>
inline Vec4d infinite_vec<Vec4d>() {
return infinite4d();
}
template <>
inline Vec8f infinite_vec<Vec8f>() {
return infinite8f();
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
template <>
inline Vec8d infinite_vec<Vec8d>() {
return infinite8d();
}
template <>
inline Vec16f infinite_vec<Vec16f>() {
return infinite16f();
}
#endif // MAX_VECTOR_SIZE >= 512
/******************************************************************************
* Detect NAN codes
*
* These functions return the code hidden in a NAN. The sign bit is ignored
******************************************************************************/
static inline Vec4ui nan_code(Vec4f const x) {
Vec4ui a = Vec4ui(reinterpret_i(x));
Vec4ui const n = 0x007FFFFF;
return select(Vec4ib(is_nan(x)), a & n, 0);
}
// This function returns the code hidden in a NAN. The sign bit is ignored
static inline Vec2uq nan_code(Vec2d const x) {
Vec2uq a = Vec2uq(reinterpret_i(x));
return select(Vec2qb(is_nan(x)), a << 12 >> (12+29), 0);
}
#if MAX_VECTOR_SIZE >= 256
// This function returns the code hidden in a NAN. The sign bit is ignored
static inline Vec8ui nan_code(Vec8f const x) {
Vec8ui a = Vec8ui(reinterpret_i(x));
Vec8ui const n = 0x007FFFFF;
return select(Vec8ib(is_nan(x)), a & n, 0);
}
// This function returns the code hidden in a NAN. The sign bit is ignored
static inline Vec4uq nan_code(Vec4d const x) {
Vec4uq a = Vec4uq(reinterpret_i(x));
return select(Vec4qb(is_nan(x)), a << 12 >> (12+29), 0);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
// This function returns the code hidden in a NAN. The sign bit is ignored
static inline Vec16ui nan_code(Vec16f const x) {
Vec16ui a = Vec16ui(reinterpret_i(x));
Vec16ui const n = 0x007FFFFF;
return select(Vec16ib(is_nan(x)), a & n, 0);
}
// This function returns the code hidden in a NAN. The sign bit is ignored
static inline Vec8uq nan_code(Vec8d const x) {
Vec8uq a = Vec8uq(reinterpret_i(x));
return select(Vec8qb(is_nan(x)), a << 12 >> (12+29), 0);
}
#endif // MAX_VECTOR_SIZE >= 512
/******************************************************************************
templates for polynomials
Using Estrin's scheme to make shorter dependency chains and use FMA, starting
longest dependency chains first.
******************************************************************************/
// template <typedef VECTYPE, typedef CTYPE>
template <class VTYPE, class CTYPE>
static inline VTYPE polynomial_2(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2) {
// calculates polynomial c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
//return = x2 * c2 + (x * c1 + c0);
return mul_add(x2, c2, mul_add(x, c1, c0));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_3(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3) {
// calculates polynomial c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
//return (c2 + c3*x)*x2 + (c1*x + c0);
return mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_4(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4) {
// calculates polynomial c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c2+c3*x)*x2 + ((c0+c1*x) + c4*x4);
return mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0) + c4*x4);
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_4n(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3) {
// calculates polynomial 1*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c2+c3*x)*x2 + ((c0+c1*x) + x4);
return mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0) + x4);
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_5(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5) {
// calculates polynomial c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c2+c3*x)*x2 + ((c4+c5*x)*x4 + (c0+c1*x));
return mul_add(mul_add(c3, x, c2), x2, mul_add(mul_add(c5, x, c4), x4, mul_add(c1, x, c0)));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_5n(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4) {
// calculates polynomial 1*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c2+c3*x)*x2 + ((c4+x)*x4 + (c0+c1*x));
return mul_add(mul_add(c3, x, c2), x2, mul_add(c4 + x, x4, mul_add(c1, x, c0)));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_6(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6) {
// calculates polynomial c6*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c4+c5*x+c6*x2)*x4 + ((c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(c6, x2, mul_add(c5, x, c4)), x4, mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0)));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_6n(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5) {
// calculates polynomial 1*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return (c4+c5*x+x2)*x4 + ((c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(c5, x, c4 + x2), x4, mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0)));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_7(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7) {
// calculates polynomial c7*x^7 + c6*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
//return ((c6+c7*x)*x2 + (c4+c5*x))*x4 + ((c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4, mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0)));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_8(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7, CTYPE c8) {
// calculates polynomial c8*x^8 + c7*x^7 + c6*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
VTYPE x8 = x4 * x4;
//return ((c6+c7*x)*x2 + (c4+c5*x))*x4 + (c8*x8 + (c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4,
mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0) + c8*x8));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_9(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7, CTYPE c8, CTYPE c9) {
// calculates polynomial c9*x^9 + c8*x^8 + c7*x^7 + c6*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
VTYPE x8 = x4 * x4;
//return (((c6+c7*x)*x2 + (c4+c5*x))*x4 + (c8+c9*x)*x8) + ((c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(c9, x, c8), x8, mul_add(
mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4,
mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0))));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_10(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7, CTYPE c8, CTYPE c9, CTYPE c10) {
// calculates polynomial c10*x^10 + c9*x^9 + c8*x^8 + c7*x^7 + c6*x^6 + c5*x^5 + c4*x^4 + c3*x^3 + c2*x^2 + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
VTYPE x8 = x4 * x4;
//return (((c6+c7*x)*x2 + (c4+c5*x))*x4 + (c8+c9*x+c10*x2)*x8) + ((c2+c3*x)*x2 + (c0+c1*x));
return mul_add(mul_add(x2, c10, mul_add(c9, x, c8)), x8,
mul_add(mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4,
mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0))));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_13(VTYPE const x, CTYPE c0, CTYPE c1, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7, CTYPE c8, CTYPE c9, CTYPE c10, CTYPE c11, CTYPE c12, CTYPE c13) {
// calculates polynomial c13*x^13 + c12*x^12 + ... + c1*x + c0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
VTYPE x8 = x4 * x4;
return mul_add(
mul_add(
mul_add(c13, x, c12), x4,
mul_add(mul_add(c11, x, c10), x2, mul_add(c9, x, c8))), x8,
mul_add(
mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4,
mul_add(mul_add(c3, x, c2), x2, mul_add(c1, x, c0))));
}
template<class VTYPE, class CTYPE>
static inline VTYPE polynomial_13m(VTYPE const x, CTYPE c2, CTYPE c3, CTYPE c4, CTYPE c5, CTYPE c6, CTYPE c7, CTYPE c8, CTYPE c9, CTYPE c10, CTYPE c11, CTYPE c12, CTYPE c13) {
// calculates polynomial c13*x^13 + c12*x^12 + ... + x + 0
// VTYPE may be a vector type, CTYPE is a scalar type
VTYPE x2 = x * x;
VTYPE x4 = x2 * x2;
VTYPE x8 = x4 * x4;
// return ((c8+c9*x) + (c10+c11*x)*x2 + (c12+c13*x)*x4)*x8 + (((c6+c7*x)*x2 + (c4+c5*x))*x4 + ((c2+c3*x)*x2 + x));
return mul_add(
mul_add(mul_add(c13, x, c12), x4, mul_add(mul_add(c11, x, c10), x2, mul_add(c9, x, c8))), x8,
mul_add(mul_add(mul_add(c7, x, c6), x2, mul_add(c5, x, c4)), x4, mul_add(mul_add(c3, x, c2), x2, x)));
}
#ifdef VCL_NAMESPACE
}
#endif
#endif
File diff suppressed because it is too large Load Diff
-717
View File
@@ -1,717 +0,0 @@
/**************************** vectormath_hyp.h ******************************
* Author: Agner Fog
* Date created: 2014-07-09
* Last modified: 2022-07-20
* Version: 2.02.00
* Project: vector class library
* Description:
* Header file containing inline vector functions of hyperbolic and inverse
* hyperbolic functions:
* sinh hyperbolic sine
* cosh hyperbolic cosine
* tanh hyperbolic tangent
* asinh inverse hyperbolic sine
* acosh inverse hyperbolic cosine
* atanh inverse hyperbolic tangent
*
* Theory, methods and inspiration based partially on these sources:
* > Moshier, Stephen Lloyd Baluk: Methods and programs for mathematical functions.
* Ellis Horwood, 1989.
* > VDT library developed on CERN by Danilo Piparo, Thomas Hauth and
* Vincenzo Innocente, 2012, https://svnweb.cern.ch/trac/vdt
* > Cephes math library by Stephen L. Moshier 1992,
* http://www.netlib.org/cephes/
*
* For detailed instructions, see vectormath_common.h and vcl_manual.pdf
*
* (c) Copyright 2014-2022 Agner Fog.
* Apache License version 2.0 or later.
******************************************************************************/
#ifndef VECTORMATH_HYP_H
#define VECTORMATH_HYP_H 202
#include "vectormath_exp.h"
#ifdef VCL_NAMESPACE
namespace VCL_NAMESPACE {
#endif
/******************************************************************************
* Hyperbolic functions
******************************************************************************/
// Template for sinh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE sinh_d(VTYPE const x0) {
// The limit of abs(x) is 709.7, as defined by max_x in vectormath_exp.h for 0.5*exp(x).
// Coefficients
const double p0 = -3.51754964808151394800E5;
const double p1 = -1.15614435765005216044E4;
const double p2 = -1.63725857525983828727E2;
const double p3 = -7.89474443963537015605E-1;
const double q0 = -2.11052978884890840399E6;
const double q1 = 3.61578279834431989373E4;
const double q2 = -2.77711081420602794433E2;
const double q3 = 1.0;
// data vectors
VTYPE x, x2, y1, y2;
x = abs(x0);
auto x_small = x <= 1.0; // use Pade approximation if abs(x) <= 1
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x*x;
y1 = polynomial_3(x2, p0, p1, p2, p3) / polynomial_3(x2, q0, q1, q2, q3);
y1 = mul_add(y1, x*x2, x); // y1 = x + x2*(x*y1);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = exp_d<VTYPE, 0, 1>(x); // 0.5 * exp(x)
y2 -= 0.25 / y2; // - 0.5 * exp(-x)
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
// you can avoid the sign_combine by replacing x by x0 above, but at a loss of precision
return y1;
}
// instances of sinh_d template
static inline Vec2d sinh(Vec2d const x) {
return sinh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d sinh(Vec4d const x) {
return sinh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d sinh(Vec8d const x) {
return sinh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for sinh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE sinh_f(VTYPE const x0) {
// The limit of abs(x) is 89.0, as defined by max_x in vectormath_exp.h for 0.5*exp(x).
// Coefficients
const float r0 = 1.66667160211E-1f;
const float r1 = 8.33028376239E-3f;
const float r2 = 2.03721912945E-4f;
// data vectors
VTYPE x, x2, y1, y2;
x = abs(x0);
auto x_small = x <= 1.0f; // use polynomial approximation if abs(x) <= 1
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x*x;
y1 = polynomial_2(x2, r0, r1, r2);
y1 = mul_add(y1, x2*x, x); // y1 = x + x2*(x*y1);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = exp_f<VTYPE, 0, 1>(x); // 0.5 * exp(x)
y2 -= 0.25f / y2; // - 0.5 * exp(-x)
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
// you can avoid the sign_combine by replacing x by x0 above, but at a loss of precision
return y1;
}
// instances of sinh_f template
static inline Vec4f sinh(Vec4f const x) {
return sinh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f sinh(Vec8f const x) {
return sinh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f sinh(Vec16f const x) {
return sinh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for cosh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE cosh_d(VTYPE const x0) {
// The limit of abs(x) is 709.7, as defined by max_x in vectormath_exp.h for 0.5*exp(x).
// data vectors
VTYPE x, y;
x = abs(x0);
y = exp_d<VTYPE, 0, 1>(x); // 0.5 * exp(x)
y += 0.25 / y; // + 0.5 * exp(-x)
return y;
}
// instances of sinh_d template
static inline Vec2d cosh(Vec2d const x) {
return cosh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d cosh(Vec4d const x) {
return cosh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d cosh(Vec8d const x) {
return cosh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for cosh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE cosh_f(VTYPE const x0) {
// The limit of abs(x) is 89.0, as defined by max_x in vectormath_exp.h for 0.5*exp(x).
// data vectors
VTYPE x, y;
x = abs(x0);
y = exp_f<VTYPE, 0, 1>(x); // 0.5 * exp(x)
y += 0.25f / y; // + 0.5 * exp(-x)
return y;
}
// instances of sinh_d template
static inline Vec4f cosh(Vec4f const x) {
return cosh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f cosh(Vec8f const x) {
return cosh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f cosh(Vec16f const x) {
return cosh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for tanh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE tanh_d(VTYPE const x0) {
// Coefficients
const double p0 = -1.61468768441708447952E3;
const double p1 = -9.92877231001918586564E1;
const double p2 = -9.64399179425052238628E-1;
const double q0 = 4.84406305325125486048E3;
const double q1 = 2.23548839060100448583E3;
const double q2 = 1.12811678491632931402E2;
const double q3 = 1.0;
// data vectors
VTYPE x, x2, y1, y2;
x = abs(x0);
auto x_small = x <= 0.625; // use Pade approximation if abs(x) <= 5/8
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x*x;
y1 = polynomial_2(x2, p0, p1, p2) / polynomial_3(x2, q0, q1, q2, q3);
y1 = mul_add(y1, x2*x, x); // y1 = x + x2*(x*y1);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = exp(x+x); // exp(2*x)
y2 = 1.0 - 2.0 / (y2 + 1.0); // tanh(x)
}
auto x_big = x > 350.;
y1 = select(x_small, y1, y2); // choose method
y1 = select(x_big, 1.0, y1); // avoid overflow
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of tanh_d template
static inline Vec2d tanh(Vec2d const x) {
return tanh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d tanh(Vec4d const x) {
return tanh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d tanh(Vec8d const x) {
return tanh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for tanh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE tanh_f(VTYPE const x0) {
// The limit of abs(x) is 89.0, as defined by max_x in vectormath_exp.h for 0.5*exp(x).
// Coefficients
const float r0 = -3.33332819422E-1f;
const float r1 = 1.33314422036E-1f;
const float r2 = -5.37397155531E-2f;
const float r3 = 2.06390887954E-2f;
const float r4 = -5.70498872745E-3f;
// data vectors
VTYPE x, x2, y1, y2;
x = abs(x0);
auto x_small = x <= 0.625f; // use polynomial approximation if abs(x) <= 5/8
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x*x;
y1 = polynomial_4(x2, r0, r1, r2, r3, r4);
y1 = mul_add(y1, x2*x, x); // y1 = x + (x2*x)*y1;
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = exp(x+x); // exp(2*x)
y2 = 1.0f - 2.0f / (y2 + 1.0f); // tanh(x)
}
auto x_big = x > 44.4f;
y1 = select(x_small, y1, y2); // choose method
y1 = select(x_big, 1.0f, y1); // avoid overflow
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of tanh_f template
static inline Vec4f tanh(Vec4f const x) {
return tanh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f tanh(Vec8f const x) {
return tanh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f tanh(Vec16f const x) {
return tanh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
/******************************************************************************
* Inverse hyperbolic functions
******************************************************************************/
// Template for asinh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE asinh_d(VTYPE const x0) {
// Coefficients
const double p0 = -5.56682227230859640450E0;
const double p1 = -9.09030533308377316566E0;
const double p2 = -4.37390226194356683570E0;
const double p3 = -5.91750212056387121207E-1;
const double p4 = -4.33231683752342103572E-3;
const double q0 = 3.34009336338516356383E1;
const double q1 = 6.95722521337257608734E1;
const double q2 = 4.86042483805291788324E1;
const double q3 = 1.28757002067426453537E1;
const double q4 = 1.0;
// data vectors
VTYPE x, x2, y1, y2;
x2 = x0 * x0;
x = abs(x0);
auto x_small = x <= 0.533; // use Pade approximation if abs(x) <= 0.5
// Both methods give the highest error close to 0.5.
// This limit is adjusted for minimum error
auto x_huge = x > 1.E20; // simple approximation, avoid overflow
if (horizontal_or(x_small)) {
// At least one element needs small method
y1 = polynomial_4(x2, p0, p1, p2, p3, p4) / polynomial_4(x2, q0, q1, q2, q3, q4);
y1 = mul_add(y1, x2*x, x); // y1 = x + (x2*x)*y1;
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log(x + sqrt(x2 + 1.0));
if (horizontal_or(x_huge)) {
// At least one element needs huge method to avoid overflow
y2 = select(x_huge, log(x) + VM_LN2, y2);
}
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of asinh_d template
static inline Vec2d asinh(Vec2d const x) {
return asinh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d asinh(Vec4d const x) {
return asinh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d asinh(Vec8d const x) {
return asinh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for asinh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE asinh_f(VTYPE const x0) {
// Coefficients
const float r0 = -1.6666288134E-1f;
const float r1 = 7.4847586088E-2f;
const float r2 = -4.2699340972E-2f;
const float r3 = 2.0122003309E-2f;
// data vectors
VTYPE x, x2, y1, y2;
x2 = x0 * x0;
x = abs(x0);
auto x_small = x <= 0.51f; // use polynomial approximation if abs(x) <= 0.5
auto x_huge = x > 1.E10f; // simple approximation, avoid overflow
if (horizontal_or(x_small)) {
// At least one element needs small method
y1 = polynomial_3(x2, r0, r1, r2, r3);
y1 = mul_add(y1, x2*x, x); // y1 = x + (x2*x)*y1;
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log(x + sqrt(x2 + 1.0f));
if (horizontal_or(x_huge)) {
// At least one element needs huge method to avoid overflow
y2 = select(x_huge, log(x) + (float)VM_LN2, y2);
}
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of asinh_f template
static inline Vec4f asinh(Vec4f const x) {
return asinh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f asinh(Vec8f const x) {
return asinh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f asinh(Vec16f const x) {
return asinh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for acosh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE acosh_d(VTYPE const x0) {
// Coefficients
const double p0 = 1.10855947270161294369E5;
const double p1 = 1.08102874834699867335E5;
const double p2 = 3.43989375926195455866E4;
const double p3 = 3.94726656571334401102E3;
const double p4 = 1.18801130533544501356E2;
const double q0 = 7.83869920495893927727E4;
const double q1 = 8.29725251988426222434E4;
const double q2 = 2.97683430363289370382E4;
const double q3 = 4.15352677227719831579E3;
const double q4 = 1.86145380837903397292E2;
const double q5 = 1.0;
// data vectors
VTYPE x1, y1, y2;
x1 = x0 - 1.0;
auto undef = x0 < 1.0; // result is NAN
auto x_small = x1 < 0.49; // use Pade approximation if abs(x-1) < 0.5
auto x_huge = x1 > 1.E20; // simple approximation, avoid overflow
if (horizontal_or(x_small)) {
// At least one element needs small method
y1 = sqrt(x1) * (polynomial_4(x1, p0, p1, p2, p3, p4) / polynomial_5(x1, q0, q1, q2, q3, q4, q5));
// x < 1 generates NAN
y1 = select(undef, nan_vec<VTYPE>(NAN_HYP), y1);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log(x0 + sqrt(mul_sub(x0,x0,1.0)));
if (horizontal_or(x_huge)) {
// At least one element needs huge method to avoid overflow
y2 = select(x_huge, log(x0) + VM_LN2, y2);
}
}
y1 = select(x_small, y1, y2); // choose method
return y1;
}
// instances of acosh_d template
static inline Vec2d acosh(Vec2d const x) {
return acosh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d acosh(Vec4d const x) {
return acosh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d acosh(Vec8d const x) {
return acosh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for acosh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE acosh_f(VTYPE const x0) {
// Coefficients
const float r0 = 1.4142135263E0f;
const float r1 = -1.1784741703E-1f;
const float r2 = 2.6454905019E-2f;
const float r3 = -7.5272886713E-3f;
const float r4 = 1.7596881071E-3f;
// data vectors
VTYPE x1, y1, y2;
x1 = x0 - 1.0f;
auto undef = x0 < 1.0f; // result is NAN
auto x_small = x1 < 0.49f; // use Pade approximation if abs(x-1) < 0.5
auto x_huge = x1 > 1.E10f; // simple approximation, avoid overflow
if (horizontal_or(x_small)) {
// At least one element needs small method
y1 = sqrt(x1) * polynomial_4(x1, r0, r1, r2, r3, r4);
// x < 1 generates NAN
y1 = select(undef, nan_vec<VTYPE>(NAN_HYP), y1);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log(x0 + sqrt(mul_sub(x0,x0,1.0)));
if (horizontal_or(x_huge)) {
// At least one element needs huge method to avoid overflow
y2 = select(x_huge, log(x0) + (float)VM_LN2, y2);
}
}
y1 = select(x_small, y1, y2); // choose method
return y1;
}
// instances of acosh_f template
static inline Vec4f acosh(Vec4f const x) {
return acosh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f acosh(Vec8f const x) {
return acosh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f acosh(Vec16f const x) {
return acosh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for atanh function, double precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE atanh_d(VTYPE const x0) {
// Coefficients
const double p0 = -3.09092539379866942570E1;
const double p1 = 6.54566728676544377376E1;
const double p2 = -4.61252884198732692637E1;
const double p3 = 1.20426861384072379242E1;
const double p4 = -8.54074331929669305196E-1;
const double q0 = -9.27277618139601130017E1;
const double q1 = 2.52006675691344555838E2;
const double q2 = -2.49839401325893582852E2;
const double q3 = 1.08938092147140262656E2;
const double q4 = -1.95638849376911654834E1;
const double q5 = 1.0;
// data vectors
VTYPE x, x2, y1, y2, y3;
x = abs(x0);
auto x_small = x < 0.5; // use Pade approximation if abs(x) < 0.5
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x * x;
y1 = polynomial_4(x2, p0, p1, p2, p3, p4) / polynomial_5(x2, q0, q1, q2, q3, q4, q5);
y1 = mul_add(y1, x2*x, x);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log((1.0+x)/(1.0-x)) * 0.5;
// check if out of range
y3 = select(x == 1.0, infinite_vec<VTYPE>(), nan_vec<VTYPE>(NAN_HYP));
y2 = select(x >= 1.0, y3, y2);
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of atanh_d template
static inline Vec2d atanh(Vec2d const x) {
return atanh_d(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec4d atanh(Vec4d const x) {
return atanh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec8d atanh(Vec8d const x) {
return atanh_d(x);
}
#endif // MAX_VECTOR_SIZE >= 512
// Template for atanh function, single precision
// This function does not produce denormals
// Template parameters:
// VTYPE: double vector type
template<typename VTYPE>
static inline VTYPE atanh_f(VTYPE const x0) {
// Coefficients
const float r0 = 3.33337300303E-1f;
const float r1 = 1.99782164500E-1f;
const float r2 = 1.46691431730E-1f;
const float r3 = 8.24370301058E-2f;
const float r4 = 1.81740078349E-1f;
// data vectors
VTYPE x, x2, y1, y2, y3;
x = abs(x0);
auto x_small = x < 0.5f; // use polynomial approximation if abs(x) < 0.5
if (horizontal_or(x_small)) {
// At least one element needs small method
x2 = x * x;
y1 = polynomial_4(x2, r0, r1, r2, r3, r4);
y1 = mul_add(y1, x2*x, x);
}
if (!horizontal_and(x_small)) {
// At least one element needs big method
y2 = log((1.0f+x)/(1.0f-x)) * 0.5f;
// check if out of range
y3 = select(x == 1.0f, infinite_vec<VTYPE>(), nan_vec<VTYPE>(NAN_HYP));
y2 = select(x >= 1.0f, y3, y2);
}
y1 = select(x_small, y1, y2); // choose method
y1 = sign_combine(y1, x0); // get original sign
return y1;
}
// instances of atanh_f template
static inline Vec4f atanh(Vec4f const x) {
return atanh_f(x);
}
#if MAX_VECTOR_SIZE >= 256
static inline Vec8f atanh(Vec8f const x) {
return atanh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 256
#if MAX_VECTOR_SIZE >= 512
static inline Vec16f atanh(Vec16f const x) {
return atanh_f(x);
}
#endif // MAX_VECTOR_SIZE >= 512
#ifdef VCL_NAMESPACE
}
#endif
#endif
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+139
View File
@@ -0,0 +1,139 @@
---
Language: Cpp
Standard: c++20
# Indentation
TabWidth: 4
IndentWidth: 4
UseTab: Never
IndentPPDirectives: None
IndentWrappedFunctionNames: false
NamespaceIndentation: None
# Empty lines
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
# Line length
ColumnLimit: 100
# Line endings
DeriveLineEnding: false
LineEnding: LF
# Breaking and Penalties
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
# Spacing and padding
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceAfterLogicalNot: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesBeforeTrailingComments: 1
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeSquareBrackets: false
SpacesInSquareBrackets: false
SpaceBeforeCaseColon: false
# Brace placement
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
Cpp11BracedListStyle: true
# Function definitions
# BreakAfterReturnType: AllDefinitions
AlwaysBreakAfterDefinitionReturnType: All
AttributeMacros:
- __host__
- __device__
- __hostdev__
- __global__
- __forceinline__
- __shared__
- __launch_bounds__
# Alignment
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
# Single line allowances
BinPackParameters: false
BinPackArguments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
# Sorting
IncludeBlocks: Regroup
IncludeIsMainRegex: "$"
IncludeCategories:
- Regex: '^"' # quoted includes
Priority: 1
- Regex: '^<fvdb/' # fvdb includes
Priority: 2
- Regex: '^<nanovdb/' # nanovdb includes
Priority: 3
- Regex: '^<(torch|c10|THC|ATen)/' # torch includes
Priority: 4
- Regex: '^<(thrust|cub|cuda)/' # CCCL includes
Priority: 5
- Regex: '^<(cooperative_groups|cuco|cuda.h|cuda_|device_types|math_constants|nvtx3|cute)' # CUDA includes
Priority: 6
- Regex: '^<.*\..*' # other system includes (e.g. with a '.')
Priority: 7
- Regex: '^<[^.]+' # STL includes (no '.')
Priority: 8
IncludeIsMainSourceRegex: "$"
SortIncludes: true
SortUsingDeclarations: true
+71
View File
@@ -0,0 +1,71 @@
# https://clangd.llvm.org/config
# Apply a config conditionally to all C files
If:
PathMatch: .*\.(c|h)$
---
# Apply a config conditionally to all C++ files
If:
PathMatch: .*\.(c|h)pp
---
# Apply a config conditionally to all CUDA files
If:
PathMatch: .*\.cuh?
CompileFlags:
Add:
- "-x"
- "cuda"
# No error on unknown CUDA versions
- "-Wno-unknown-cuda-version"
# Allow variadic CUDA functions
- "-Xclang=-fcuda-allow-variadic-functions"
Diagnostics:
Suppress:
- "variadic_device_fn"
- "attributes_not_allowed"
- "unknown_cuda_version"
- "unknown_type_name"
- "implicit_return_from_non_void_function"
- "no_template_args_on_forwarding_function"
---
# Tweak the clangd parse settings for all files
CompileFlags:
Add:
# report all errors
- "-ferror-limit=0"
- "-fmacro-backtrace-limit=0"
- "-ftemplate-backtrace-limit=0"
# Skip the CUDA version check
- "--no-cuda-version-check"
Remove:
# remove gcc's -fcoroutines
- -fcoroutines
# remove nvc++ flags unknown to clang
- "-gpu=*"
- "-stdpar*"
# remove nvcc flags unknown to clang
- "-arch*"
- "-gencode*"
- "--generate-code*"
- "-ccbin*"
- "-t=*"
- "--threads*"
- "-Xptxas*"
- "-Xcudafe*"
- "-Xfatbin*"
- "-Xcompiler*"
- "--diag-suppress*"
- "--diag_suppress*"
- "--compiler-options*"
- "--extended-lambda"
- "--expt-extended-lambda"
- "--expt-relaxed-constexpr"
- "-forward-unknown-to-host-compiler"
- "-Werror=cross-execution-space-call"
- "-Werror=all-warnings"
+41
View File
@@ -0,0 +1,41 @@
// File location: openvdb/fvdb/.devcontainer/devcontainer.json
{
// A friendly name for the container configuration shown in VS Code
"name": "FVDB Development Environment",
// Tells VS Code to use Docker Compose to define and run the environment.
// The path is relative to this devcontainer.json file.
"dockerComposeFile": [
"../docker-compose.yml" // Points to openvdb/fvdb/docker-compose.yml
],
// The name of the specific service within the docker-compose.yml file
// that VS Code should connect to.
"service": "fvdb-dev",
// Specifies the default directory VS Code should open *inside* the container.
// Since the docker-compose.yml mounts the host's `openvdb/` directory to `/openvdb`
// in the container, the fvdb code resides at `/openvdb/fvdb`.
"workspaceFolder": "/openvdb/fvdb",
// Extensions to install inside the container's VS Code server
"customizations": {
"vscode": {
"extensions": [
"ms-python.python", // Python language support
"ms-vscode.cpptools", // C/C++ language support
"ms-vscode.cmake-tools", // CMake integration
"ms-azuretools.vscode-docker" // Docker integration (useful for managing containers)
],
"settings": {
"python.defaultInterpreterPath": "/opt/conda/envs/fvdb/bin/python"
}
}
},
// Optional: What to do when the VS Code window is closed.
// "stopCompose" will stop the container(s) defined in the compose file.
// "none" would leave them running.
"shutdownAction": "stopCompose"
}
+106
View File
@@ -0,0 +1,106 @@
name: Building Release Wheels
on:
release:
types: [published, edited]
workflow_dispatch:
jobs:
wheel:
runs-on:
- self-hosted
strategy:
fail-fast: false
matrix:
# support version based on: https://download.pytorch.org/whl/torch/
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
torch-version: [2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0]
cuda-version: ['12.1.1']
exclude:
- torch-version: 2.1.2
python-version: '3.12'
- torch-version: 2.1.1
python-version: '3.12'
- torch-version: 2.1.0
python-version: '3.12'
steps:
- uses: actions/checkout@v2
- name: Generate release_environment.yml
run: |
echo "cp env/release_base_environment.yml release_environment.yml"
cp env/release_base_environment.yml release_environment.yml
echo " - python=${{ matrix.python-version }}" >> release_environment.yml
echo " - pytorch=${{ matrix.torch-version }}" >> release_environment.yml
perl -E '"${{ matrix.cuda-version }}" =~ /^(\d+\.\d+)/; say " - pytorch-cuda=$1"' >> release_environment.yml
perl -E '"${{ matrix.cuda-version }}" =~ /^(\d+)\.(\d+)/; say " - cuda>=$1.$2.0, <$1." . ($2+1) . ".0"' >> release_environment.yml
perl -E '"${{ matrix.cuda-version }}" =~ /^(\d+)\.(\d+)/; say " - cuda-nvcc>=$1.$2.0, <$1." . ($2+1) . ".0"' >> release_environment.yml
- name: Set up fvdb_release Conda env
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
mamba-version: "*"
channels: nvidia,pytorch,conda-forge,defaults
channel-priority: true
activate-environment: fvdb_release
environment-file: release_environment.yml
- name: Set version
run: |
VERSION=`sed -n "s/^__version__ = '\(.*\)'/\1/p" fvdb/__init__.py`
TORCH_VERSION=`echo "pt${{ matrix.torch-version }}" | sed "s/..$//" | sed "s/\.//g"`
CUDA_VERSION=`perl -E '"${{ matrix.cuda-version }}" =~ /^(\d+)\.(\d+)/; say "cu$1$2"'`
echo "New version name: $VERSION+$TORCH_VERSION$CUDA_VERSION"
sed -i "s/$VERSION/$VERSION+$TORCH_VERSION$CUDA_VERSION/" fvdb/__init__.py
shell:
bash -el {0}
- name: Build wheel
run: |
conda activate fvdb_release
mkdir dist
TORCH_CUDA_ARCH_LIST="6.1;7.0;7.5;8.0;8.6+PTX" python setup.py bdist_wheel --dist-dir=dist
shell:
bash -el {0}
- name: Rename wheel
run: |
python scripts/rename_wheels.py ${{ matrix.torch-version }} `perl -E '"${{ matrix.cuda-version }}" =~ /^(\d+)\.(\d+)/; say "cu$1$2"'`
shell:
bash -el {0}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.RELEASE_ACTION_TOKEN }}
files: |
dist/*.whl
# - name: Upload to artifacts
# uses: actions/upload-artifact@v3
# with:
# name: wheels
# path: |
# dist/*.whl
# - name: Configure AWS
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ap-northeast-1
# - name: Upload wheel
# run: |
# aws s3 sync dist s3://nksr/whl/torch-${{ matrix.torch-version }}+${{ matrix.cuda-version }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
- name: Clean Conda
run: |
conda clean -pty
shell:
bash -el {0}
+221
View File
@@ -0,0 +1,221 @@
name: Running Tests
on:
pull_request:
branches: [main]
paths-ignore:
- 'debug/**'
- 'docs/**'
- 'examples/**'
- 'notebooks/**'
- 'scripts/**'
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: write
deployments: write
jobs:
fvdb-build:
if: ${{ !startsWith(github.event.pull_request.title, 'Draft:') }}
name: fVDB Build
runs-on:
- self-hosted
container:
image: aswf/ci-openvdb:2024
env:
PYTHONPATH: ""
options: --rm
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Set up fvdb_build Conda env
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
conda-remove-defaults: "true"
activate-environment: fvdb_build
environment-file: env/build_environment.yml
- name: Buid fvdb
run: |
TORCH_CUDA_ARCH_LIST="7.0;7.5;8.0;8.6+PTX" MAX_JOBS=$(($(nproc) < $(free -g | awk '/^Mem:/{jobs=int($4/2.5); if(jobs<1) jobs=1; print jobs}') ? $(nproc) : $(free -g | awk '/^Mem:/{jobs=int($4/2.5); if(jobs<1) jobs=1; print jobs}'))) conda run --no-capture-output -n fvdb_build python setup.py bdist_wheel --dist-dir=dist
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: fvdb-test-package
path: dist/*.whl
retention-days: 2
- name: Cleanup
if: always()
run: |
echo "Cleaning up /__w/_temp directory"
sudo rm -rf /__w/_temp/*
echo "Cleanup completed"
fvdb-unit-test:
needs: [fvdb-build]
name: fVDB Unit Tests
runs-on:
- self-hosted
container:
image: aswf/ci-openvdb:2024
env:
PYTHONPATH: ""
options: --rm
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Set up fvdb_test Conda env
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
conda-remove-defaults: "true"
activate-environment: fvdb_test
environment-file: env/test_environment.yml
- name: Download package
uses: actions/download-artifact@v4
with:
name: fvdb-test-package
path: ./dist
- name: Install package
run: |
conda activate fvdb_test
pip install ./dist/*.whl
- name: Run tests
run: |
cd tests;
pytest -v unit
- name: Cleanup
if: always()
run: |
echo "Cleaning up /__w/_temp directory"
sudo rm -rf /__w/_temp/*
echo "Cleanup completed"
fvdb-docs-test:
needs: [fvdb-build]
name: fVDB Documentation Tests
runs-on:
- self-hosted
container:
image: aswf/ci-openvdb:2024
env:
PYTHONPATH: ""
options: --rm
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Set up fvdb_test Conda env
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
conda-remove-defaults: "true"
activate-environment: fvdb_test
environment-file: env/test_environment.yml
- name: Download package
uses: actions/download-artifact@v4
with:
name: fvdb-test-package
path: ./dist
- name: Install package
run: |
conda activate fvdb_test
pip install ./dist/*.whl
- name: Run tests
run: |
cd .. && pytest --markdown-docs fvdb/docs
- name: Cleanup
if: always()
run: |
echo "Cleaning up /__w/_temp directory"
sudo rm -rf /__w/_temp/*
echo "Cleanup completed"
fvdb-benchmarks:
needs: [fvdb-build]
name: fVDB Continuous Benchmarking
runs-on:
- self-hosted
container:
image: aswf/ci-openvdb:2024
env:
PYTHONPATH: ""
options: --rm
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: Set up fvdb_test Conda env
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
conda-remove-defaults: "true"
activate-environment: fvdb_test
environment-file: env/test_environment.yml
- name: Download package
uses: actions/download-artifact@v4
with:
name: fvdb-test-package
path: ./dist
- name: Install package
run: |
conda activate fvdb_test
pip install ./dist/*.whl
- name: Disable git ownership verification
run: |
git config --global --add safe.directory "$(pwd)"
- name: Run benchmarks
run: |
cd tests;
pytest benchmark --benchmark-json benchmark/output.json
- name: Store benchmark result
uses: benchmark-action/github-action-benchmark@v1
with:
name: Python Benchmark with pytest-benchmark
tool: 'pytest'
output-file-path: tests/benchmark/output.json
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '200%'
comment-on-alert: true
fail-on-alert: true
alert-comment-cc-users: '@swahtz'
- name: Cleanup
if: always()
run: |
echo "Cleaning up /__w/_temp directory"
sudo rm -rf /__w/_temp/*
echo "Cleanup completed"
+60
View File
@@ -0,0 +1,60 @@
# Generated version file
fvdb/version.py
# Generated compile_commands.json symlink
compile_commands.json
# Build files
/build/*
/src/benchmarks/build/*
/src/tests/build/*
/src/build/*
*.creator
*.includes
*.files
*.config
*.obj
*.off
__pycache__
*.pyc
*.creator.user
*.egg-info
*.so
dist
.cache
.idea
.eggs
cmake-build-debug
external
.polyscope.ini
imgui.ini
datasets/lib/external
datasets/lib/build
*.png
!docs/imgs/**/*.png
!notebooks/img/**/*.png
*.ply
apex/
*.zip
*.npz
!kernel.npz
*.npy
*.o
*.h5
docs/_build
fvdb/include/
trash
scratch
_build
docs/build
*tmp*.py
*.whl
tests/benchmark/data
releases/
/data/
/data/*
!tests/data
.vscode/launch.json
lightning_logs
tests/data/

Some files were not shown because too many files have changed in this diff Show More