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

Function ValidateGroupWaitEvents

source/val/validate_group.cpp:172–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172spv_result_t ValidateGroupWaitEvents(ValidationState_t& _,
173 const Instruction* inst) {
174 const uint32_t num_events_id = _.GetOperandTypeId(inst, 1);
175 if (!_.IsIntScalarType(num_events_id, 32)) {
176 return _.diag(SPV_ERROR_INVALID_DATA, inst)
177 << "Expected Num Events to be a 32-bit int scalar.";
178 }
179
180 const uint32_t events_id = _.GetOperandTypeId(inst, 2);
181 const Instruction* var_pointer = _.FindDef(events_id);
182 if (var_pointer->opcode() != spv::Op::OpTypePointer) {
183 return _.diag(SPV_ERROR_INVALID_DATA, inst)
184 << "Expected Events List to be a pointer.";
185 }
186 const Instruction* event_list_type =
187 _.FindDef(var_pointer->GetOperandAs<uint32_t>(2));
188 if (event_list_type->opcode() != spv::Op::OpTypeEvent) {
189 return _.diag(SPV_ERROR_INVALID_DATA, inst)
190 << "Expected Events List to be a pointer to OpTypeEvent.";
191 }
192
193 return SPV_SUCCESS;
194}
195
196} // namespace
197

Callers 1

GroupPassFunction · 0.85

Calls 5

GetOperandTypeIdMethod · 0.80
IsIntScalarTypeMethod · 0.80
diagMethod · 0.80
FindDefMethod · 0.80
opcodeMethod · 0.45

Tested by

no test coverage detected