src/computesim/api

Source   Edit  

Procs

func subgroupBallotBitCount(ballot: UVec4): uint32 {....raises: [], tags: [],
    forbids: [].}
Returns the number of set bits in a ballot value, only counting bits up to gl_SubgroupSize Source   Edit  
func subgroupBallotBitExtract(value: UVec4; index: uint32): bool {....raises: [],
    tags: [], forbids: [].}
Returns true if the bit at position index is set in value Only valid for indices less than gl_SubgroupSize Source   Edit  
func subgroupBallotFindLSB(value: UVec4): uint32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Returns the index of the least significant 1 bit in value Only considers the bottom gl_SubgroupSize bits Source   Edit  
func subgroupBallotFindMSB(value: UVec4): uint32 {.inline, ...raises: [], tags: [],
    forbids: [].}
Returns the index of the most significant 1 bit in value Only considers the bottom gl_SubgroupSize bits Source   Edit  

Templates

template barrier()
Synchronizes all threads within the current workgroup Source   Edit  
template subgroupAdd[T](value: T): T
Returns sum of value across all threads in subgroup Source   Edit  
template subgroupAll(condition: bool): bool
Returns true if condition is true for all active threads Source   Edit  
template subgroupAllEqual[T](value: T): bool
Returns true if value is equal across all active threads in subgroup Source   Edit  
template subgroupAny(condition: bool): bool
Returns true if condition is true for any active thread Source   Edit  
template subgroupBallot(condition: bool): UVec4
Returns bitmap of which threads have condition true Source   Edit  
template subgroupBarrier()
Synchronizes all threads within the current subgroup Source   Edit  
template subgroupBroadcast[T](value: T; id: uint32): T
Broadcasts value from thread with specified id to all threads in subgroup Source   Edit  
template subgroupBroadcastFirst[T](value: T): T
Broadcasts value from first active thread to all threads in subgroup Source   Edit  
template subgroupElect(): bool
Returns true for exactly one active thread in subgroup Source   Edit  
template subgroupExclusiveAdd[T](value: T): T
Returns exclusive prefix sum of value for current thread Source   Edit  
template subgroupInclusiveAdd[T](value: T): T
Returns inclusive prefix sum of value for current thread Source   Edit  
template subgroupMax[T](value: T): T
Returns maximum of value across all threads in subgroup Source   Edit  
template subgroupMin[T](value: T): T
Returns minimum of value across all threads in subgroup Source   Edit  
template subgroupShuffle[T](value: T; id: uint32): T
Returns value from thread with specified id Source   Edit  
template subgroupShuffleDown[T](value: T; delta: uint32): T
Returns value from thread with index current_id + delta Source   Edit  
template subgroupShuffleUp[T](value: T; delta: uint32): T
Returns value from thread with index current_id - delta Source   Edit  
template subgroupShuffleXor[T](value: T; mask: uint32): T
Returns value from thread with id equal to current_id XOR mask Source   Edit