MCPcopy Create free account
hub / github.com/KhronosGroup/SPIRV-Tools / GetMakeAvailableScope

Function GetMakeAvailableScope

source/val/validate_memory.cpp:256–263  ·  view source on GitHub ↗

Returns the scope ID operand for MakeAvailable memory access with mask at the given operand index. This function is only called for OpLoad, OpStore, OpCopyMemory and OpCopyMemorySized, OpCooperativeMatrixLoadNV, OpCooperativeMatrixStoreNV, OpCooperativeVectorLoadNV, OpCooperativeVectorStoreNV.

Source from the content-addressed store, hash-verified

254// OpCooperativeMatrixStoreNV, OpCooperativeVectorLoadNV,
255// OpCooperativeVectorStoreNV.
256uint32_t GetMakeAvailableScope(const Instruction* inst, uint32_t mask,
257 uint32_t mask_index) {
258 assert(mask & uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR));
259 uint32_t this_bit = uint32_t(spv::MemoryAccessMask::MakePointerAvailableKHR);
260 uint32_t index =
261 mask_index - 1 + MemoryAccessNumWords(mask & (this_bit | (this_bit - 1)));
262 return inst->GetOperandAs<uint32_t>(index);
263}
264
265// This function is only called for OpLoad, OpStore, OpCopyMemory,
266// OpCopyMemorySized, OpCooperativeMatrixLoadNV,

Callers 1

CheckMemoryAccessFunction · 0.85

Calls 1

MemoryAccessNumWordsFunction · 0.85

Tested by

no test coverage detected