-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Random number generator as language construct #581
Conversation
No local items - I will continue work here in a couple weeks but alternatively we can discuss with @alkino sooner. Did you have a chance to look at the PR in its current state? macos tests failed because of some homebrew issue. |
The last thing I was doing, was looking into netstim to understand a little better code generation and what can be factored out. I wanted to continue with this task once I finish up a few other items that were waiting for a long time. |
Ok, yes! we wanted to have hand-written netstim cpp code before changing code generation pass! |
This adds parsing and AST tree construction for the new NMODL RANDOM type. See #383
- Added a map holding the distribution functions of all random variables ready for code generation. - Various small fixes and improvements.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #581 +/- ##
==========================================
- Coverage 69.94% 69.57% -0.38%
==========================================
Files 188 190 +2
Lines 25647 25960 +313
==========================================
+ Hits 17939 18061 +122
- Misses 7708 7899 +191
☔ View full report in Codecov by Sentry. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
* First proposal of improvements on C++ generator * reduce number of copies * `CodePrinter::add_text`: * now supports multiple arguments * use it instead of trivial but expensive call to `fmt::format`. * `CodePrinter::add_multi_line`: * rework to work with C++ raw string literals * used it instead of 3 or more consecutive `add_line` * `CodePrinter::start_block`: rename to `push_block` * `CodePrinter::end_block`: rename to pop_block * CodegenCppVisitor::visit_program more visible * Try removing python3-importlib-metadata Co-authored-by: Nicolas Cornu <[email protected]> Co-authored-by: Ioannis Magkanaris <[email protected]> Co-authored-by: Erik Heeren <[email protected]>
* Remove wrapper_printer and target_printer since we only print a single C++ file now for all the backends * Rename C to C++ in multiple places
- Added a map holding the distribution functions of all random variables ready for code generation. - Various small fixes and improvements.
- Reworked the semtantic checking - lots of code generation (but not all)
Logfiles from GitLab pipeline #158851 (:no_entry:) have been uploaded here! Status and direct links: |
Implemented via a different PR. |
As described in #383 this PR introduces a native random type into NMODL based on the
random123
implementation. Having support from random numbers in the language will allow us to drop a lot ofVERBATIM
code and unifies semantics and implementation of random numbers in CoreNEURON (and NEURON) mechanisms.Status
How to test
Look at the unit tests in
test/unit/parser.cpp
.