-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add Mechanism ABI #1376
Milestone
Comments
halfflat
pushed a commit
that referenced
this issue
Jul 29, 2021
Implements #1376. * Provide a common C linkage ABI for externally compiled mechanisms, for both CPU and GPU. * Remove mechanism type hierarchy (`concrete_mechanism` etc.), and move corresponding functionality to the back-end shared state objects. Mechanism catalogue is no longer indexed by type id. * Distinguish between SIMD optimal alignment and SIMD width with new `min_align` attribute. Mechanisms provide both pieces of information via ABI.
max9901
added a commit
to max9901/arbor
that referenced
this issue
Aug 5, 2021
* Ci/sanitize (arbor-sim#1521) Add clang sanitizer passes to GH CI. * Tutorial structure: remove deduplication, includify (arbor-sim#1575) * added notes re literal_include to python examples * merged changes in arbor-sim#1504 * deduped and includified (arbor-sim#1558) tutorials. * First divergence of tutorial and code spotted! * Added some contrib documentation for examples and docs. * Implement mechanism ABI Implements arbor-sim#1376. * Provide a common C linkage ABI for externally compiled mechanisms, for both CPU and GPU. * Remove mechanism type hierarchy (`concrete_mechanism` etc.), and move corresponding functionality to the back-end shared state objects. Mechanism catalogue is no longer indexed by type id. * Distinguish between SIMD optimal alignment and SIMD width with new `min_align` attribute. Mechanisms provide both pieces of information via ABI. * update spack package to include fmt for [email protected]: (arbor-sim#1609) * alles werkt weer allen smol_dend niet;' * nu werkt het * Docs mechabi (arbor-sim#1610) * Bit of review on the copy of the mech abi docs. * Convert api/abi docs to C Domain directives. * Bug/assorted static analysis (arbor-sim#1615) * Fix failure to return value in `py_mech_cat_value_iterator `. * String butchered by formatting. * Join unnecessary separation of string literals in `arborio/cabelio.cpp` * Add missing throw in s_expr code. * Return value, not reference, in `merge_iterator::operator++(int)`. * Check for self-assignment in `mechanism_catalogue`. * Initialize all members of `mechanism`. * Fix index check order in `multi_event_stream` debug output. * Use coordinator_ from base class in `memory::array`. Co-authored-by: thorstenhater <[email protected]> Co-authored-by: Brent Huisman <[email protected]> Co-authored-by: Ben Cumming <[email protected]>
max9901
added a commit
to max9901/arbor
that referenced
this issue
Aug 9, 2021
* Ci/sanitize (arbor-sim#1521) Add clang sanitizer passes to GH CI. * Tutorial structure: remove deduplication, includify (arbor-sim#1575) * added notes re literal_include to python examples * merged changes in arbor-sim#1504 * deduped and includified (arbor-sim#1558) tutorials. * First divergence of tutorial and code spotted! * Added some contrib documentation for examples and docs. * Implement mechanism ABI Implements arbor-sim#1376. * Provide a common C linkage ABI for externally compiled mechanisms, for both CPU and GPU. * Remove mechanism type hierarchy (`concrete_mechanism` etc.), and move corresponding functionality to the back-end shared state objects. Mechanism catalogue is no longer indexed by type id. * Distinguish between SIMD optimal alignment and SIMD width with new `min_align` attribute. Mechanisms provide both pieces of information via ABI. * update spack package to include fmt for [email protected]: (arbor-sim#1609) * Docs mechabi (arbor-sim#1610) * Bit of review on the copy of the mech abi docs. * Convert api/abi docs to C Domain directives. * Bug/assorted static analysis (arbor-sim#1615) * Fix failure to return value in `py_mech_cat_value_iterator `. * String butchered by formatting. * Join unnecessary separation of string literals in `arborio/cabelio.cpp` * Add missing throw in s_expr code. * Return value, not reference, in `merge_iterator::operator++(int)`. * Check for self-assignment in `mechanism_catalogue`. * Initialize all members of `mechanism`. * Fix index check order in `multi_event_stream` debug output. * Use coordinator_ from base class in `memory::array`. Co-authored-by: thorstenhater <[email protected]> Co-authored-by: Brent Huisman <[email protected]> Co-authored-by: Ben Cumming <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Introduction
Add an extension interface to Arbor in plain C, so that implementors of mechanisms do not need to have access to the internals of Arbor. This pulls in a lot of changes, some of which are in implementation, some still in the planning phase.
The Interface
Here is my current suggestion of how this interface should look like
Changes to Arbor
In the following, I will discuss how this ties into Arbor and what changes from the status quo.
The classes
arb::backend::mechanism
wrapabi_type
and call the relevant interface methods where needed, passingppack
as needed. This quite similar to how it is done now, with some exceptionsppack
is no longer extended through inheritance.ppack
, not only thegpu
kind.ppack
allowed._table
methods have been replaced by plain string arrays (terminated by a NULL string)Upon instantiation of a mechanism, the wrapper will allocate two arrays for bulk storage of data and indices, as well as space for the
ppack
struct. Storage will be aligned according topartition_width
(set by mechanism). Then, the tables will be traversed to allocate and set the pointer members ofppack
, allofwhich are views intoshared_state
or the bulk storage arrays. The main difference is here that the mechanism does not return pointers to the members ofppack
, just the in-order list of items it wishes to access. This comes at the cost of some boilerplate on the ABI implementer's sideAn example might be illustrative here
becomes
which would be exposed to the library as
Status
ppack
to CPU mechanismsClarifications
chunk_size
andpartition_width
:chunk_size
is set by the library to indicate the stride between two array in the bulk storage and may depend onpartition_width
The text was updated successfully, but these errors were encountered: