| 8778 | } |
| 8779 | |
| 8780 | void TParseContext::typeParametersCheck(const TSourceLoc& loc, const TPublicType& publicType) |
| 8781 | { |
| 8782 | if (parsingBuiltins) |
| 8783 | return; |
| 8784 | if (publicType.isCoopmatKHR()) { |
| 8785 | if (publicType.typeParameters == nullptr) { |
| 8786 | error(loc, "coopmat missing type parameters", "", ""); |
| 8787 | return; |
| 8788 | } |
| 8789 | switch (publicType.typeParameters->basicType) { |
| 8790 | case EbtFloat: |
| 8791 | case EbtFloat16: |
| 8792 | case EbtBFloat16: |
| 8793 | case EbtFloatE5M2: |
| 8794 | case EbtFloatE4M3: |
| 8795 | case EbtInt: |
| 8796 | case EbtInt8: |
| 8797 | case EbtInt16: |
| 8798 | case EbtUint: |
| 8799 | case EbtUint8: |
| 8800 | case EbtUint16: |
| 8801 | case EbtSpirvType: |
| 8802 | break; |
| 8803 | default: |
| 8804 | error(loc, "coopmat invalid basic type", TType::getBasicString(publicType.typeParameters->basicType), ""); |
| 8805 | break; |
| 8806 | } |
| 8807 | if (publicType.typeParameters->arraySizes->getNumDims() != 4) { |
| 8808 | error(loc, "coopmat incorrect number of type parameters", "", ""); |
| 8809 | return; |
| 8810 | } |
| 8811 | int use = publicType.typeParameters->arraySizes->getDimSize(3); |
| 8812 | if (use < 0 || use > 2) { |
| 8813 | error(loc, "coopmat invalid matrix Use", "", ""); |
| 8814 | return; |
| 8815 | } |
| 8816 | } |
| 8817 | if (publicType.isTensorLayoutNV()) { |
| 8818 | if (publicType.typeParameters == nullptr) { |
| 8819 | error(loc, "tensorLayout missing type parameters", "", ""); |
| 8820 | return; |
| 8821 | } |
| 8822 | if (publicType.typeParameters->arraySizes->getNumDims() > 2) { |
| 8823 | error(loc, "tensorLayout incorrect number of type parameters", "", ""); |
| 8824 | return; |
| 8825 | } |
| 8826 | if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() < 2) { |
| 8827 | while (publicType.typeParameters->arraySizes->getNumDims() < 2) { |
| 8828 | publicType.typeParameters->arraySizes->addInnerSize(0); |
| 8829 | } |
| 8830 | } |
| 8831 | } |
| 8832 | if (publicType.isTensorViewNV()) { |
| 8833 | if (publicType.typeParameters == nullptr) { |
| 8834 | error(loc, "tensorView missing type parameters", "", ""); |
| 8835 | return; |
| 8836 | } |
| 8837 | if (publicType.typeParameters->arraySizes->getNumDims() < 1 || |
no test coverage detected