-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move inline overrides of public methods out of header files (#1231)
Fix Python linking errors on some platforms. This appears to be related to the GCC visibility of methods overridden in header files, and is fixed by moving the implementation to the corresponding cpp files. Addresses the Travis CI failure of #1225
- Loading branch information
1 parent
ed0caad
commit 0d1f53f
Showing
7 changed files
with
134 additions
and
86 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include <arbor/symmetric_recipe.hpp> | ||
|
||
namespace arb { | ||
|
||
cell_size_type symmetric_recipe::num_cells() const { | ||
return tiled_recipe_->num_cells() * tiled_recipe_->num_tiles(); | ||
} | ||
|
||
util::unique_any symmetric_recipe::get_cell_description(cell_gid_type i) const { | ||
return tiled_recipe_->get_cell_description(i % tiled_recipe_->num_cells()); | ||
} | ||
|
||
cell_kind symmetric_recipe::get_cell_kind(cell_gid_type i) const { | ||
return tiled_recipe_->get_cell_kind(i % tiled_recipe_->num_cells()); | ||
} | ||
|
||
cell_size_type symmetric_recipe::num_sources(cell_gid_type i) const { | ||
return tiled_recipe_->num_sources(i % tiled_recipe_->num_cells()); | ||
} | ||
|
||
cell_size_type symmetric_recipe::num_targets(cell_gid_type i) const { | ||
return tiled_recipe_->num_targets(i % tiled_recipe_->num_cells()); | ||
} | ||
|
||
// Only function that calls the underlying tile's function on the same gid. | ||
// This is because applying transformations to event generators is not straightforward. | ||
std::vector<event_generator> symmetric_recipe::event_generators(cell_gid_type i) const { | ||
return tiled_recipe_->event_generators(i); | ||
} | ||
|
||
// Take connections_on from the original tile recipe for the cell we are duplicating. | ||
// Transate the source and destination gids | ||
std::vector<cell_connection> symmetric_recipe::connections_on(cell_gid_type i) const { | ||
int n_local = tiled_recipe_->num_cells(); | ||
int n_global = num_cells(); | ||
int offset = (i / n_local) * n_local; | ||
|
||
std::vector<cell_connection> conns = tiled_recipe_->connections_on(i % n_local); | ||
|
||
for (unsigned j = 0; j < conns.size(); j++) { | ||
conns[j].source.gid = (conns[j].source.gid + offset) % n_global; | ||
conns[j].dest.gid = (conns[j].dest.gid + offset) % n_global; | ||
} | ||
return conns; | ||
} | ||
|
||
std::vector<probe_info> symmetric_recipe::get_probes(cell_gid_type i) const { | ||
i %= tiled_recipe_->num_cells(); | ||
return tiled_recipe_->get_probes(i); | ||
} | ||
|
||
std::any symmetric_recipe::get_global_properties(cell_kind ck) const { | ||
return tiled_recipe_->get_global_properties(ck); | ||
}; | ||
|
||
} //namespace arb |