Commit c5777cc4 authored by Jaume Bosch's avatar Jaume Bosch

Allow GPU and OpenCL helpers share the cpu

Do not fail when the GPU or OpenCL plugin try to reserve an SMP processor but there are not available. Instead, the runtime will show a warning and share the core with another thread
parent 07047de0
......@@ -67,11 +67,17 @@ class GPUPlugin : public ArchPlugin
if ( core == NULL ) {
core = sys.getSMPPlugin()->getLastFreeSMPProcessorAndReserve();
if ( core == NULL ) {
fatal0("Unable to get a core to run the GPU thread.");
core = sys.getSMPPlugin()->getLastSMPProcessor();
if ( core == NULL ) {
fatal0("Unable to get a core to run the GPU thread.");
}
warning0("Unable to get an exclusive cpu to run the CPU thread. The thread will run on PE " << core->getId() << " and share the cpu");
}
if (node != core->getNumaNode()) {
warning0("Unable to get a cpu on numa node " << node << " to run the CPU thread. Will run on numa node "<< core->getNumaNode());
}
warning0("Unable to get a cpu on numa node " << node << " to run the CPU thread. Will run on numa node "<< core->getNumaNode());
}
core->setNumFutureThreads( 1 );
core->setNumFutureThreads( core->getNumFutureThreads() + 1 );
//bool reserved;
//unsigned pe = sys.reservePE( numa, node, reserved );
......
......@@ -64,9 +64,13 @@ namespace ext {
ext::SMPProcessor *core = sys.getSMPPlugin()->getLastFreeSMPProcessorAndReserve();
if ( core == NULL ) {
fatal0("Unable to get a core to run the GPU thread.");
core = sys.getSMPPlugin()->getLastSMPProcessor();
if ( core == NULL ) {
fatal0("Unable to get a core to run the OpenCL host thread.");
}
warning0("Unable to get an exclusive cpu to run the OpenCL thread. The thread will run on PE " << core->getId() << " and share the cpu");
}
core->setNumFutureThreads( 1 );
core->setNumFutureThreads( core->getNumFutureThreads() + 1 );
_opencls.push_back( NEW nanos::ext::OpenCLProcessor( openclC, id, core, oclmemory ) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment