public class KernelRunner extends KernelRunnerJNI
Kernel
implementations. KernelRunner
is the real workhorse for Aparapi. Each Kernel
instance creates a single
KernelRunner
to encapsulate state and to help coordinate interactions between the Kernel
and it's execution logic.KernelRunner
is created lazily as a result of calling Kernel.execute()
. A this
time the ExecutionMode
is consulted to determine the default requested mode. This will dictate how
the KernelRunner
will attempt to execute the Kernel
Kernel.execute(int _globalSize)
Modifier and Type | Field and Description |
---|---|
static boolean |
BINARY_CACHING_DISABLED |
static int |
CANCEL_STATUS_FALSE |
static int |
CANCEL_STATUS_TRUE |
static int |
PASS_ID_COMPLETED_EXECUTION |
static int |
PASS_ID_PREPARING_EXECUTION |
Constructor and Description |
---|
KernelRunner(Kernel _kernel)
Create a KernelRunner for a specific Kernel instance.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelMultiPass() |
void |
cleanUpArrays() |
void |
dispose()
Kernel.dispose() delegates to KernelRunner.dispose() which delegates to disposeJNI() to actually close JNI data structures. |
Kernel |
execute(String _entrypoint,
Range _range,
int _passes) |
void |
get(Object array)
Enqueue a request to return this array from the GPU.
|
int |
getCancelState() |
int |
getCurrentPass()
Returns the index of the current pass, or one of two special constants with negative values to indicate special progress states.
|
List<ProfileInfo> |
getProfileInfo() |
boolean |
isExecuting()
True while any of the
execute() methods are in progress. |
boolean |
isExplicit() |
void |
put(Object array)
Tag this array so that it is explicitly enqueued before the kernel is executed.
|
void |
setExplicit(boolean _explicit) |
String |
toString() |
public static boolean BINARY_CACHING_DISABLED
public static final int PASS_ID_PREPARING_EXECUTION
getCurrentPass()
,
Constant Field Valuespublic static final int PASS_ID_COMPLETED_EXECUTION
getCurrentPass()
,
Constant Field Valuespublic static final int CANCEL_STATUS_FALSE
public static final int CANCEL_STATUS_TRUE
public KernelRunner(Kernel _kernel)
_kernel
- public void cleanUpArrays()
Kernel.cleanUpArrays().
public void dispose()
Kernel.dispose()
delegates to KernelRunner.dispose()
which delegates to disposeJNI()
to actually close JNI data structures.KernelRunnerJNI.disposeJNI(long)
public int getCancelState()
public void cancelMultiPass()
public int getCurrentPass()
PASS_ID_PREPARING_EXECUTION
to indicate that the Kernel has started executing but not reached the initial pass, or
PASS_ID_COMPLETED_EXECUTION
to indicate that execution is complete (possibly due to early termination via cancelMultiPass()
), i.e. the Kernel
is idle. PASS_ID_COMPLETED_EXECUTION
is also returned before the first execution has been invoked.
This can be used, for instance, to update a visual progress bar.
execute(String, Range, int)
public boolean isExecuting()
execute()
methods are in progress.public void get(Object array)
Kernel.put(type [])
calls will delegate to this call.
array
- It is assumed that this parameter is indeed an array (of int, float, short etc).Kernel.get(int[] arr)
,
Kernel.get(float[] arr)
,
Kernel.get(double[] arr)
,
Kernel.get(long[] arr)
,
Kernel.get(char[] arr)
,
Kernel.get(boolean[] arr)
public List<ProfileInfo> getProfileInfo()
public void put(Object array)
Kernel.put(type [])
calls will delegate to this call. array
- It is assumed that this parameter is indeed an array (of int, float, short etc).Kernel.put(int[] arr)
,
Kernel.put(float[] arr)
,
Kernel.put(double[] arr)
,
Kernel.put(long[] arr)
,
Kernel.put(char[] arr)
,
Kernel.put(boolean[] arr)
public void setExplicit(boolean _explicit)
public boolean isExplicit()
Copyright © 2016 Syncleus. All rights reserved.