This function's purpose is to provide a mapping from a 'friendly' human readable text string to an index into internal data structures.
| 242 | // This function's purpose is to provide a mapping from a 'friendly' human readable text string |
| 243 | // to an index into internal data structures. |
| 244 | size_t |
| 245 | clsparseDeviceTimer::getUniqueID( const std::string& label, cl_uint groupID ) |
| 246 | { |
| 247 | // I expect labelID will hardly ever grow beyond 30, so it's not of any use |
| 248 | // to keep this sorted and do a binary search |
| 249 | |
| 250 | idPair sItem = std::make_pair( label, groupID ); |
| 251 | |
| 252 | idVector::iterator iter; |
| 253 | iter = std::find( labelID.begin( ), labelID.end( ), sItem ); |
| 254 | |
| 255 | if( iter != labelID.end( ) ) |
| 256 | return std::distance( labelID.begin( ), iter ); |
| 257 | |
| 258 | labelID.push_back( sItem ); |
| 259 | |
| 260 | return labelID.size( ) - 1; |
| 261 | |
| 262 | } |
| 263 | |
| 264 | void clsparseDeviceTimer::queryOpenCL( size_t id ) |
| 265 | { |