Package com.aparapi
Interface IProfileReportObserver
public interface IProfileReportObserver
Defines interface for listener/observer of Kernel profile reports
- Author:
- lpnm
-
Method Summary
Modifier and TypeMethodDescriptionvoid
receiveReport
(Class<? extends Kernel> kernelClass, Device device, WeakReference<ProfileReport> profileInfo) The listener method will be invoked each time a profile report becomes available for each Aparapi Kernel which has a registered observer.
Note1: A report will be generated by a thread executing a kernel.
-
Method Details
-
receiveReport
void receiveReport(Class<? extends Kernel> kernelClass, Device device, WeakReference<ProfileReport> profileInfo) The listener method will be invoked each time a profile report becomes available for each Aparapi Kernel which has a registered observer.
Note1: A report will be generated by a thread executing a kernel. If multiple threads execute the same kernel, concurrently, this method can be called concurrently too, thus classes implementing this interface need to provide a thread safe method.
Note2: If profiling information is to be stored has aProfileReport
, it is necessary to clone the profileInfo object withProfileReport.clone()
. A WeakReference is used to help differentiate such need, however it is guaranteed that profileInfo will not be null, during the method execution.- Parameters:
kernelClass
- the class of the kernel to which the profile report pertainsdevice
- the device on which the kernel ran, producing the profile reportprofileInfo
- the profile report for the given Aparapi kernel and device pair
-