Brian2CUDA is a Python package for simulating spiking neural networks on graphics processing units (GPUs). It is an extension of the spiking neural network simulator Brian2, which allows flexible model definitions in Python. Brian2CUDA uses the code generation system from Brian2 to generate simulation code in C++/CUDA, which is then executed on NVIDIA GPUs.

To use Brian2CUDA, add the following two lines of code to your Brian2 imports. This will execute your simulations on a GPU:

from brian2 import *
import brian2cuda

For more details on the code generation process and settings, read the Brian2 standalone device documentation.

Getting help and reporting bugs

If you need help with Brian2CUDA, please use the Brian2 discourse forum. If you think you found a bug, please report it in our issue tracker on GitHub.

Citing Brian2CUDA

If you use Brian2CUDA in your work, please cite:

Alevi, D., Stimberg, M., Sprekeler, H., Obermayer, K., & Augustin, M. (2022). Brian2CUDA: flexible and efficient simulation of spiking neural network models on GPUs. Frontiers in Neuroinformatics.