MCPcopy Create free account
hub / github.com/clMathLibraries/clSPARSE / getUniqueID

Method getUniqueID

src/clsparseTimer/clsparseTimer-device.cpp:244–262  ·  view source on GitHub ↗

This function's purpose is to provide a mapping from a 'friendly' human readable text string to an index into internal data structures.

Source from the content-addressed store, hash-verified

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.
244size_t
245clsparseDeviceTimer::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
264void clsparseDeviceTimer::queryOpenCL( size_t id )
265{

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected