Package civitas.celestis.gpu
Class KernelReference
java.lang.Object
civitas.celestis.gpu.KernelReference
A reference object to a GPU kernel. This object is handed out to external
classes by the
GPU interface in order to provide an object-oriented
interface for handling GPU kernel operations.-
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes this reference.execute(long workSize) Executes this kernel.readOutput(int i, double[] out) Reads the output of this kernel to an array ofdoubles.setInput(int i, double value) Sets theith parameter as an input.setInput(int i, double[] value) Sets theith parameter as an input.setOutput(int i, double[] out) Sets theith parameter as an output.
-
Method Details
-
setInput
Sets theith parameter as an input.- Parameters:
i- The index of the parameter to setvalue- The value to use as input- Returns:
- A reference to itself (
this)
-
setInput
Sets theith parameter as an input.- Parameters:
i- The index of the parameter to setvalue- The value to use as input- Returns:
- A reference to itself (
this)
-
setOutput
Sets theith parameter as an output.- Parameters:
i- The index of the parameter to setout- The array to use as output- Returns:
- A reference to itself (
this)
-
execute
Executes this kernel. The work size is the number of elements the input and output arrays contain.- Parameters:
workSize- The work size of this kernel (the input and output arrays' length)- Returns:
- A reference to itself (
this)
-
readOutput
Reads the output of this kernel to an array ofdoubles.- Parameters:
i- The index of the argument to readout- The output array- Returns:
- A reference to itself (
this)
-
dispose
public void dispose()Disposes this reference. The reference to the kernel will be lost.
-