This function's purpose is to provide a mapping from a 'friendly' human readable text string to an index into internal data structures.
| 232 | // This function's purpose is to provide a mapping from a 'friendly' human readable text string |
| 233 | // to an index into internal data structures. |
| 234 | size_t |
| 235 | GpuStatTimer::getUniqueID( const std::string& label, cl_uint groupID ) |
| 236 | { |
| 237 | // I expect labelID will hardly ever grow beyond 30, so it's not of any use |
| 238 | // to keep this sorted and do a binary search |
| 239 | |
| 240 | idPair sItem = std::make_pair( label, groupID ); |
| 241 | |
| 242 | idVector::iterator iter; |
| 243 | iter = std::find( labelID.begin(), labelID.end(), sItem ); |
| 244 | |
| 245 | if( iter != labelID.end( ) ) |
| 246 | return std::distance( labelID.begin( ), iter ); |
| 247 | |
| 248 | labelID.push_back( sItem ); |
| 249 | |
| 250 | return labelID.size( ) - 1; |
| 251 | |
| 252 | } |
| 253 | |
| 254 | void GpuStatTimer::ReleaseEvents() |
| 255 | { |