Skip to content

LeoTurnell-Ritson/CuBoids

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CuBOIDS

Explorative sandbox for GPU accelerated C and CUDA, with Boids "bird-oid objects" simulation.

Getting Started

Roadmap

  • Structures for BOID representation:
    • x, y, z, dx, dy, dz
  • CUDA Kernel Functions:
    • Get random initialisation of Positions from the CPU in the beginning.
    • GetNeighbours
    • ParallelSort
    • BOID
      • sensory information: near wall or boundary, close BOIDS with their distance/orientation/velocity
      • friendly or predatory behavior? Avoidance or Follow?
  • Data storage for Output:
    • Plain text for now, or binary, nothing fancy.
  • Data display:
    • External Python

The program flowchart

flowchart
    subgraph GPU with CUDA
        direction TB
        GPU_1[Variables]
        subgraph BOID Logic
        GPU_6[basic logic function]
        GPU_2[find_neighbour]
        GPU_3[hashtable]
        GPU_4[sort]
        GPU_5[boundary check]
        GPU_7[FriendOrFoe check]
        end
        GPU_6 --> GPU_2
        GPU_6 --> GPU_5
        GPU_6 --> GPU_7
        GPU_2 --- GPU_3
        GPU_3 --- GPU_4
        GPU_6 --read--> GPU_1
        GPU_6 --update-->GPU_1
    end
    subgraph CPU
        direction TB
        CPU_1[Initalisation]
        CPU_2[Variables]
        CPU_3[save in file]
        CPU_1 --> CPU_2
        CPU_2 --after update-->CPU_3
    end
CPU_2 --initialise--> GPU_1
CPU_2 --get update--> GPU_1
Loading

Class and function overview

classDiagram
    direction LR
    class BOID{
        +float position x, y, z
        +float velocity dx, dy, dz
        +int GridID gx, gy, gz
        +int species
        +boid_logic()
        +check_obstacle()
    }

    note for HashtableLookup "implementation depends if\n functionality is external\n or if BOIDS itself is saved in a grid cell"
    class HashtableLookup{
        
    }
Loading

Aditional Sources

CUDA - Lecture notes and introduction:

BOIDS - Introduction and Logic:

Licence

Distributed under the GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published