Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.11 KB

README.md

File metadata and controls

52 lines (40 loc) · 1.11 KB

PSO-CUDA

Particle Swarm Optimization algorithm in CUDA. Built on Ubuntu 24.04.

Installation

Use the package manager pip to install numpy, matplotlib and pandas.

pip3 install numpy matplotlib pandas

Building

The project can be built using CMake.

mkdir build
cd build
cmake ..
cmake --build .

Running

You can run the programs by executing their binary files. The binary files take the number of runs as argument. If you want to run the script once, execute:

CPU implementation:

./pso_cpu 1

GPU implementation

./pso_cuda 1

The program will generate a data.csv file which can be used to visualize particles' position in each iteration.

Visualization

You can run

python3 visualize.py

to generate images for maximum number of iterations specified in main.cu. Images will be stored in img.

If you wish to generate less images you can use the -i flag. For example

python3 visualize.py -i 10

will only generate 10 images for first 10 iterations.

License

MIT