Skip to content

Commit 38e504d

Browse files
a
1 parent a8a38c4 commit 38e504d

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

source/val/validation_state.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "source/val/construct.h"
3131
#include "source/val/function.h"
3232
#include "spirv-tools/libspirv.h"
33+
#include "spirv/unified1/spirv.hpp11"
3334

3435
namespace spvtools {
3536
namespace val {
@@ -1547,6 +1548,17 @@ bool ValidationState_t::IsTensorType(uint32_t id) const {
15471548
return inst && inst->opcode() == spv::Op::OpTypeTensorARM;
15481549
}
15491550

1551+
// From the spec (SPIRV.html#Concrete)
1552+
bool ValidationState_t::IsConcreteType(uint32_t id) const {
1553+
const Instruction* inst = FindDef(id);
1554+
const spv::Op opcode = inst->opcode();
1555+
1556+
if (opcode == spv::Op::OpTypeInt || opcode == spv::Op::OpTypeFloat) {
1557+
return true;
1558+
}
1559+
return inst && inst->opcode() == spv::Op::OpTypeTensorARM;
1560+
}
1561+
15501562
spv_result_t ValidationState_t::CooperativeMatrixShapesMatch(
15511563
const Instruction* inst, uint32_t result_type_id, uint32_t m2,
15521564
bool is_conversion, bool swap_row_col) {

source/val/validation_state.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,7 @@ class ValidationState_t {
708708
bool IsIntCooperativeVectorNVType(uint32_t id) const;
709709
bool IsUnsignedIntCooperativeVectorNVType(uint32_t id) const;
710710
bool IsTensorType(uint32_t id) const;
711+
bool IsConcreteType(uint32_t id) const;
711712
// When |length| is not 0, return true only if the array length is equal to
712713
// |length| and the array length is not defined by a specialization constant.
713714
bool IsArrayType(uint32_t id, uint64_t length = 0) const;

0 commit comments

Comments
 (0)