chungheng / neural

Python implementation of a collection of neuron and synapse models
2 stars 1 forks source link

Consider using Numba #23

Closed TK-21st closed 2 years ago

TK-21st commented 2 years ago

Using Numba's code generation implies the following:

  1. users are encouraged to implement kernels assuming data is scalar type. vectorization is given to numba.vectorize
  2. structured arrays are well supported at least for CPU version
  3. all arrays with cuda_array_interface will be supported by the kernels.
  4. wrappers need to be added to wrap methods so that the accessed attributes are exposed as the arguments to the function (e.g. Model.ode, Model.update...).
    • there is numba.jitclass decorator to handle class definitions but it's currently experimental only.
TK-21st commented 2 years ago

Closed by #25