* \brief Counter that provides a fairly accurate timing mechanism for both * windows and linux. This timer is used extensively in all the samples. */
| 44 | * windows and linux. This timer is used extensively in all the samples. |
| 45 | */ |
| 46 | class clsparseTimer |
| 47 | { |
| 48 | protected: |
| 49 | |
| 50 | /*! |
| 51 | * \brief Destructor for StatisticalTimer that cleans up the class |
| 52 | */ |
| 53 | virtual ~clsparseTimer( ) |
| 54 | { |
| 55 | }; |
| 56 | |
| 57 | public: |
| 58 | /*! |
| 59 | * \brief Start a timing sample |
| 60 | */ |
| 61 | virtual void Start( size_t id ) = 0; |
| 62 | |
| 63 | /*! |
| 64 | * \brief Stop a timing sample |
| 65 | */ |
| 66 | virtual void Stop( size_t id ) = 0; |
| 67 | |
| 68 | /*! |
| 69 | * \brief Clear all internal data structures, deallocate all memory |
| 70 | */ |
| 71 | virtual void Clear( ) = 0; |
| 72 | |
| 73 | /*! |
| 74 | * \brief Clear all internal data structures, freeing all memory, then reallocate |
| 75 | * the same amount of memory requested with Reserve |
| 76 | */ |
| 77 | virtual void Reset( ) = 0; |
| 78 | |
| 79 | /*! |
| 80 | * \brief The implementation of the timing class may contains data structures |
| 81 | * that need to grow as more samples are collected. |
| 82 | * \details This function allows the client to specify to the timing class an |
| 83 | * estimate for the amount of memory required for the duration of the benchmark |
| 84 | * \param[in] nEvents An event is an independent timing location of benchmark interest, such as |
| 85 | * two different functions |
| 86 | * \param[in] nSamples The number of samples that associated with an event, often a loop-count |
| 87 | */ |
| 88 | virtual void Reserve( size_t nEvents, size_t nSamples ) = 0; |
| 89 | |
| 90 | /*! |
| 91 | * \brief Provide a mapping from a 'friendly' human readable text string to an index |
| 92 | * into internal data structures |
| 93 | * \param[in] label Human readable string to textually identify the event |
| 94 | * \param[in] groupID A number paired with the string to differentiate identical strings |
| 95 | */ |
| 96 | virtual size_t getUniqueID( const std::string& label, cl_uint groupID ) = 0; |
| 97 | |
| 98 | /*! |
| 99 | * \brief Request that the timer divides total samples collected by sample frequency, |
| 100 | * converting tick counts into seconds |
| 101 | * \param[in] norm True value will divide return result by frequency |
| 102 | */ |
| 103 | virtual void setNormalize( bool norm ) = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected