Package com.aparapi

Interface IProfileReportObserver


  • public interface IProfileReportObserver
    Defines interface for listener/observer of Kernel profile reports
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void receiveReport​(java.lang.Class<? extends Kernel> kernelClass, Device device, java.lang.ref.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 Detail

      • receiveReport

        void receiveReport​(java.lang.Class<? extends Kernel> kernelClass,
                           Device device,
                           java.lang.ref.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 a ProfileReport, it is necessary to clone the profileInfo object with ProfileReport.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 pertains
        device - the device on which the kernel ran, producing the profile report
        profileInfo - the profile report for the given Aparapi kernel and device pair