Package com.aparapi
Class ProfileReport
- java.lang.Object
-
- com.aparapi.ProfileReport
-
public final class ProfileReport extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private long[]
currentTimes
private Device
device
private long
id
private java.lang.Class<? extends Kernel>
kernelClass
private static double
MILLION
private static int
NUM_EVENTS
private java.lang.String[]
stagesNames
private long
threadId
-
Constructor Summary
Constructors Constructor Description ProfileReport(long _threadId, java.lang.Class<? extends Kernel> clazz, Device _device)
Creates a profile report pertaining to a given thread that executed kernel class on the specified device.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProfileReport
clone()
double
getConversionTime()
Determine the time taken to convert bytecode to OpenCL for first Kernel.execute(range) call.Device
getDevice()
Retrieves the Aparapi device where the kernel was executed, producing this profile report.double
getElapsedTime(int stage)
Elapsed time for a single event only, i.e.double
getElapsedTime(int from, int to)
Elapsed time for all eventsfrom
throughto
.double
getExecutionTime()
Determine the execution time of the Kernel.execute(range) call from this report.java.lang.Class<? extends Kernel>
getKernelClass()
Retrieves the class of the kernel to which this profile report pertains toint
getNumberOfStages()
The number of stages available with report data.long
getReportId()
Retrieves the current report unique identifier.
Note: The identifier is monotonically incremented at each new report for the currenttuple. java.lang.String
getStageName(int stage)
Get the name of a given stagejava.util.List<java.lang.String>
getStageNames()
Get the names of the stages for which data was collected.long
getThreadId()
Retrieves the thread id of the thread that executed the kernel, producing this profile report.void
setProfileReport(long reportId, long[] _currentTimes)
Sets specific report data.
-
-
-
Field Detail
-
NUM_EVENTS
private static final int NUM_EVENTS
-
MILLION
private static final double MILLION
- See Also:
- Constant Field Values
-
id
private long id
-
kernelClass
private final java.lang.Class<? extends Kernel> kernelClass
-
threadId
private final long threadId
-
device
private final Device device
-
currentTimes
private final long[] currentTimes
-
stagesNames
private final java.lang.String[] stagesNames
-
-
Constructor Detail
-
ProfileReport
public ProfileReport(long _threadId, java.lang.Class<? extends Kernel> clazz, Device _device)
Creates a profile report pertaining to a given thread that executed kernel class on the specified device.- Parameters:
_threadId
- the id of thread that executed the kernelclazz
- the class of the executed kernel_device
- the device where the kernel executed
-
-
Method Detail
-
setProfileReport
public void setProfileReport(long reportId, long[] _currentTimes)
Sets specific report data.- Parameters:
reportId
- the unique identifier for this report (the identifier is unique within thetuple) _currentTimes
- the profiling data
-
getReportId
public long getReportId()
Retrieves the current report unique identifier.
Note: The identifier is monotonically incremented at each new report for the currenttuple. - Returns:
- the report id
-
getThreadId
public long getThreadId()
Retrieves the thread id of the thread that executed the kernel, producing this profile report.- Returns:
- the thread id
-
getKernelClass
public java.lang.Class<? extends Kernel> getKernelClass()
Retrieves the class of the kernel to which this profile report pertains to- Returns:
- the Aparapi kernel class
-
getDevice
public Device getDevice()
Retrieves the Aparapi device where the kernel was executed, producing this profile report.- Returns:
- the Aparapi device
-
getStageNames
public java.util.List<java.lang.String> getStageNames()
Get the names of the stages for which data was collected.- Returns:
- the list with the stages names
-
getNumberOfStages
public int getNumberOfStages()
The number of stages available with report data.- Returns:
- the number of stages
-
getStageName
public java.lang.String getStageName(int stage)
Get the name of a given stage- Parameters:
stage
- the index of the stage- Returns:
- the stage name
-
getElapsedTime
public double getElapsedTime(int stage)
Elapsed time for a single event only, i.e. since the previous stage rather than from the start.
-
getElapsedTime
public double getElapsedTime(int from, int to)
Elapsed time for all eventsfrom
throughto
.
-
getExecutionTime
public double getExecutionTime()
Determine the execution time of the Kernel.execute(range) call from this report.- Returns:
- The time spent executing the kernel (ms)
-
getConversionTime
public double getConversionTime()
Determine the time taken to convert bytecode to OpenCL for first Kernel.execute(range) call.- Returns:
- The time spent preparing the kernel for execution using GPU (ms)
-
clone
public ProfileReport clone()
- Overrides:
clone
in classjava.lang.Object
-
-