Package com.aparapi.internal.kernel
Class KernelProfile
- java.lang.Object
-
- com.aparapi.internal.kernel.KernelProfile
-
public class KernelProfile extends java.lang.Object
Collects profiling information per kernel class per device.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<Device>
currentDevice
private java.util.concurrent.ConcurrentSkipListMap<Device,KernelDeviceProfile>
deviceProfiles
private java.lang.Class<? extends Kernel>
kernelClass
private static java.util.logging.Logger
logger
static double
MILLION
private IProfileReportObserver
observer
-
Constructor Summary
Constructors Constructor Description KernelProfile(java.lang.Class<? extends Kernel> _kernelClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getAccumulatedTotalTime()
KernelDeviceProfile
getDeviceProfile(Device device)
java.util.Collection<KernelDeviceProfile>
getDeviceProfiles()
java.util.Collection<Device>
getDevices()
double
getLastConversionTime()
KernelDeviceProfile
getLastDeviceProfile()
Retrieves the last device profile that was updated by the last thread that made a profiling information update, when executing this kernel on the specified device.double
getLastExecutionTime()
IProfileReportObserver
getReportObserver()
(package private) void
onEvent(Device device, ProfilingEvent event)
Updates the profiling information for the current thread invoking this method regarding the specified execution device.(package private) void
onStart(Device device)
Starts a profiling information gathering sequence for the current thread invoking this method regarding the specified execution device.void
setReportObserver(IProfileReportObserver _observer)
-
-
-
Field Detail
-
MILLION
public static final double MILLION
- See Also:
- Constant Field Values
-
logger
private static java.util.logging.Logger logger
-
kernelClass
private final java.lang.Class<? extends Kernel> kernelClass
-
deviceProfiles
private java.util.concurrent.ConcurrentSkipListMap<Device,KernelDeviceProfile> deviceProfiles
-
currentDevice
private final java.util.concurrent.atomic.AtomicReference<Device> currentDevice
-
observer
private IProfileReportObserver observer
-
-
Constructor Detail
-
KernelProfile
public KernelProfile(java.lang.Class<? extends Kernel> _kernelClass)
-
-
Method Detail
-
getLastExecutionTime
public double getLastExecutionTime()
-
getLastConversionTime
public double getLastConversionTime()
-
getAccumulatedTotalTime
public double getAccumulatedTotalTime()
-
getLastDeviceProfile
public KernelDeviceProfile getLastDeviceProfile()
Retrieves the last device profile that was updated by the last thread that made a profiling information update, when executing this kernel on the specified device.- Returns:
- the device profile
-
onStart
void onStart(Device device)
Starts a profiling information gathering sequence for the current thread invoking this method regarding the specified execution device.- Parameters:
device
-
-
onEvent
void onEvent(Device device, ProfilingEvent event)
Updates the profiling information for the current thread invoking this method regarding the specified execution device.- Parameters:
device
- the device where the kernel is/was executedevent
- the event for which the profiling information is being updated
-
getDevices
public java.util.Collection<Device> getDevices()
-
getDeviceProfiles
public java.util.Collection<KernelDeviceProfile> getDeviceProfiles()
-
getDeviceProfile
public KernelDeviceProfile getDeviceProfile(Device device)
-
setReportObserver
public void setReportObserver(IProfileReportObserver _observer)
-
getReportObserver
public IProfileReportObserver getReportObserver()
-
-