Lines Matching refs:p
138 void writeJavaArrayInitialization(const ParameterDefinition& p) const;
141 void writeJavaTestAndSetValid(const ParameterDefinition& p, const string& argsIndex,
143 void writeJavaTestOneValue(const ParameterDefinition& p, const string& argsIndex,
146 void writeJavaVectorComparison(const ParameterDefinition& p) const;
149 void writeJavaAppendOutputToMessage(const ParameterDefinition& p, const string& argsIndex,
151 void writeJavaAppendInputToMessage(const ParameterDefinition& p, const string& actual) const;
153 void writeJavaAppendVectorInputToMessage(const ParameterDefinition& p) const;
154 void writeJavaAppendVectorOutputToMessage(const ParameterDefinition& p) const;
192 for (auto p : permutation.getParams()) { in PermutationWriter() local
193 mAllInputsAndOutputs.push_back(p); in PermutationWriter()
194 if (mFirstInputParam == nullptr && !p->isOutParameter) { in PermutationWriter()
195 mFirstInputParam = p; in PermutationWriter()
203 for (auto p : mAllInputsAndOutputs) { in PermutationWriter() local
204 const string capitalizedRsType = capitalize(p->rsType); in PermutationWriter()
205 const string capitalizedBaseType = capitalize(p->rsBaseType); in PermutationWriter()
209 if (p->mVectorSize != "1") { in PermutationWriter()
253 for (auto p : mAllInputsAndOutputs) { in writeJavaArgumentClass() local
254 bool isFieldArray = !scalar && p->mVectorSize != "1"; in writeJavaArgumentClass()
255 … bool isFloatyField = p->isOutParameter && p->isFloatType && mPermutation.getTest() != "custom"; in writeJavaArgumentClass()
261 *mJava << p->javaBaseType; in writeJavaArgumentClass()
266 *mJava << " " << p->variableName << ";\n"; in writeJavaArgumentClass()
270 if (p->isFloat16Parameter() && !isFloatyField) { in writeJavaArgumentClass()
275 *mJava << " " + p->variableName << "Double;\n"; in writeJavaArgumentClass()
288 for (auto p : mAllInputsAndOutputs) { in writeJavaCheckMethod() local
289 if (!p->isOutParameter) { in writeJavaCheckMethod()
290 writeJavaInputAllocationDefinition(*p); in writeJavaCheckMethod()
294 for (auto p : mAllInputsAndOutputs) { in writeJavaCheckMethod() local
295 if (!p->isOutParameter && !p->smallerParameter.empty()) { in writeJavaCheckMethod()
296 string smallerAlloc = "in" + capitalize(p->smallerParameter); in writeJavaCheckMethod()
297 mJava->indent() << "enforceOrdering(" << smallerAlloc << ", " << p->javaAllocName in writeJavaCheckMethod()
307 for (auto p : mAllInputsAndOutputs) { in writeJavaCheckMethod() local
308 if (!p->isOutParameter) { in writeJavaCheckMethod()
309 mJava->indent() << p->javaAllocName << ".destroy();\n"; in writeJavaCheckMethod()
414 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyScalarMethod() local
415 writeJavaArrayInitialization(*p); in writeJavaVerifyScalarMethod()
416 if (p->mVectorSize != "1" && p->mVectorSize != vectorSize) { in writeJavaVerifyScalarMethod()
418 vectorSize = p->mVectorSize; in writeJavaVerifyScalarMethod()
420 cerr << "Error. Had vector " << vectorSize << " and " << p->mVectorSize << "\n"; in writeJavaVerifyScalarMethod()
436 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyScalarMethod() local
437 if (!p->isOutParameter) { in writeJavaVerifyScalarMethod()
438 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName << "[i"; in writeJavaVerifyScalarMethod()
439 if (p->vectorWidth != "1") { in writeJavaVerifyScalarMethod()
440 *mJava << " * " << p->vectorWidth << " + j"; in writeJavaVerifyScalarMethod()
446 if (p->isFloat16Parameter()) { in writeJavaVerifyScalarMethod()
447 mJava->indent() << "args." << p->doubleVariableName in writeJavaVerifyScalarMethod()
449 << p->variableName << ");\n"; in writeJavaVerifyScalarMethod()
456 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyScalarMethod() local
457 if (p->isOutParameter) { in writeJavaVerifyScalarMethod()
458 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName in writeJavaVerifyScalarMethod()
459 << "[i * " << p->vectorWidth << " + j];\n"; in writeJavaVerifyScalarMethod()
460 if (p->isFloat16Parameter()) { in writeJavaVerifyScalarMethod()
461 mJava->indent() << "args." << p->doubleVariableName in writeJavaVerifyScalarMethod()
463 << p->variableName << ");\n"; in writeJavaVerifyScalarMethod()
490 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyScalarMethod() local
491 if (p->isOutParameter) { in writeJavaVerifyScalarMethod()
492 writeJavaTestAndSetValid(*p, "", "[i * " + p->vectorWidth + " + j]"); in writeJavaVerifyScalarMethod()
503 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyScalarMethod() local
504 if (p->isOutParameter) { in writeJavaVerifyScalarMethod()
505 writeJavaAppendOutputToMessage(*p, "", "[i * " + p->vectorWidth + " + j]", in writeJavaVerifyScalarMethod()
508 writeJavaAppendInputToMessage(*p, "args." + p->variableName); in writeJavaVerifyScalarMethod()
539 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyVectorMethod() local
540 writeJavaArrayInitialization(*p); in writeJavaVerifyVectorMethod()
551 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyVectorMethod() local
552 if (p->mVectorSize != "1") { in writeJavaVerifyVectorMethod()
553 string type = p->javaBaseType; in writeJavaVerifyVectorMethod()
554 if (p->isOutParameter && p->isFloatType) { in writeJavaVerifyVectorMethod()
557 mJava->indent() << "args." << p->variableName << " = new " << type << "[" in writeJavaVerifyVectorMethod()
558 << p->mVectorSize << "];\n"; in writeJavaVerifyVectorMethod()
559 if (p->isFloat16Parameter() && !p->isOutParameter) { in writeJavaVerifyVectorMethod()
560 mJava->indent() << "args." << p->variableName << "Double = new double[" in writeJavaVerifyVectorMethod()
561 << p->mVectorSize << "];\n"; in writeJavaVerifyVectorMethod()
567 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyVectorMethod() local
568 if (!p->isOutParameter) { in writeJavaVerifyVectorMethod()
569 if (p->mVectorSize == "1") { in writeJavaVerifyVectorMethod()
570 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName << "[i]" in writeJavaVerifyVectorMethod()
574 if (p->isFloat16Parameter()) { in writeJavaVerifyVectorMethod()
575 mJava->indent() << "args." << p->doubleVariableName << " = " in writeJavaVerifyVectorMethod()
577 << p->variableName << ");\n"; in writeJavaVerifyVectorMethod()
580 mJava->indent() << "for (int j = 0; j < " << p->mVectorSize << " ; j++)"; in writeJavaVerifyVectorMethod()
582 mJava->indent() << "args." << p->variableName << "[j] = " in writeJavaVerifyVectorMethod()
583 << p->javaArrayName << "[i * " << p->vectorWidth << " + j]" in writeJavaVerifyVectorMethod()
588 if (p->isFloat16Parameter()) { in writeJavaVerifyVectorMethod()
589 mJava->indent() << "args." << p->doubleVariableName << "[j] = " in writeJavaVerifyVectorMethod()
591 << p->variableName << "[j]);\n"; in writeJavaVerifyVectorMethod()
603 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyVectorMethod() local
604 if (p->isOutParameter) { in writeJavaVerifyVectorMethod()
605 writeJavaVectorComparison(*p); in writeJavaVerifyVectorMethod()
615 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyVectorMethod() local
616 if (p->isOutParameter) { in writeJavaVerifyVectorMethod()
617 writeJavaAppendVectorOutputToMessage(*p); in writeJavaVerifyVectorMethod()
619 writeJavaAppendVectorInputToMessage(*p); in writeJavaVerifyVectorMethod()
675 for (auto p : mAllInputsAndOutputs) { in writeJavaVerifyMethodHeader() local
676 *mJava << "Allocation " << p->javaAllocName << ", "; in writeJavaVerifyMethodHeader()
681 void PermutationWriter::writeJavaArrayInitialization(const ParameterDefinition& p) const { in writeJavaArrayInitialization()
682 mJava->indent() << p.javaBaseType << "[] " << p.javaArrayName << " = new " << p.javaBaseType in writeJavaArrayInitialization()
683 << "[INPUTSIZE * " << p.vectorWidth << "];\n"; in writeJavaArrayInitialization()
689 if (p.typeIndex >= 0) { in writeJavaArrayInitialization()
690 mJava->indent() << "Arrays.fill(" << p.javaArrayName << ", (" << TYPES[p.typeIndex].javaType in writeJavaArrayInitialization()
694 mJava->indent() << p.javaAllocName << ".copyTo(" << p.javaArrayName << ");\n"; in writeJavaArrayInitialization()
697 void PermutationWriter::writeJavaTestAndSetValid(const ParameterDefinition& p, in writeJavaTestAndSetValid() argument
700 writeJavaTestOneValue(p, argsIndex, actualIndex); in writeJavaTestAndSetValid()
706 void PermutationWriter::writeJavaTestOneValue(const ParameterDefinition& p, const string& argsIndex, in writeJavaTestOneValue() argument
709 if (p.isFloat16Parameter()) { in writeJavaTestOneValue()
711 actualOut = "Float16Utils.convertFloat16ToDouble(" + p.javaArrayName + actualIndex + ")"; in writeJavaTestOneValue()
713 actualOut = p.javaArrayName + actualIndex; in writeJavaTestOneValue()
717 if (p.isFloatType) { in writeJavaTestOneValue()
718 *mJava << "!args." << p.variableName << argsIndex << ".couldBe(" << actualOut; in writeJavaTestOneValue()
725 *mJava << "args." << p.variableName << argsIndex << " != " << p.javaArrayName in writeJavaTestOneValue()
729 if (p.undefinedIfOutIsNan && mReturnParam) { in writeJavaTestOneValue()
735 void PermutationWriter::writeJavaVectorComparison(const ParameterDefinition& p) const { in writeJavaVectorComparison()
736 if (p.mVectorSize == "1") { in writeJavaVectorComparison()
737 writeJavaTestAndSetValid(p, "", "[i]"); in writeJavaVectorComparison()
739 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaVectorComparison()
741 writeJavaTestAndSetValid(p, "[j]", "[i * " + p.vectorWidth + " + j]"); in writeJavaVectorComparison()
746 void PermutationWriter::writeJavaAppendOutputToMessage(const ParameterDefinition& p, in writeJavaAppendOutputToMessage() argument
751 mJava->indent() << "message.append(\"Output " << p.variableName << ": \");\n"; in writeJavaAppendOutputToMessage()
752 mJava->indent() << "appendVariableToMessage(message, args." << p.variableName << argsIndex in writeJavaAppendOutputToMessage()
755 if (p.isFloat16Parameter()) { in writeJavaAppendOutputToMessage()
757 mJava->indent() << "message.append(\"Output " << p.variableName in writeJavaAppendOutputToMessage()
759 mJava->indent() << "appendVariableToMessage(message, args." << p.doubleVariableName in writeJavaAppendOutputToMessage()
764 mJava->indent() << "message.append(\"Expected output " << p.variableName << ": \");\n"; in writeJavaAppendOutputToMessage()
765 mJava->indent() << "appendVariableToMessage(message, args." << p.variableName << argsIndex in writeJavaAppendOutputToMessage()
769 mJava->indent() << "message.append(\"Actual output " << p.variableName << ": \");\n"; in writeJavaAppendOutputToMessage()
770 mJava->indent() << "appendVariableToMessage(message, " << p.javaArrayName << actualIndex in writeJavaAppendOutputToMessage()
773 if (p.isFloat16Parameter()) { in writeJavaAppendOutputToMessage()
775 mJava->indent() << "message.append(\"Actual output " << p.variableName in writeJavaAppendOutputToMessage()
778 << p.javaArrayName << actualIndex << "));\n"; in writeJavaAppendOutputToMessage()
781 writeJavaTestOneValue(p, argsIndex, actualIndex); in writeJavaAppendOutputToMessage()
789 void PermutationWriter::writeJavaAppendInputToMessage(const ParameterDefinition& p, in writeJavaAppendInputToMessage() argument
791 mJava->indent() << "message.append(\"Input " << p.variableName << ": \");\n"; in writeJavaAppendInputToMessage()
800 void PermutationWriter::writeJavaAppendVectorInputToMessage(const ParameterDefinition& p) const { in writeJavaAppendVectorInputToMessage()
801 if (p.mVectorSize == "1") { in writeJavaAppendVectorInputToMessage()
802 writeJavaAppendInputToMessage(p, p.javaArrayName + "[i]"); in writeJavaAppendVectorInputToMessage()
804 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaAppendVectorInputToMessage()
806 writeJavaAppendInputToMessage(p, p.javaArrayName + "[i * " + p.vectorWidth + " + j]"); in writeJavaAppendVectorInputToMessage()
811 void PermutationWriter::writeJavaAppendVectorOutputToMessage(const ParameterDefinition& p) const { in writeJavaAppendVectorOutputToMessage()
812 if (p.mVectorSize == "1") { in writeJavaAppendVectorOutputToMessage()
813 writeJavaAppendOutputToMessage(p, "", "[i]", false); in writeJavaAppendVectorOutputToMessage()
815 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaAppendVectorOutputToMessage()
817 writeJavaAppendOutputToMessage(p, "[j]", "[i * " + p.vectorWidth + " + j]", false); in writeJavaAppendVectorOutputToMessage()
831 for (auto p : mAllInputsAndOutputs) { in writeJavaCallToRs() local
832 if (p->isOutParameter) { in writeJavaCallToRs()
833 writeJavaOutputAllocationDefinition(*p); in writeJavaCallToRs()
837 for (auto p : mPermutation.getParams()) { in writeJavaCallToRs() local
838 if (p != mFirstInputParam) { in writeJavaCallToRs()
839 mJava->indent() << script << ".set_" << p->rsAllocName << "(" << p->javaAllocName in writeJavaCallToRs()
859 for (auto p : mAllInputsAndOutputs) { in writeJavaCallToRs() local
860 *mJava << p->variableName << ", "; in writeJavaCallToRs()
872 for (auto p : mAllInputsAndOutputs) { in writeJavaCallToRs() local
873 if (p->isOutParameter) { in writeJavaCallToRs()
874 mJava->indent() << p->javaAllocName << ".destroy();\n"; in writeJavaCallToRs()
920 for (auto p : mPermutation.getParams()) { in writeRsSection() local
922 if (p != mFirstInputParam) { in writeRsSection()
923 writeRsAllocationDefinition(*p, rsAllocationsGenerated); in writeRsSection()
951 for (auto p : mPermutation.getParams()) { in writeRsSection() local
952 if (p == mFirstInputParam) { in writeRsSection()
955 mRs->indent() << p->rsType << " " << p->variableName; in writeRsSection()
956 if (p->isOutParameter) { in writeRsSection()
959 *mRs << " = rsGetElementAt_" << p->rsType << "(" << p->rsAllocName << ", x);\n"; in writeRsSection()
973 for (auto p : mPermutation.getParams()) { in writeRsSection() local
977 if (p->isOutParameter) { in writeRsSection()
980 *mRs << p->variableName; in writeRsSection()
987 for (auto p : mPermutation.getParams()) { in writeRsSection() local
988 if (p->isOutParameter) { in writeRsSection()
989 mRs->indent() << "rsSetElementAt_" << p->rsType << "(" << p->rsAllocName << ", "; in writeRsSection()
991 char lastChar = p->variableName.back(); in writeRsSection()
995 *mRs << p->variableName << ", x);\n"; in writeRsSection()