OpenCL SNP Simulation
An OpenCL implementation of a simulator for Spiking Neural Systems.
The project uses OpenCL 1.2 libraries on top of C++14.
Limitations
- Non-determenism is not yet supported
- Built-in Environment not yet supported
- This means you have still have to create an "Environment neuron" to simulate an environment
- As an effect, input and output spike train not yet supported
- Tested upto input with 2752 neurons and 4032 rules
Dependencies
This project is hardware dependent so machines with different GPUs have different dependencies.
GENERAL DEPENDENCIES
- Git
- OpenCL ICD Loader
- OpenCL headers
- C++ Boost library
- GNU Make
- GNU g++
- Google re2
MACHINES WITH NVIDIA CARD
- nVidia drivers for the card in your machine
- CUDA SDK
- opencl-nvidia (Needed for execution) - cuda (Note: Nvidia implementation only currently supports OpenCL 1.1)
MACHINES WITH ATI CARD
-
ATI drivers for the card in your machine
-
AMD App SDK
-
opencl-catalyst or opencl-mesa
-
amdapp-sdk
Software Versions
Linux Distributions
- git 2.7.0
- g++ 5.3.0
- boost 1.6.0
- make 4.1
- cuda 8.0
Windows
- git 2.7.0
- g++ 4.8.1
- boost 1.55.0
- cuda 8.0
Installing Dependencies
Arch-Linux and Arch-based Linux Distributions
-
Update repositories
$ sudo pacman -Syu
-
Install packer
$ sudo pacman -S wget expac jshon $ mkdir packer $ cd packer $ sudo wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer $ mv PKGBUILD?h=packer PKGBUILD $ makepkg $ sudo pacman -U packer-*********-*-any.pkg.tar.xz $ cd .. $ sudo rm -dR packer
-
Install gcc
$ sudo pacman -S gcc
-
Install and configure git
$ sudo pacman -S git $ git config --global user.name "your name" $ git config --global user.email your@email.com
-
Install OpenCL headers and ICD Loaders
$ sudo pacman -S ocl-icd opencl-headers
-
Install GPU dependent dependencies
AMD
```bash $ sudo packer -S opencl-catalyst amdapp-sdk ```
NVIDIA
```bash $ sudo pacman -S opencl-nvidia cuda ```
-
Install boost
$ sudo pacman -S boost
-
Install re2
$ sudo pacman -S re2-git
Ubuntu and Ubuntu based systems
-
Update apt repositories
$ sudo apt-get update
-
Install git
$ sudo apt-get install git
-
Install boost
$ sudo apt-get install libboost-all-dev
-
Install boost compute: https://boostorg.github.io/compute/boost_compute/getting_started.html
-
Install google re2 https://github.com/google/re2/wiki/Install
-
Install opencl icd headers
$ sudo apt install ocl-icd-opencl-dev
-
Install AMD App SDK or CUDA SDK
Windows
-
Install the latest driver for your GPU
-
Install and configure git
-
Open git bash
-
Set global variables
> git config --global user.name "your name" > git config --global user.email your@email.com
-
-
Install OpenCL SDK
- For NVIDIA install CUDA SDK
- For AMD install AMD App SDK
-
Install MinGW
- Set destination folder as "C:\MinGW" (default)
- On installer select
- mingw-developer-toolkit
- mingw32-base
- mingw32-gcc-g++
- msys-base
- msys-make (optional)
- Add C:\MinGW\bin to PATH environment variable
-
Download Boost 1.60 for windows then extract to C:\
- Rename folder to boost
- cd into boost folder
``` > cd C:\boost ```
- Build boost
``` > bootsrap mingw > b2 toolset=gcc ````
Building
On Linux Distros
-
CD into project root
-
Build the project using make
$ make
On Windows
-
CD into project root
-
CD into scripts
> cd scripts
-
Run compile.bat
> compile
Running
On Linux Distros
-
cd into bin from project root
$ cd bin
-
For Parallel
$ ./oclsnp <input_binary> [--o output_file] [--txt | --silent]
-
For Linear
$ ./linsnp <input_binary> [--o output_file] [--txt | --silent]
On Windows
-
cd into bin from project root
> cd bin
-
For Parallel
> oclsnp <input_binary>
-
For Linear
> linsnp <input_binary>