Class KernelDeviceProfile

java.lang.Object
com.aparapi.internal.kernel.KernelDeviceProfile

public class KernelDeviceProfile extends Object
Created by Barney on 02/09/2015.
  • Constructor Details

  • Method Details

    • onEvent

      public void onEvent(ProfilingEvent event)
    • getElapsedTimeCurrentThread

      public double getElapsedTimeCurrentThread(int stage)
      Elapsed time for a single event only and for the current thread, i.e. since the previous stage rather than from the start.
    • getElapsedTimeCurrentThread

      public double getElapsedTimeCurrentThread(int from, int to)
      Elapsed time for all events from through to for the current thread.
    • getReportCurrentThread

      public WeakReference<ProfileReport> getReportCurrentThread()
      Retrieves the most recent complete report available for the current thread calling this method.
      Note1: If the profile report is intended to be kept in memory, the object should be cloned with ProfileReport.clone()
      Note2: If the thread didn't execute this KernelDeviceProfile instance respective kernel and device, it will return null.
      Returns:
      • the profiling report for the current most recent execution
      • null, if no profiling report is available for such thread
    • getReportLastThread

      public WeakReference<ProfileReport> getReportLastThread()
      Retrieves the most recent complete report available for the last thread that executed this KernelDeviceProfile instance respective kernel and device.
      Note1: If the profile report is intended to be kept in memory, the object should be cloned with ProfileReport.clone()
      Returns:
      • the profiling report for the current most recent execution
      • null, if no profiling report is available yet
    • getCumulativeElapsedTimeCurrrentThread

      public double getCumulativeElapsedTimeCurrrentThread(ProfilingEvent stage)
      Elapsed time for a single event only, i.e. since the previous stage rather than from the start, summed over all executions, for the current thread, if it has executed the kernel on the device assigned to this KernelDeviceProfile instance.
      Parameters:
      stage - the event stage
    • getCumulativeElapsedTimeAllCurrentThread

      public double getCumulativeElapsedTimeAllCurrentThread()
      Elapsed time of entire execution, summed over all executions, for the current thread, if it has executed the kernel on the device assigned to this KernelDeviceProfile instance.
    • getElapsedTimeLastThread

      public double getElapsedTimeLastThread(int stage)
      Elapsed time for a single event only and for the last thread that finished executing a kernel, i.e. single event only - since the previous stage rather than from the start.
      Parameters:
      stage - the event stage
    • getElapsedTimeLastThread

      public double getElapsedTimeLastThread(int from, int to)
      Elapsed time for all events from through to for the last thread that executed this KernelDeviceProfile instance respective kernel and device.
      Parameters:
      from - the first event to consider that defines the elapsed period start
      to - the last event to consider for elapsed period
    • getCumulativeElapsedTimeGlobal

      public double getCumulativeElapsedTimeGlobal(ProfilingEvent stage)
      Elapsed time for a single event only, i.e. since the previous stage rather than from the start, summed over all executions, for the last thread that executed this KernelDeviceProfile instance respective kernel and device.
      Parameters:
      stage - the event stage
    • getCumulativeElapsedTimeAllGlobal

      public double getCumulativeElapsedTimeAllGlobal()
      Elapsed time of entire execution, summed over all executions, for all the threads, that executed the kernel on this device.
    • getTableHeader

      public static String getTableHeader()
    • getLastAsTableRow

      public String getLastAsTableRow()
    • getCumulativeAsTableRow

      public String getCumulativeAsTableRow()
    • getAverageAsTableRow

      public String getAverageAsTableRow()
    • toString

      public String toString()
      Overrides:
      toString in class Object