Example #1
0
void
GpuStatTimer::AddSample( clfftPlanHandle plHandle, FFTPlan* plan, cl_kernel kern, cl_uint numEvents, cl_event* ev,
	const std::vector< size_t >& gWorkSize )
{
	if( (numEvents != 0) && (ev == NULL) )
		return;

	if( timerData.empty( ) )
		return;

	for( size_t i = 0; i < numEvents; ++i )
	{
		::clRetainEvent(ev[i]);
	}

	if( currRecord == 0 )
	{
		timerData.at( currID ).push_back( StatDataVec( ) );
		timerData.at( currID ).back( ).reserve( nSamples );
		timerData.at( currID ).back( ).push_back( StatData( plHandle, plan, kern, numEvents, ev, gWorkSize ) );
	}
	else
	{
		timerData.at( currID ).at( currSample )
			.push_back( StatData( plHandle, plan, kern, numEvents, ev, gWorkSize ) );
		++currSample;
	}
}
void
clsparseDeviceTimer::AddSample( std::vector< cl::Event > vecEvent )
{
    if( timerData.empty( ) )
        return;

    if( currRecord == 0 )
    {
        timerData.at( currID ).push_back( StatDataVec( ) );
        timerData.at( currID ).back( ).reserve( nSamples );
        timerData.at( currID ).back( ).push_back( StatData( vecEvent ) );
    }
    else
    {
        timerData.at( currID ).at( currSample ).push_back( StatData( vecEvent ) );
        ++currSample;
    }
}