Lines Matching refs:mJava

79     GeneratedFile* mJava;  member in PermutationWriter
181 mJava(javaFile), in PermutationWriter()
250 mJava->indent() << "public class " << name; in writeJavaArgumentClass()
251 mJava->startBlock(); in writeJavaArgumentClass()
257 mJava->indent() << "public "; in writeJavaArgumentClass()
259 *mJava << "Target.Floaty"; in writeJavaArgumentClass()
261 *mJava << p->javaBaseType; in writeJavaArgumentClass()
264 *mJava << "[]"; in writeJavaArgumentClass()
266 *mJava << " " << p->variableName << ";\n"; in writeJavaArgumentClass()
271 mJava->indent() << "public double"; in writeJavaArgumentClass()
273 *mJava << "[]"; in writeJavaArgumentClass()
275 *mJava << " " + p->variableName << "Double;\n"; in writeJavaArgumentClass()
278 mJava->endBlock(); in writeJavaArgumentClass()
279 *mJava << "\n"; in writeJavaArgumentClass()
284 mJava->indent() << "private void " << mJavaCheckMethodName << "()"; in writeJavaCheckMethod()
285 mJava->startBlock(); in writeJavaCheckMethod()
297 mJava->indent() << "enforceOrdering(" << smallerAlloc << ", " << p->javaAllocName in writeJavaCheckMethod()
309 mJava->indent() << p->javaAllocName << ".destroy();\n"; in writeJavaCheckMethod()
313 mJava->endBlock(); in writeJavaCheckMethod()
314 *mJava << "\n"; in writeJavaCheckMethod()
323 mJava->indent() << "Allocation " << param.javaAllocName << " = "; in writeJavaInputAllocationDefinition()
335 *mJava << "createRandomFloatAllocation(mRS, Element.DataType." << dataType << ", " in writeJavaInputAllocationDefinition()
342 *mJava << "createRandomAllocation(mRS, Element.DataType." << dataType << ", " << vectorSize in writeJavaInputAllocationDefinition()
345 *mJava << ";\n"; in writeJavaInputAllocationDefinition()
351 *mJava << "createRandomFloatAllocation" in writeJavaRandomCompatibleFloatAllocation()
375 *mJava << scientific << std::setprecision(19); in writeJavaRandomCompatibleFloatAllocation()
376 *mJava << minValue << ", " << maxValue << ")"; in writeJavaRandomCompatibleFloatAllocation()
377 mJava->unsetf(ios_base::floatfield); in writeJavaRandomCompatibleFloatAllocation()
383 *mJava << "createRandomIntegerAllocation" in writeJavaRandomCompatibleIntegerAllocation()
389 *mJava << (isSigned ? "true" : "false") << ", " << generatedType.significantBits; in writeJavaRandomCompatibleIntegerAllocation()
393 *mJava << (isSigned ? "true" : "false") << ", " in writeJavaRandomCompatibleIntegerAllocation()
396 *mJava << ")"; in writeJavaRandomCompatibleIntegerAllocation()
404 mJava->indent() << "Allocation " << param.javaAllocName << " = Allocation.createSized(mRS, " in writeJavaOutputAllocationDefinition()
411 mJava->startBlock(); in writeJavaVerifyScalarMethod()
425 mJava->indent() << "StringBuilder message = new StringBuilder();\n"; in writeJavaVerifyScalarMethod()
426 mJava->indent() << "boolean errorFound = false;\n"; in writeJavaVerifyScalarMethod()
427 mJava->indent() << "for (int i = 0; i < INPUTSIZE; i++)"; in writeJavaVerifyScalarMethod()
428 mJava->startBlock(); in writeJavaVerifyScalarMethod()
430 mJava->indent() << "for (int j = 0; j < " << vectorSize << " ; j++)"; in writeJavaVerifyScalarMethod()
431 mJava->startBlock(); in writeJavaVerifyScalarMethod()
433 mJava->indent() << "// Extract the inputs.\n"; in writeJavaVerifyScalarMethod()
434 mJava->indent() << mJavaArgumentsClassName << " args = new " << mJavaArgumentsClassName in writeJavaVerifyScalarMethod()
438 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName << "[i"; in writeJavaVerifyScalarMethod()
440 *mJava << " * " << p->vectorWidth << " + j"; in writeJavaVerifyScalarMethod()
442 *mJava << "];\n"; in writeJavaVerifyScalarMethod()
447 mJava->indent() << "args." << p->doubleVariableName in writeJavaVerifyScalarMethod()
455 mJava->indent() << "// Extract the outputs.\n"; in writeJavaVerifyScalarMethod()
458 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName in writeJavaVerifyScalarMethod()
461 mJava->indent() << "args." << p->doubleVariableName in writeJavaVerifyScalarMethod()
467 mJava->indent() << "// Ask the CoreMathVerifier to validate.\n"; in writeJavaVerifyScalarMethod()
471 mJava->indent() << "String errorMessage = CoreMathVerifier." in writeJavaVerifyScalarMethod()
474 *mJava << ", target"; in writeJavaVerifyScalarMethod()
476 *mJava << ");\n"; in writeJavaVerifyScalarMethod()
477 mJava->indent() << "boolean valid = errorMessage == null;\n"; in writeJavaVerifyScalarMethod()
479 mJava->indent() << "// Figure out what the outputs should have been.\n"; in writeJavaVerifyScalarMethod()
483 mJava->indent() << "CoreMathVerifier." << mJavaVerifierComputeMethodName << "(args"; in writeJavaVerifyScalarMethod()
485 *mJava << ", target"; in writeJavaVerifyScalarMethod()
487 *mJava << ");\n"; in writeJavaVerifyScalarMethod()
488 mJava->indent() << "// Validate the outputs.\n"; in writeJavaVerifyScalarMethod()
489 mJava->indent() << "boolean valid = true;\n"; in writeJavaVerifyScalarMethod()
497 mJava->indent() << "if (!valid)"; in writeJavaVerifyScalarMethod()
498 mJava->startBlock(); in writeJavaVerifyScalarMethod()
499 mJava->indent() << "if (!errorFound)"; in writeJavaVerifyScalarMethod()
500 mJava->startBlock(); in writeJavaVerifyScalarMethod()
501 mJava->indent() << "errorFound = true;\n"; in writeJavaVerifyScalarMethod()
512 mJava->indent() << "message.append(errorMessage);\n"; in writeJavaVerifyScalarMethod()
514 mJava->indent() << "message.append(\"Errors at\");\n"; in writeJavaVerifyScalarMethod()
515 mJava->endBlock(); in writeJavaVerifyScalarMethod()
517 mJava->indent() << "message.append(\" [\");\n"; in writeJavaVerifyScalarMethod()
518 mJava->indent() << "message.append(Integer.toString(i));\n"; in writeJavaVerifyScalarMethod()
519 mJava->indent() << "message.append(\", \");\n"; in writeJavaVerifyScalarMethod()
520 mJava->indent() << "message.append(Integer.toString(j));\n"; in writeJavaVerifyScalarMethod()
521 mJava->indent() << "message.append(\"]\");\n"; in writeJavaVerifyScalarMethod()
523 mJava->endBlock(); in writeJavaVerifyScalarMethod()
524 mJava->endBlock(); in writeJavaVerifyScalarMethod()
525 mJava->endBlock(); in writeJavaVerifyScalarMethod()
527 mJava->indent() << "assertFalse(\"Incorrect output for " << mJavaCheckMethodName << "\" +\n"; in writeJavaVerifyScalarMethod()
528 mJava->indentPlus() in writeJavaVerifyScalarMethod()
531 mJava->endBlock(); in writeJavaVerifyScalarMethod()
532 *mJava << "\n"; in writeJavaVerifyScalarMethod()
537 mJava->startBlock(); in writeJavaVerifyVectorMethod()
542 mJava->indent() << "StringBuilder message = new StringBuilder();\n"; in writeJavaVerifyVectorMethod()
543 mJava->indent() << "boolean errorFound = false;\n"; in writeJavaVerifyVectorMethod()
544 mJava->indent() << "for (int i = 0; i < INPUTSIZE; i++)"; in writeJavaVerifyVectorMethod()
545 mJava->startBlock(); in writeJavaVerifyVectorMethod()
547 mJava->indent() << mJavaArgumentsNClassName << " args = new " << mJavaArgumentsNClassName in writeJavaVerifyVectorMethod()
550 mJava->indent() << "// Create the appropriate sized arrays in args\n"; in writeJavaVerifyVectorMethod()
557 mJava->indent() << "args." << p->variableName << " = new " << type << "[" in writeJavaVerifyVectorMethod()
560 mJava->indent() << "args." << p->variableName << "Double = new double[" in writeJavaVerifyVectorMethod()
566 mJava->indent() << "// Fill args with the input values\n"; in writeJavaVerifyVectorMethod()
570 mJava->indent() << "args." << p->variableName << " = " << p->javaArrayName << "[i]" in writeJavaVerifyVectorMethod()
575 mJava->indent() << "args." << p->doubleVariableName << " = " in writeJavaVerifyVectorMethod()
580 mJava->indent() << "for (int j = 0; j < " << p->mVectorSize << " ; j++)"; in writeJavaVerifyVectorMethod()
581 mJava->startBlock(); in writeJavaVerifyVectorMethod()
582 mJava->indent() << "args." << p->variableName << "[j] = " in writeJavaVerifyVectorMethod()
589 mJava->indent() << "args." << p->doubleVariableName << "[j] = " in writeJavaVerifyVectorMethod()
593 mJava->endBlock(); in writeJavaVerifyVectorMethod()
598 mJava->indent() << "CoreMathVerifier." << mJavaVerifierComputeMethodName in writeJavaVerifyVectorMethod()
601 mJava->indent() << "// Compare the expected outputs to the actual values returned by RS.\n"; in writeJavaVerifyVectorMethod()
602 mJava->indent() << "boolean valid = true;\n"; in writeJavaVerifyVectorMethod()
609 mJava->indent() << "if (!valid)"; in writeJavaVerifyVectorMethod()
610 mJava->startBlock(); in writeJavaVerifyVectorMethod()
611 mJava->indent() << "if (!errorFound)"; in writeJavaVerifyVectorMethod()
612 mJava->startBlock(); in writeJavaVerifyVectorMethod()
613 mJava->indent() << "errorFound = true;\n"; in writeJavaVerifyVectorMethod()
622 mJava->indent() << "message.append(\"Errors at\");\n"; in writeJavaVerifyVectorMethod()
623 mJava->endBlock(); in writeJavaVerifyVectorMethod()
625 mJava->indent() << "message.append(\" [\");\n"; in writeJavaVerifyVectorMethod()
626 mJava->indent() << "message.append(Integer.toString(i));\n"; in writeJavaVerifyVectorMethod()
627 mJava->indent() << "message.append(\"]\");\n"; in writeJavaVerifyVectorMethod()
629 mJava->endBlock(); in writeJavaVerifyVectorMethod()
630 mJava->endBlock(); in writeJavaVerifyVectorMethod()
632 mJava->indent() << "assertFalse(\"Incorrect output for " << mJavaCheckMethodName << "\" +\n"; in writeJavaVerifyVectorMethod()
633 mJava->indentPlus() in writeJavaVerifyVectorMethod()
636 mJava->endBlock(); in writeJavaVerifyVectorMethod()
637 *mJava << "\n"; in writeJavaVerifyVectorMethod()
668 mJava->indent() << "Target target = new Target(Target.FunctionType." << in writeJavaCreateTarget()
674 mJava->indent() << "private void " << mJavaVerifyMethodName << "("; in writeJavaVerifyMethodHeader()
676 *mJava << "Allocation " << p->javaAllocName << ", "; in writeJavaVerifyMethodHeader()
678 *mJava << "boolean relaxed)"; in writeJavaVerifyMethodHeader()
682 mJava->indent() << p.javaBaseType << "[] " << p.javaArrayName << " = new " << p.javaBaseType 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()
701 mJava->startBlock(); in writeJavaTestAndSetValid()
702 mJava->indent() << "valid = false;\n"; in writeJavaTestAndSetValid()
703 mJava->endBlock(); in writeJavaTestAndSetValid()
716 mJava->indent() << "if ("; in writeJavaTestOneValue()
718 *mJava << "!args." << p.variableName << argsIndex << ".couldBe(" << actualOut; in writeJavaTestOneValue()
721 *mJava << ", " << s; in writeJavaTestOneValue()
723 *mJava << ")"; in writeJavaTestOneValue()
725 *mJava << "args." << p.variableName << argsIndex << " != " << p.javaArrayName in writeJavaTestOneValue()
730 *mJava << " && !args." << mReturnParam->variableName << argsIndex << ".isNaN()"; in writeJavaTestOneValue()
732 *mJava << ")"; in writeJavaTestOneValue()
739 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaVectorComparison()
740 mJava->startBlock(); in writeJavaVectorComparison()
742 mJava->endBlock(); in writeJavaVectorComparison()
751 mJava->indent() << "message.append(\"Output " << p.variableName << ": \");\n"; in writeJavaAppendOutputToMessage()
752 mJava->indent() << "appendVariableToMessage(message, args." << p.variableName << argsIndex 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()
775 mJava->indent() << "message.append(\"Actual output " << p.variableName in writeJavaAppendOutputToMessage()
777mJava->indent() << "appendVariableToMessage(message, Float16Utils.convertFloat16ToDouble(" in writeJavaAppendOutputToMessage()
782 mJava->startBlock(); in writeJavaAppendOutputToMessage()
783 mJava->indent() << "message.append(\" FAIL\");\n"; in writeJavaAppendOutputToMessage()
784 mJava->endBlock(); in writeJavaAppendOutputToMessage()
791 mJava->indent() << "message.append(\"Input " << p.variableName << ": \");\n"; in writeJavaAppendInputToMessage()
792 mJava->indent() << "appendVariableToMessage(message, " << actual << ");\n"; in writeJavaAppendInputToMessage()
797 mJava->indent() << "message.append(\"\\n\");\n"; in writeJavaAppendNewLineToMessage()
804 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaAppendVectorInputToMessage()
805 mJava->startBlock(); in writeJavaAppendVectorInputToMessage()
807 mJava->endBlock(); in writeJavaAppendVectorInputToMessage()
815 mJava->indent() << "for (int j = 0; j < " << p.mVectorSize << " ; j++)"; in writeJavaAppendVectorOutputToMessage()
816 mJava->startBlock(); in writeJavaAppendVectorOutputToMessage()
818 mJava->endBlock(); in writeJavaAppendVectorOutputToMessage()
828 mJava->indent() << "try"; in writeJavaCallToRs()
829 mJava->startBlock(); in writeJavaCallToRs()
839 mJava->indent() << script << ".set_" << p->rsAllocName << "(" << p->javaAllocName in writeJavaCallToRs()
844 mJava->indent() << script << ".forEach_" << mRsKernelName << "("; in writeJavaCallToRs()
847 *mJava << mFirstInputParam->javaAllocName; in writeJavaCallToRs()
852 *mJava << ", "; in writeJavaCallToRs()
854 *mJava << mReturnParam->variableName << ");\n"; in writeJavaCallToRs()
858 mJava->indent() << mJavaVerifyMethodName << "("; in writeJavaCallToRs()
860 *mJava << p->variableName << ", "; in writeJavaCallToRs()
864 *mJava << "true"; in writeJavaCallToRs()
866 *mJava << "false"; in writeJavaCallToRs()
868 *mJava << ");\n"; in writeJavaCallToRs()
874 mJava->indent() << p->javaAllocName << ".destroy();\n"; in writeJavaCallToRs()
878 mJava->decreaseIndent(); in writeJavaCallToRs()
879 mJava->indent() << "} catch (Exception e) {\n"; in writeJavaCallToRs()
880 mJava->increaseIndent(); in writeJavaCallToRs()
881 mJava->indent() << "throw new RSRuntimeException(\"RenderScript. Can't invoke forEach_" in writeJavaCallToRs()
883 mJava->endBlock(); in writeJavaCallToRs()