|
MicroGPU 1.0
Simple functional model of a GPU for educational purposes
|
Represents a GPU compute unitThe ComputeUnit class encapsulates the state and behavior of a GPU compute unit. It executes Warp objects, which are groups of threads that execute instructions in lockstep. The ComputeUnit manages the scheduling of warps and executes them in simple round-robin fashion. More...
#include <computeUnit.hh>

Public Member Functions | |
| ComputeUnit () | |
| void | setState (SMState newState) |
| void | setCurrentWarpId (int warpId) |
| void | setWarp (const Warp &warp) |
| void | setSmId (int id) |
| void | incrementCycle () |
| void | execute () |
| Execute the current warp and advance its pipeline stage. Called once per cycle. | |
| int | getCurrentWarpId () |
| SMState | getState () const |
| int | getWarpCollectionSize () const |
| int | getCurrentCycle () const |
| int | getSmId () const |
| void | printId () const |
| void | calculateNextWarpId () |
| Method to calculate the next warp ID to execute based on round-robin scheduling. | |
Private Attributes | |
| std::vector< Warp > | warps |
| int | smId |
| size_t | currentWarpId |
| int | currentCycle |
| SMState | state |
Represents a GPU compute unit
The ComputeUnit class encapsulates the state and behavior of a GPU compute unit. It executes Warp objects, which are groups of threads that execute instructions in lockstep. The ComputeUnit manages the scheduling of warps and executes them in simple round-robin fashion.
Each warp can be in one of following pipeline stages:
-> NOT_STARTED, -> STAGE_0, -> STAGE_1, -> STAGE_2, -> STAGE_3, -> DONE.
|
inline |
| void ComputeUnit::calculateNextWarpId | ( | ) |
Method to calculate the next warp ID to execute based on round-robin scheduling.
| void ComputeUnit::execute | ( | ) |
Execute the current warp and advance its pipeline stage. Called once per cycle.

|
inline |
| int ComputeUnit::getCurrentWarpId | ( | ) |
|
inline |
| SMState ComputeUnit::getState | ( | ) | const |
| int ComputeUnit::getWarpCollectionSize | ( | ) | const |
|
inline |
|
inline |
| void ComputeUnit::setCurrentWarpId | ( | int | warpId | ) |
|
inline |
| void ComputeUnit::setState | ( | SMState | newState | ) |
| void ComputeUnit::setWarp | ( | const Warp & | warp | ) |
|
private |
|
private |
|
private |
|
private |
|
private |