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

Method getUniqueID

src/statTimer/statisticalTimer.CPU.cpp:231–249  ·  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

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

Callers 1

transformFunction · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected