Comments (2)
Ah, so we definitely should improve those docs (PR's welcome and cc'ing @samuelpmish @samuelpmishLLNL).
Lambda's that capture essentially can be thought of as a function that doesn't capture, followed by that passes in the lambda data as the first argument. As a result, the lambda with data requires a marking for enzyme_const, enzyme_dup, enzyme_out, etc.
The example in the doc with c++20 may work if the data in the lambda is a compile time constant, but otherwise you can't push runtime data through a template argument. It is resolvable (like mentioned above), but that specific wrapper would need some modification.
We have been meaning to add better overall syntactic sugar for C++ (akin to the Julia ones https://enzyme.mit.edu/julia which have type wrappers and automatically handle closures/members, etc), but we've recently been distracted by things like auto sparsity :)
from enzyme.
hi @alecjacobson -- I'm a fan of your work on TetWild!
Thanks for finding this mistake. For reference, here's the relevant bit of the documentation if you have any other corrections or contributions. A coworker of mine recently found a small syntax mistake in one of the code snippets on that page, so I should probably fix that one too.
I assumed that stateful lambdas as nontype template args were valid C++20 (unrelated to enzyme), and gcc
agrees but clang
doesn't: https://godbolt.org/z/8xTs8sfTx. Ultimately, clang
's opinion is the only one that counts here!
from enzyme.
Related Issues (20)
- Clarify usage through linking HOT 10
- Failing unittest Enzyme/ReverseMode/gsl_sf_legendre_array_e.ll
- Enzyme C++ sugar for vector input/outputs HOT 2
- Batching for Vector Intrinsics
- Syntax for custom forward rule in C? HOT 4
- How to use enzyme in my makefile? HOT 2
- Compiling with -O{1,2,3} breaks custom rule that works with -O0 HOT 2
- incorrect gradient for if statement HOT 2
- Failure with new c++ sugar
- Enzyme TA expectations/issues HOT 5
- C++ interface TODO list HOT 13
- No pass found for various GSL FFT and Statistics methods
- Enzyme derivatives attempting to free stack allocations HOT 4
- Unexpected Compiler Error in Rust Enzyme Bindings for Forward Autodiff HOT 4
- Enzyme failed to support atomicAdd, atomicCAS, and assert for cuda code HOT 1
- Outstanding nuances in the C++ sugar HOT 1
- Forward Mode Cuda ldg error
- Failing to erase fictitious PHI nodes
- Enzyme warns `freeing without malloc` on allocated pointers
- OpenStack github runners down? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enzyme.