MicroGPU 1.0
Simple functional model of a GPU for educational purposes
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Warp Class Reference

Represents a GPU warpThe Warp class encapsulates the state and behavior of a GPU warp, including its ID, program counter, threads, active mask, and current instruction. A warp is a group of threads that execute instructions in lockstep. Each warp has 32 threads in this project. To be added: reconvergence stack to handle divergent control flow. More...

#include <warp.hh>

Collaboration diagram for Warp:
Collaboration graph

Public Member Functions

 Warp ()
 
 Warp (int warpId, const ThreadGroup &threadGroup, WarpState warpState=WarpState::READY, PipelineStage pipelineStage=PipelineStage::NOT_STARTED)
 
int getId () const
 
int getPc () const
 
void setPc (int pc_)
 
void setCurrentInstruction (const Instruction &instr)
 
Instruction getCurrentInstruction () const
 
PipelineStage getPipelineStage () const
 
void setPipelineStage (PipelineStage stage)
 
void setActiveMask (const ActiveMask &mask)
 
std::string getPipelineStageString () const
 
const ActiveMaskgetActiveMask () const
 
WarpState getState () const
 

Private Attributes

int id
 
int pc
 
ThreadGroup threads
 
ActiveMask activeMask
 
Instruction currentInstruction
 
std::vector< reconvergencePointreconvergenceStack
 
WarpState state
 
PipelineStage pipelineStage
 

Detailed Description

Represents a GPU warp

The Warp class encapsulates the state and behavior of a GPU warp, including its ID, program counter, threads, active mask, and current instruction. A warp is a group of threads that execute instructions in lockstep. Each warp has 32 threads in this project. To be added: reconvergence stack to handle divergent control flow.

Constructor & Destructor Documentation

◆ Warp() [1/2]

Warp::Warp ( )

◆ Warp() [2/2]

Warp::Warp ( int  warpId,
const ThreadGroup threadGroup,
WarpState  warpState = WarpState::READY,
PipelineStage  pipelineStage = PipelineStage::NOT_STARTED 
)

Member Function Documentation

◆ getActiveMask()

const ActiveMask & Warp::getActiveMask ( ) const

◆ getCurrentInstruction()

Instruction Warp::getCurrentInstruction ( ) const

◆ getId()

int Warp::getId ( ) const

◆ getPc()

int Warp::getPc ( ) const

◆ getPipelineStage()

PipelineStage Warp::getPipelineStage ( ) const
inline

◆ getPipelineStageString()

std::string Warp::getPipelineStageString ( ) const

◆ getState()

WarpState Warp::getState ( ) const
inline

◆ setActiveMask()

void Warp::setActiveMask ( const ActiveMask mask)
inline

◆ setCurrentInstruction()

void Warp::setCurrentInstruction ( const Instruction instr)

◆ setPc()

void Warp::setPc ( int  pc_)

◆ setPipelineStage()

void Warp::setPipelineStage ( PipelineStage  stage)
inline

Member Data Documentation

◆ activeMask

ActiveMask Warp::activeMask
private

◆ currentInstruction

Instruction Warp::currentInstruction
private

◆ id

int Warp::id
private

◆ pc

int Warp::pc
private

◆ pipelineStage

PipelineStage Warp::pipelineStage
private

◆ reconvergenceStack

std::vector<reconvergencePoint> Warp::reconvergenceStack
private

◆ state

WarpState Warp::state
private

◆ threads

ThreadGroup Warp::threads
private

The documentation for this class was generated from the following files: