Commit b3b38270 authored by Victor Lopez's avatar Victor Lopez

Merge branch 'fix/gpu_ocl_oversubscription' into 'master'

Fix/gpu ocl oversubscription

See merge request !48
parents 07047de0 5d5f74a8
......@@ -61,17 +61,23 @@ class GPUPlugin : public ArchPlugin
ext::GPUMemorySpace *gpuMemSpace = NEW ext::GPUMemorySpace();
gpuMemory.setSpecificData( gpuMemSpace );
int node = getNumaNodeOfGPU( gpuC );
unsigned int node = getNumaNodeOfGPU( gpuC );
ext::SMPProcessor *core = sys.getSMPPlugin()->getFreeSMPProcessorByNUMAnodeAndReserve(node);
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