Explorative sandbox for GPU accelerated C and CUDA, with Boids "bird-oid objects" simulation.
- 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
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
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{
}
CUDA - Lecture notes and introduction:
- Pennsylvania Lecture plan and slides
- Instrucution set for the Lecture course on CUDA flocking
- Pennsylvania 2022 Lecture introduction
- Pennsylvania Assignment DONE
- caltech lecture with notes
- Pennsylvania hardware setup
- Hardware setup for Linux
BOIDS - Introduction and Logic:
Distributed under the GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.