Skip to content
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

Initial code generation for NEURON #1078

Merged
merged 54 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
2ba8a68
Renamed CodegenCppVisitor to CodegenCoreneuronCppVisitor
iomaganaris Sep 24, 2023
992c155
Added NEURON code generator
iomaganaris Sep 24, 2023
fe6d3a8
Create CodegenCppVisitor and use common contructor for CodegenCoreneu…
iomaganaris Sep 24, 2023
ec1996d
Make the CodegenCppVisitor constructors protected
iomaganaris Sep 24, 2023
cb5c267
Initial commit with working distinction between Codegen visitors for …
iomaganaris Sep 24, 2023
0085ce7
Cleaned a bit the CodegenNeuronCppVisitor to generate a cleaner C++ f…
iomaganaris Sep 24, 2023
56694ef
Generate a cleaner C++ file for NEURON
iomaganaris Sep 24, 2023
3f83ea9
Move few common functions in CodegenCppVisitor
iomaganaris Sep 24, 2023
bea8b97
Remove wrapper routing printing function
iomaganaris Sep 25, 2023
5635409
Moving some member variables from codegen(core)neuroncppvisitor to co…
iomaganaris Sep 25, 2023
f7ed94e
Run formatting tool
iomaganaris Sep 25, 2023
88551ac
Some initial changes in NEURON boilerplate
iomaganaris Sep 25, 2023
93fb783
Move variable name printing across neuron and coreneuron codegen & ot…
iomaganaris Sep 26, 2023
54bef9b
Fix instantiation of array state variables
iomaganaris Sep 26, 2023
e011083
Update includes and using declarations
iomaganaris Sep 26, 2023
3ee01c8
Fix printing of float variable macros
iomaganaris Sep 26, 2023
c3afd6d
Some initial work on mechanism reg function
iomaganaris Sep 26, 2023
73fcecf
Initial try to print the initialization of slist1 and dlist1
iomaganaris Sep 26, 2023
e0eef5c
Make format happy
iomaganaris Sep 26, 2023
88b8885
pop_block in reg func
iomaganaris Sep 27, 2023
45e2fe7
Rearrange some function definitions to match old codegen_cpp_visitor
iomaganaris Sep 27, 2023
edfdd71
Sort member functions in CodegenCppVisitor
iomaganaris Sep 27, 2023
86807fc
Initial commit with reorganization of the codegen visitors
iomaganaris Sep 29, 2023
372cfc7
Move setup and visit_program in CodegenCppVisitor
iomaganaris Oct 4, 2023
28d3bb3
Arrange main code printing entry points in codegencppvisitor
iomaganaris Oct 4, 2023
35cd4fc
Rearrange nrn_state and nrn_cur in all codegen visitors
iomaganaris Oct 4, 2023
7a03363
Rearrange main printing routines for code generation in
iomaganaris Oct 4, 2023
6cadfeb
Rearrange code-specific printing routines in CodegenCoreneuronCppVisitor
iomaganaris Oct 4, 2023
9e46d3c
Rearranged Code-specific helper routines in CodegenCoreneuronCppVisitor
iomaganaris Oct 4, 2023
7fbf5b1
Rearranged printing routines for code generation in CodegenCoreneuron…
iomaganaris Oct 4, 2023
6912df2
Rearrange backend specific routines in CoreneuronCodegenCppVisitor
iomaganaris Oct 4, 2023
e686cb7
Rearranged common helper routines in CodegenCoreneuronCppVisitor
iomaganaris Oct 4, 2023
aad333b
Cleared up CodegenNeuronCppVisitor with only related code
iomaganaris Oct 17, 2023
8b70dac
Fix TODO comments
iomaganaris Oct 17, 2023
be5d1be
Organized NeuronCodegenCppVisitor header file same way as CoreNEURON
iomaganaris Oct 17, 2023
41241ee
Made all common functions between neuron and coreneuron codegen virtual
iomaganaris Oct 17, 2023
a18a12f
Fix some more overrides
iomaganaris Oct 17, 2023
4650355
Organized source files the same way
iomaganaris Oct 17, 2023
a274d56
Run formatting
iomaganaris Oct 17, 2023
b4aa867
Integrated changes from master
iomaganaris Oct 17, 2023
a67858d
Added unit test for the code generated for NEURON at the moment
iomaganaris Oct 17, 2023
543efec
Removing unnecessary includes from test
iomaganaris Oct 17, 2023
56561d5
Make format happy
iomaganaris Oct 17, 2023
39ecd86
Improve a bit the CLI options
iomaganaris Oct 18, 2023
64c2a3e
Rename c_backend to cpp_backend
iomaganaris Nov 6, 2023
485db4b
Added missing override
iomaganaris Nov 6, 2023
c09809d
Print NEURON boilerplate in one line
iomaganaris Nov 6, 2023
0b28cd4
Make format happy
iomaganaris Nov 6, 2023
3b1bc4a
Move print_mechanism_info to CodegenCppVisitor since it should be the…
iomaganaris Nov 6, 2023
f352e04
Merge remote-tracking branch 'origin/master' into neuron_nmodl_2
iomaganaris Nov 6, 2023
b2db303
Make format happy
iomaganaris Nov 6, 2023
fdde343
Merge branch 'master' into neuron_nmodl_2
iomaganaris Nov 27, 2023
39a4bc5
Added --cpp flag for C++ code generation
iomaganaris Nov 28, 2023
f3f041d
Merge remote-tracking branch 'origin/master' into neuron_nmodl_2
iomaganaris Nov 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ add_library(
codegen STATIC
codegen_acc_visitor.cpp
codegen_transform_visitor.cpp
codegen_coreneuron_cpp_visitor.cpp
codegen_neuron_cpp_visitor.cpp
codegen_cpp_visitor.cpp
codegen_compatibility_visitor.cpp
codegen_helper_visitor.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/codegen_acc_visitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
void CodegenAccVisitor::print_memory_allocation_routine() const {
// memory for artificial cells should be allocated on CPU
if (info.artificial_cell) {
CodegenCppVisitor::print_memory_allocation_routine();
CodegenCoreneuronCppVisitor::print_memory_allocation_routine();

Check warning on line 87 in src/codegen/codegen_acc_visitor.cpp

View check run for this annotation

Codecov / codecov/patch

src/codegen/codegen_acc_visitor.cpp#L87

Added line #L87 was not covered by tests
ohm314 marked this conversation as resolved.
Show resolved Hide resolved
return;
}
printer->add_newline(2);
Expand Down
8 changes: 4 additions & 4 deletions src/codegen/codegen_acc_visitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* \brief \copybrief nmodl::codegen::CodegenAccVisitor
*/

#include "codegen/codegen_cpp_visitor.hpp"
#include "codegen/codegen_coreneuron_cpp_visitor.hpp"


namespace nmodl {
Expand All @@ -27,7 +27,7 @@
* \class CodegenAccVisitor
* \brief %Visitor for printing C++ code with OpenACC backend
*/
class CodegenAccVisitor: public CodegenCppVisitor {
class CodegenAccVisitor: public CodegenCoreneuronCppVisitor {
protected:
/// name of the code generation backend
std::string backend_name() const override;
Expand Down Expand Up @@ -140,13 +140,13 @@
const std::string& output_dir,
const std::string& float_type,
bool optimize_ionvar_copies)
: CodegenCppVisitor(mod_file, output_dir, float_type, optimize_ionvar_copies) {}
: CodegenCoreneuronCppVisitor(mod_file, output_dir, float_type, optimize_ionvar_copies) {}

Check warning on line 143 in src/codegen/codegen_acc_visitor.hpp

View check run for this annotation

Codecov / codecov/patch

src/codegen/codegen_acc_visitor.hpp#L143

Added line #L143 was not covered by tests

CodegenAccVisitor(const std::string& mod_file,
std::ostream& stream,
const std::string& float_type,
bool optimize_ionvar_copies)
: CodegenCppVisitor(mod_file, stream, float_type, optimize_ionvar_copies) {}
: CodegenCoreneuronCppVisitor(mod_file, stream, float_type, optimize_ionvar_copies) {}
};

/** \} */ // end of codegen_backends
Expand Down
Loading
Loading