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 <nicolas.cornu@epfl.ch> Co-authored-by: Ioannis Magkanaris <iomagkanaris@gmail.com> Co-authored-by: Erik Heeren <erik.heeren@epfl.ch>
* 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
random123implementation. Having support from random numbers in the language will allow us to drop a lot ofVERBATIMcode 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.