Skip to content

rronan/NbodyProblem.cuda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gravity

This is an attempt to compare computation time for different implementation of a (triangular) matrix multiplication task.

The task is a brute force simulation of the nbody problem, thus O(n^2) in time complexity.

3 implementations are compared:

  • nbody_c: implemention in C.
  • nbody_cuda: implementation in Cuda (disclaimer: I'm not a Cuda expert, don't expect this to be well optimized).
  • nbody_pytorch: implementation in Pytorch. GPU acceleration can be deactivated by adding the flag CUDA_VISIBLE_DEVICES= to the commandline.

Rendering is also available.

Install

python setup.py install

Run

python run.py --backend [nbody_c,nbody_cuda,nbody_pytorch,nbody_triton]

Rendering

Computed trajectories are stored in result.data. They can be rendered by adding the flag --render then rendered.

To render previously saved trajectories, run:

python run.py --render path/to/another.data 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •