GPU context registration.

This commit is contained in:
Bartosz Taudul
2017-11-11 19:44:09 +01:00
parent ce35009c63
commit 3c00ce0958
7 changed files with 79 additions and 0 deletions

View File

@@ -588,6 +588,9 @@ void View::Process( const QueueItem& ev )
case QueueType::MessageLiteral:
ProcessMessageLiteral( ev.message );
break;
case QueueType::GpuNewContext:
ProcessGpuNewContext( ev.gpuNewContext );
break;
case QueueType::Terminate:
m_terminate = true;
break;
@@ -844,6 +847,15 @@ void View::ProcessMessageLiteral( const QueueMessage& ev )
InsertMessageData( msg, ev.thread );
}
void View::ProcessGpuNewContext( const QueueGpuNewContext& ev )
{
assert( ev.context == m_gpuData.size() );
auto gpu = m_slab.Alloc<GpuCtxData>();
gpu->timeDiff = int64_t( ev.cputime * m_timerMul - ev.gputime );
std::lock_guard<std::mutex> lock( m_lock );
m_gpuData.push_back( gpu );
}
void View::CheckString( uint64_t ptr )
{
if( m_strings.find( ptr ) != m_strings.end() ) return;