Package com.aparapi.internal.kernel
Class KernelProfile
- java.lang.Object
-
- com.aparapi.internal.kernel.KernelProfile
-
public class KernelProfile extends java.lang.ObjectCollects profiling information per kernel class per device.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<Device>currentDeviceprivate java.util.concurrent.ConcurrentSkipListMap<Device,KernelDeviceProfile>deviceProfilesprivate java.lang.Class<? extends Kernel>kernelClassprivate static java.util.logging.Loggerloggerstatic doubleMILLIONprivate IProfileReportObserverobserver
-
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 doublegetAccumulatedTotalTime()KernelDeviceProfilegetDeviceProfile(Device device)java.util.Collection<KernelDeviceProfile>getDeviceProfiles()java.util.Collection<Device>getDevices()doublegetLastConversionTime()KernelDeviceProfilegetLastDeviceProfile()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.doublegetLastExecutionTime()IProfileReportObservergetReportObserver()(package private) voidonEvent(Device device, ProfilingEvent event)Updates the profiling information for the current thread invoking this method regarding the specified execution device.(package private) voidonStart(Device device)Starts a profiling information gathering sequence for the current thread invoking this method regarding the specified execution device.voidsetReportObserver(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()
-
-