Skip to content

Erzis900/PSO-CUDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Particle Swarm Optimization algorithm in CUDA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published