Package com.aparapi

Class ProfileReport


  • public final class ProfileReport
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      ProfileReport​(long _threadId, java.lang.Class<? extends Kernel> clazz, Device _device)
      Creates a profile report pertaining to a given thread that executed kernel class on the specified device.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ProfileReport clone()  
      double getConversionTime()
      Determine the time taken to convert bytecode to OpenCL for first Kernel.execute(range) call.
      Device getDevice()
      Retrieves the Aparapi device where the kernel was executed, producing this profile report.
      double getElapsedTime​(int stage)
      Elapsed time for a single event only, i.e.
      double getElapsedTime​(int from, int to)
      Elapsed time for all events from through to.
      double getExecutionTime()
      Determine the execution time of the Kernel.execute(range) call from this report.
      java.lang.Class<? extends Kernel> getKernelClass()
      Retrieves the class of the kernel to which this profile report pertains to
      int getNumberOfStages()
      The number of stages available with report data.
      long getReportId()
      Retrieves the current report unique identifier.
      Note: The identifier is monotonically incremented at each new report for the current tuple.
      java.lang.String getStageName​(int stage)
      Get the name of a given stage
      java.util.List<java.lang.String> getStageNames()
      Get the names of the stages for which data was collected.
      long getThreadId()
      Retrieves the thread id of the thread that executed the kernel, producing this profile report.
      void setProfileReport​(long reportId, long[] _currentTimes)
      Sets specific report data.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NUM_EVENTS

        private static final int NUM_EVENTS
      • id

        private long id
      • kernelClass

        private final java.lang.Class<? extends Kernel> kernelClass
      • threadId

        private final long threadId
      • device

        private final Device device
      • currentTimes

        private final long[] currentTimes
      • stagesNames

        private final java.lang.String[] stagesNames
    • Constructor Detail

      • ProfileReport

        public ProfileReport​(long _threadId,
                             java.lang.Class<? extends Kernel> clazz,
                             Device _device)
        Creates a profile report pertaining to a given thread that executed kernel class on the specified device.
        Parameters:
        _threadId - the id of thread that executed the kernel
        clazz - the class of the executed kernel
        _device - the device where the kernel executed
    • Method Detail

      • setProfileReport

        public void setProfileReport​(long reportId,
                                     long[] _currentTimes)
        Sets specific report data.
        Parameters:
        reportId - the unique identifier for this report (the identifier is unique within the tuple)
        _currentTimes - the profiling data
      • getReportId

        public long getReportId()
        Retrieves the current report unique identifier.
        Note: The identifier is monotonically incremented at each new report for the current tuple.
        Returns:
        the report id
      • getThreadId

        public long getThreadId()
        Retrieves the thread id of the thread that executed the kernel, producing this profile report.
        Returns:
        the thread id
      • getKernelClass

        public java.lang.Class<? extends Kernel> getKernelClass()
        Retrieves the class of the kernel to which this profile report pertains to
        Returns:
        the Aparapi kernel class
      • getDevice

        public Device getDevice()
        Retrieves the Aparapi device where the kernel was executed, producing this profile report.
        Returns:
        the Aparapi device
      • getStageNames

        public java.util.List<java.lang.String> getStageNames()
        Get the names of the stages for which data was collected.
        Returns:
        the list with the stages names
      • getNumberOfStages

        public int getNumberOfStages()
        The number of stages available with report data.
        Returns:
        the number of stages
      • getStageName

        public java.lang.String getStageName​(int stage)
        Get the name of a given stage
        Parameters:
        stage - the index of the stage
        Returns:
        the stage name
      • getElapsedTime

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

        public double getElapsedTime​(int from,
                                     int to)
        Elapsed time for all events from through to.
      • getExecutionTime

        public double getExecutionTime()
        Determine the execution time of the Kernel.execute(range) call from this report.
        Returns:
        The time spent executing the kernel (ms)
      • getConversionTime

        public double getConversionTime()
        Determine the time taken to convert bytecode to OpenCL for first Kernel.execute(range) call.
        Returns:
        The time spent preparing the kernel for execution using GPU (ms)
      • clone

        public ProfileReport clone()
        Overrides:
        clone in class java.lang.Object