Pergunta

I'm using Aparapi to program OpenCL from Java.

However I can't find which Aparapi class converts Java byte code into OpenCL kernels. Can you point me at it please?

Foi útil?

Solução

There are a few classes used to convert to OpenCL.

The InstructionSet and ClassModel classes are used to parse the bytecode of the derived Kernel for analysis.

The MethodModel class takes the list of bytecodes for a single method and 'folds' it into a tree data structure suitable for representing higher level constructs (for/while and expressions).

The KernelWriter is the class responsible for 'rendering' the MethodModel to OpenCL.

If you look in the executeOpenCL method of KernelRunner you will see how Aparapi uses these classes to get access to the OpenCL.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top