Skip to content

Commit

Permalink
Support DrJit 1.0.x (#183)
Browse files Browse the repository at this point in the history
Summary:
- Update drjit to [version 1.0.x](https://github.com/mitsuba-renderer/drjit/releases/tag/v1.0.0) (major version update) and other dependencies (mostly minor and patch version updates)
- Add a workaround for the fact that operator<< for drjit::Packet is not supported (this will be addressed in a follow-up diff in a more elegant way)

## Checklist:

- [ ] Adheres to the [style guidelines](https://facebookincubator.github.io/momentum/docs/developer_guide/style_guide)
- [ ] Codebase formatted by running `pixi run lint`


Test Plan: CI

Reviewed By: EscapeZero

Differential Revision: D68231522

Pulled By: jeongseok-meta
  • Loading branch information
jeongseok-meta authored and facebook-github-bot committed Jan 15, 2025
1 parent 4bfdf17 commit ffccd31
Show file tree
Hide file tree
Showing 5 changed files with 277 additions and 1,787 deletions.
6 changes: 6 additions & 0 deletions momentum/simd/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
#include <Eigen/Core>
#include <Eigen/Geometry>

#define DRJIT_VERSION_GE(major, minor, patch) \
((DRJIT_VERSION_MAJOR > (major)) || \
(DRJIT_VERSION_MAJOR == (major) && DRJIT_VERSION_MINOR > (minor)) || \
(DRJIT_VERSION_MAJOR == (major) && DRJIT_VERSION_MINOR == (minor) && \
DRJIT_VERSION_PATCH >= (patch)))

// Utilities for writing cross-platform SIMD code.
// This currently uses the DrJit library for SIMD primitives.

Expand Down
11 changes: 10 additions & 1 deletion momentum/test/math/simd_generalized_loss_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,20 @@ void testSimdGeneralizedLoss(T alpha, T c, T absTol, T relTol) {
<< "\n - absTol : " << absTol
<< "\n - relTol : " << relTol
<< "\n - stepSize : " << stepSize
#if DRJIT_VERSION_GE(1,0,0)
<< "\n - sqrError : " << drjit::string(sqrError).c_str()
<< "\n - val1 : " << drjit::string(val1).c_str()
<< "\n - val2 : " << drjit::string(val2).c_str()
<< "\n - refDeriv : " << drjit::string(refDeriv).c_str()
<< "\n - testDeriv: " << drjit::string(testDeriv).c_str()
#else
<< "\n - sqrError : " << sqrError
<< "\n - val1 : " << val1
<< "\n - val2 : " << val2
<< "\n - refDeriv : " << refDeriv
<< "\n - testDeriv: " << testDeriv << std::endl;
<< "\n - testDeriv: " << testDeriv
#endif
<< std::endl;
// clang-format off
}

Expand Down
Loading

0 comments on commit ffccd31

Please sign in to comment.