refactor(sysrap): use vendored OptiX Toolkit vector math#399
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors SysRap’s CUDA vector-math support to rely on a vendored, pinned NVIDIA OptiX Toolkit (v1.3.0) vec_math.h, reducing locally maintained duplication while preserving Simphony-specific helper APIs via a small compatibility facade.
Changes:
- Vendor OptiX Toolkit ShaderUtil headers + license text under
third_party/optix-toolkit(pinned to v1.3.0). - Replace the large duplicated vector-math implementation in
sysrap/scuda.hwith a thin facade overOptiXToolkit/ShaderUtil/vec_math.h, keeping Simphony-local helpers. - Extend include paths and installation rules so both SysRap and the CSGOptiX PTX target can include the vendored headers.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| third_party/optix-toolkit/README.md | Documents vendoring scope, upstream pin, and licensing expectations. |
| third_party/optix-toolkit/OptiXToolkit/ShaderUtil/Preprocessor.h | Adds vendored upstream preprocessor helper header used by vec_math.h. |
| third_party/optix-toolkit/LICENSE.txt | Vendors upstream BSD-3-Clause license text for redistribution compliance. |
| sysrap/scuda.h | Replaces duplicated vector math with an OptiX Toolkit facade while keeping Simphony-local helpers. |
| sysrap/CMakeLists.txt | Adds include roots and install rules for the vendored OptiX Toolkit headers/license/readme. |
| CSGOptiX/CMakeLists.txt | Adds OptiX Toolkit include root for the PTX compilation target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Vendor NVIDIA OptiX Toolkit `v1.3.0` ShaderUtil headers under `third_party/optix-toolkit` - Replace the duplicated vector math body in `sysrap/scuda.h` with a small compatibility facade over upstream `vec_math.h` - Preserve Simphony-local helpers and legacy compatibility APIs that are not provided by upstream - Add the OptiX Toolkit include root to SysRap and the CSGOptiX PTX target - Install the vendored headers, README, and BSD-3 license alongside SysRap headers The vendored files are pinned to NVIDIA/optix-toolkit `v1.3.0` (`3b9d3c6d08c884372ffc85270c987d1f5273a985`) and keep the upstream BSD-3-Clause license text. - Byte-compared `vec_math.h`, `Preprocessor.h`, and `LICENSE.txt` against the `v1.3.0` tag
80b4fd4 to
0537015
Compare
Backport NVIDIA optix-toolkit commit 7acd88bc272a23067a36dc396ca835db145882fd to guard CUDA 13-only _16a vector helpers behind CUDART_VERSION >= 13000. Restore the legacy scuda narrowing overloads needed by Simphony on CUDA 12, since the upstream guard also hides adjacent make_float2/make_float3 helpers. Document the exact upstream patch commit in the vendored optix-toolkit README.
Keep the legacy scuda.h behavior by importing otk into global scope by default, but allow newer call sites to define SCUDA_NO_GLOBAL_OTK_USING before including the header to avoid namespace pollution. Qualify scuda.h internal OptiX Toolkit calls so the header compiles in opt-out mode, and keep the narrow legacy make_float2/make_float3 shims available without importing the full otk namespace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v1.3.0ShaderUtil headers underthird_party/optix-toolkitsysrap/scuda.hwith a small compatibility facade over upstreamvec_math.hThe vendored files are pinned to NVIDIA/optix-toolkit
v1.3.0(
3b9d3c6d08c884372ffc85270c987d1f5273a985) and keep the upstream BSD-3-Clause license text.vec_math.h,Preprocessor.h, andLICENSE.txtagainst thev1.3.0tag