-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
1,195 additions
and
819 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
brian2/codegen/runtime/numpy_rt/templates/group_variable_set_conditional.py_
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Phase 1: we compute the indices where the conditional setting is to | ||
# be applied, and to do this we want to vectorise over all the values, | ||
# but we don't want to do the iterate all protocol, so we explicitly | ||
# set the idx to be slice(None) | ||
_vectorisation_idx = _idx = slice(None) | ||
|
||
{% for line in code_lines['condition'] %} | ||
{{line}} | ||
{% endfor %} | ||
|
||
if _cond is True: | ||
_cond = slice(None) | ||
if _cond is False: | ||
_cond = [] | ||
|
||
# Phase 2: having computed _cond, the boolean array of points where | ||
# the setting is to be applied, we want to vectorise over idx being | ||
# only these values. | ||
_vectorisation_idx = _idx = _cond | ||
{% for line in code_lines['statement'] %} | ||
{{line}} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
brian2/codegen/runtime/numpy_rt/templates/state_variable_indexing.py_
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
# ITERATE_ALL { _idx } | ||
|
||
_vectorisation_idx = _idx | ||
_vectorisation_idx = N | ||
|
||
{% for line in code_lines %} | ||
{{line}} | ||
{% endfor %} | ||
_return_values, = _cond.nonzero() | ||
|
||
if _cond is True: | ||
_cond = slice(None) | ||
if _cond is False: | ||
_cond = [] | ||
|
||
# _variable is set in the abstract code, see Group._get_with_code | ||
_return_values = _variable[_cond] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# ITERATE_ALL { _idx } | ||
|
||
_vectorisation_idx = _idx | ||
_vectorisation_idx = N | ||
{% for line in code_lines %} | ||
{{line}} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.