Adds a custom bindgen callback that prevents function renames due to macro defines while still linking to the intend function after macro expansion. It does this by tracking macros when generating the bindings, so that it can change the name of the function back to what it was before the macro changed and link to the macro expanded function name. Doing so helps prevents breaking changes across CUDA versions when generating the bindings, and generates function bindings that match those used in Nvidia's CUDA documentation.
misc.: optix-sys rebuilds if related optix environment variables change.
misc.: unpin cc and jobserver from add example.
`register_attr` was removed in favor of `register_tool`. This updates how the nvvm attributes are applied in our proc_macros and how the nvvm backend parses them. Also removes redundant applications of no_std, as cuda_builder applies it to all crates built on the cuda target via rustc flags.
The add example crate now compiles and runs the geneated ptx! :D
This includes several updates to the backend based on changes in
rustc_codegen_llvm, which brings some bug fixes and a refactor to debug
info. This fixes failing dependencies that resolved to newer versions
that failed to build on the previous nightly.
Removes depending on rustc_codegen_llvm as it can't be imported with the
new toolchain for some reason.
The example cuda kernals fail to build. Their dependencies
cause nvvm to abort with ICE.
* Dependencies updated and toolchain updated to a modern version of rust nightly. Had to update the vek, sysinfo, and rayon crates, since they wer pulling in code from dependencies that has long since been broken.
rustc codegen nvvm is still broken, seems to have a number of issues. Once I got Optix installed and setup, I started having trouble with llvm. The build file seems to need llvm-config, which does not ship with precompiled binaries for llvm. I compiled llvm from source, but am still unable to get the build file to find that correctly. There are also a number of regular errors which will need to resolved slowly.
* Dependencies for all crates should be updated to the latest available versions. Going to tackle any breaking changes next
* Two bit flag fields in cust/texture.rs did not implement traits required by the structs they were contained in. This has been resolved
* I both of these files, the field access was replaced with a getter method, which was previously throwing an error
* ArrayObjectFlags needed Debug and PartialEq traits to be derived, was throwing an error before
* updating another file
* removed once_cell as dependency from rustc_codegen_nvvm. The goal was to replace with the standardized version from the std library, but the dependency does not seem to be in use anyway
* wip
* bootstrap enough optix to get ex02 working
* Add example 03
Generate an animated pattern in the raygen and display it in a window using glfw
* add logging callback
* remove ustr
* Manually create OptixShaderBindingTable
field-by-field instead of transmute
* Switch Module and Pipeline methods to their structs
Instead of having them on DeviceContext
* Switch Module, Pipeline, ProgramGroup methods to their structs
Instead of having them on DeviceContext
* Refactor: remove dead imports
* derive DeviceCopy
* typo
* Better error message
* Move destroy to Drop impl
* typo
* rename OptixContext to DeviceContext
* Make launch params variable name optional
* Remove Clone from Module and ProgramGroup
* Make log callback safe
User catch_unwind to guard against panic in C. Remove note about lifetime of
closure since it's 'static anyway. Have set_log_callback return a Result instead
of panicking on error.
* add wip glam support
* dont panic in drop
* Rework DevicePointer on top of CUdeviceptr
This switches out *T for CUdeviceptr in DevicePointer. This has the
knock-on effect of removing a lot of "pretend we're a CPU pointer" stuff
from downstream types like DeviceSlice.
* wip
* bootstrap enough optix to get ex02 working
* Add example 03
Generate an animated pattern in the raygen and display it in a window using glfw
* add logging callback
* remove ustr
* Manually create OptixShaderBindingTable
field-by-field instead of transmute
* Switch Module and Pipeline methods to their structs
Instead of having them on DeviceContext
* Switch Module, Pipeline, ProgramGroup methods to their structs
Instead of having them on DeviceContext
* Refactor: remove dead imports
* derive DeviceCopy
* typo
* Better error message
* Move destroy to Drop impl
* typo
* rename OptixContext to DeviceContext
* Make launch params variable name optional
* Remove Clone from Module and ProgramGroup
* Make log callback safe
User catch_unwind to guard against panic in C. Remove note about lifetime of
closure since it's 'static anyway. Have set_log_callback return a Result instead
of panicking on error.
* add wip glam support
* dont panic in drop
* wip accel support
* Add accel wip
Enough acceleration structure stuff to get example 04 running, and
rebasing on top of deviceptr branch
* Rework acceleration structure stuff
Provide simple internally allocating API for Accel, but also allow
creating one from raw parts to let user handle memory allocation.
Original API kept as free functions and marked unsafe.
Implement all build input types.
Add mint support to cust and optix.
* add lifetime bound on Instance to referenced Accel
* Have DeviceCopy impl for lifetime markers use null type
* Add unsaafe from_handle ctor
* Add update for DynamicAccel
* Hash build inputs to ensure update is sound
* Add relocation info
* Add remaning DeviceContext methods
* Correct docstrings
* Add doc comments
* Add a prelude
* Own the geometry flags array
* Add prelude
* own the geometry flags array and add support for pre_transform
* Fill out context and add some module docs
* Add some module docs
* Update to latest library changes
* Add more docs
* Remove mut requirement for getting pointer
* Add a simple memcpy_htod wrapper
* Add back pointer offset methods
* Big structure reorg and documentation push
- Reorganized the module structure to something less fragmented. Modules
are longer but more cohesive.
- Integrated the optix programming guide inline into the module
documentation.
You need to build the docs with:
RUSTDOCFLAGS="--html-in-header katex-header.html" cargo doc --no-deps
To see the equations (this is done automatically on docs.rs)
* Wrap SBT properly
* Rename transform types
* Simplify AccelBuildOptions creation
Just take a build flags and move everything else to builders
* Hide programming guide in details tags
* Adapt to latest changes
* Fix toolchain version
* Fix name of DeviceContext
* first optix rust test
* Set ALLOW_COMPACTION in build options
* Use find_cuda_helper to get cuda path
* Handle differering enum representation on windows and linux
* Add DeviceVariable
* Add DeviceMemory trait
Abstracts over different device storage representations
* Add mem_get_info
* Add external memory
* Add a few more types to prelude
* Add more types
* Rework on top of new DeviceVariable
* first optix rust test
* tweak build
* update to latest optix changes
* Split DeviceCopy into cust_core
* update to latest optix changes
* trying to get print working
* tweak test kernel
* stop llvm optimizing out LaunchParams
* Chore: update cargo.toml dep versions
* Feat: second pass for fixing conflicts
* Feat: delete as_ptr and as_mut_ptr on DeviceSlice
* Revert "Feat: delete as_ptr and as_mut_ptr on DeviceSlice"
This reverts commit e858fdcaf3.
* Feat: experiment with deleting as_ptr and as_mut_ptr
* Fix issues and warnings
* Chore: run formatting
* Chore: exclude examples from building in CI
* Feat: update changelog with changes, misc changes before merge
Co-authored-by: rdambrosio <rdambrosio016@gmail.com>