Skip to content
Snippets Groups Projects
Commit 000ee422 authored by Ben Cumming's avatar Ben Cumming Committed by Sam Yates
Browse files

Fix pointer to view conversion for optimized intel kernels (#153)

Bug: `modcc` was generating invalid code when generating optimized kernels.

The optimized kernels use raw pointers instead of views, and the generated code was using view semantics.

* Use appropriate `memory::copy` invocation for the optimized kernel case.
parent 61d6b21d
No related branches found
No related tags found
No related merge requests found
......@@ -136,7 +136,12 @@ CPrinter::CPrinter(Module &m, bool o)
if (m.kind() == moduleKind::density) {
text_.add_line("// add the user-supplied weights for converting from current density");
text_.add_line("// to per-compartment current in nA");
text_.add_line("memory::copy(weights, weights_(0, size()));");
if(optimize_) {
text_.add_line("memory::copy(weights, view(weights_, size()));");
}
else {
text_.add_line("memory::copy(weights, weights_(0, size()));");
}
text_.add_line();
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment