Package com.aparapi.internal.writer
Class KernelWriter
- java.lang.Object
-
- com.aparapi.internal.writer.BlockWriter
-
- com.aparapi.internal.writer.KernelWriter
-
public abstract class KernelWriter extends BlockWriter
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String__constantstatic java.lang.String__globalstatic java.lang.String__localstatic java.lang.String__privatestatic java.lang.StringCONSTANT_ANNOTATION_NAMEprivate java.lang.StringcvtBooleanArrayToCharprivate java.lang.StringcvtBooleanArrayToCharStarprivate java.lang.StringcvtBooleanToCharprivate java.lang.StringcvtByteArrayToCharprivate java.lang.StringcvtByteArrayToCharStarprivate java.lang.StringcvtByteToCharprivate java.lang.StringcvtCharArrayToShortprivate java.lang.StringcvtCharArrayToShortStarprivate java.lang.StringcvtCharToShortprivate java.lang.StringcvtDoubleArrayToDoubleprivate java.lang.StringcvtDoubleArrayToDoubleStarprivate java.lang.StringcvtFloatArrayToFloatprivate java.lang.StringcvtFloatArrayToFloatStarprivate java.lang.StringcvtIntArrayToIntprivate java.lang.StringcvtIntArrayToIntStarprivate java.lang.StringcvtLongArrayToLongprivate java.lang.StringcvtLongArrayToLongStarprivate java.lang.StringcvtShortArrayToShortprivate java.lang.StringcvtShortArrayToShortStarprivate EntrypointentryPointprivate static booleanIMPLICIT_PRIVATE_FIELDSWhen declaring a __private struct pointer field, we always omit the "__private" qualifier.static java.util.Map<java.lang.String,java.lang.String>javaToCLIdentifierMapstatic java.lang.StringLOCAL_ANNOTATION_NAME-
Fields inherited from class com.aparapi.internal.writer.BlockWriter
arrayDimMangleSuffix, arrayLengthMangleSuffix, indent
-
-
Constructor Summary
Constructors Constructor Description KernelWriter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringconvertType(java.lang.String _typeDesc, boolean useClassModel, boolean isLocal)These three convert functions are here to perform any type conversion that may be required between Java and OpenCL.private booleanisThis(Instruction instruction)voidwrite(Entrypoint _entryPoint)voidwriteInstruction(Instruction _instruction)voidwriteMethod(InstructionSet.MethodCall _methodCall, ClassModel.ConstantPool.MethodEntry _methodEntry)voidwritePragma(java.lang.String _name, boolean _enable)voidwriteThisRef()static java.lang.StringwriteToString(Entrypoint _entrypoint)-
Methods inherited from class com.aparapi.internal.writer.BlockWriter
convertCast, in, newLine, out, write, write, writeBlock, writeComposite, writeConditional, writeConditional, writeConditionalBranch16, writeGetterBlock, writeln, writeMethodBody, writeSequence
-
-
-
-
Field Detail
-
cvtBooleanToChar
private final java.lang.String cvtBooleanToChar
- See Also:
- Constant Field Values
-
cvtBooleanArrayToCharStar
private final java.lang.String cvtBooleanArrayToCharStar
- See Also:
- Constant Field Values
-
cvtBooleanArrayToChar
private final java.lang.String cvtBooleanArrayToChar
- See Also:
- Constant Field Values
-
cvtByteToChar
private final java.lang.String cvtByteToChar
- See Also:
- Constant Field Values
-
cvtByteArrayToCharStar
private final java.lang.String cvtByteArrayToCharStar
- See Also:
- Constant Field Values
-
cvtByteArrayToChar
private final java.lang.String cvtByteArrayToChar
- See Also:
- Constant Field Values
-
cvtCharToShort
private final java.lang.String cvtCharToShort
- See Also:
- Constant Field Values
-
cvtCharArrayToShortStar
private final java.lang.String cvtCharArrayToShortStar
- See Also:
- Constant Field Values
-
cvtCharArrayToShort
private final java.lang.String cvtCharArrayToShort
- See Also:
- Constant Field Values
-
cvtIntArrayToIntStar
private final java.lang.String cvtIntArrayToIntStar
- See Also:
- Constant Field Values
-
cvtIntArrayToInt
private final java.lang.String cvtIntArrayToInt
- See Also:
- Constant Field Values
-
cvtFloatArrayToFloatStar
private final java.lang.String cvtFloatArrayToFloatStar
- See Also:
- Constant Field Values
-
cvtFloatArrayToFloat
private final java.lang.String cvtFloatArrayToFloat
- See Also:
- Constant Field Values
-
cvtDoubleArrayToDoubleStar
private final java.lang.String cvtDoubleArrayToDoubleStar
- See Also:
- Constant Field Values
-
cvtDoubleArrayToDouble
private final java.lang.String cvtDoubleArrayToDouble
- See Also:
- Constant Field Values
-
cvtLongArrayToLongStar
private final java.lang.String cvtLongArrayToLongStar
- See Also:
- Constant Field Values
-
cvtLongArrayToLong
private final java.lang.String cvtLongArrayToLong
- See Also:
- Constant Field Values
-
cvtShortArrayToShortStar
private final java.lang.String cvtShortArrayToShortStar
- See Also:
- Constant Field Values
-
cvtShortArrayToShort
private final java.lang.String cvtShortArrayToShort
- See Also:
- Constant Field Values
-
IMPLICIT_PRIVATE_FIELDS
private static final boolean IMPLICIT_PRIVATE_FIELDS
When declaring a __private struct pointer field, we always omit the "__private" qualifier. This is because the NVidia OpenCL compiler, at time of writing erroneously complains about explicitly qualifying pointers with __private ("error: field may not be qualified with an address space").- See Also:
- Constant Field Values
-
entryPoint
private Entrypoint entryPoint
-
javaToCLIdentifierMap
public static final java.util.Map<java.lang.String,java.lang.String> javaToCLIdentifierMap
-
__local
public static final java.lang.String __local
- See Also:
- Constant Field Values
-
__global
public static final java.lang.String __global
- See Also:
- Constant Field Values
-
__constant
public static final java.lang.String __constant
- See Also:
- Constant Field Values
-
__private
public static final java.lang.String __private
- See Also:
- Constant Field Values
-
LOCAL_ANNOTATION_NAME
public static final java.lang.String LOCAL_ANNOTATION_NAME
-
CONSTANT_ANNOTATION_NAME
public static final java.lang.String CONSTANT_ANNOTATION_NAME
-
-
Method Detail
-
convertType
public java.lang.String convertType(java.lang.String _typeDesc, boolean useClassModel, boolean isLocal)These three convert functions are here to perform any type conversion that may be required between Java and OpenCL.- Overrides:
convertTypein classBlockWriter- Parameters:
_typeDesc- String in the Java JNI notation, [I, etc- Returns:
- Suitably converted string, "char*", etc
-
writeMethod
public void writeMethod(InstructionSet.MethodCall _methodCall, ClassModel.ConstantPool.MethodEntry _methodEntry) throws CodeGenException
- Overrides:
writeMethodin classBlockWriter- Throws:
CodeGenException
-
isThis
private boolean isThis(Instruction instruction)
-
writePragma
public void writePragma(java.lang.String _name, boolean _enable)
-
write
public void write(Entrypoint _entryPoint) throws CodeGenException
- Specified by:
writein classBlockWriter- Throws:
CodeGenException
-
writeThisRef
public void writeThisRef()
- Overrides:
writeThisRefin classBlockWriter
-
writeInstruction
public void writeInstruction(Instruction _instruction) throws CodeGenException
- Overrides:
writeInstructionin classBlockWriter- Throws:
CodeGenException
-
writeToString
public static java.lang.String writeToString(Entrypoint _entrypoint) throws CodeGenException
- Throws:
CodeGenException
-
-