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

Function ValidateQuantizeToF16

source/val/validate_conversion.cpp:310–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310spv_result_t ValidateQuantizeToF16(ValidationState_t& _,
311 const Instruction* inst,
312 uint32_t operand_index = 2) {
313 const spv::Op opcode = inst->opcode();
314 const uint32_t result_type = inst->type_id();
315 if ((!_.IsFloatScalarType(result_type) &&
316 !_.IsFloatVectorType(result_type)) ||
317 _.GetBitWidth(result_type) != 32)
318 return _.diag(SPV_ERROR_INVALID_DATA, inst)
319 << "Expected 32-bit float scalar or vector type as Result Type: "
320 << spvOpcodeString(opcode);
321
322 const uint32_t input_type = _.GetOperandTypeId(inst, operand_index);
323 if (input_type != result_type)
324 return _.diag(SPV_ERROR_INVALID_DATA, inst)
325 << "Expected input type to be equal to Result Type: "
326 << spvOpcodeString(opcode);
327 return SPV_SUCCESS;
328}
329
330spv_result_t ValidateConvertPtrToU(ValidationState_t& _,
331 const Instruction* inst,

Callers 1

ConversionPassFunction · 0.85

Calls 8

spvOpcodeStringFunction · 0.85
IsFloatScalarTypeMethod · 0.80
IsFloatVectorTypeMethod · 0.80
GetBitWidthMethod · 0.80
diagMethod · 0.80
GetOperandTypeIdMethod · 0.80
opcodeMethod · 0.45
type_idMethod · 0.45

Tested by

no test coverage detected