mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Create map for deviceBitfields per rootDeviceIndex
Pass rootDeviceIndex to getDeviceBitfieldForAllocation Related-To: NEO-4589 Change-Id: Ib325a8bf822351ba36b225d94d4173fd725e8766 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e28f937683
commit
214342f405
@@ -198,6 +198,15 @@ bool Context::createImpl(const cl_context_properties *properties,
|
||||
}
|
||||
|
||||
this->devices = inputDevices;
|
||||
for (auto &rootDeviceIndex : rootDeviceIndices) {
|
||||
DeviceBitfield deviceBitfield{};
|
||||
for (const auto &pDevice : devices) {
|
||||
if (pDevice->getRootDeviceIndex() == rootDeviceIndex) {
|
||||
deviceBitfield |= pDevice->getDeviceBitfield();
|
||||
}
|
||||
}
|
||||
deviceBitfields.insert({rootDeviceIndex, deviceBitfield});
|
||||
}
|
||||
|
||||
if (devices.size() > 0) {
|
||||
maxRootDeviceIndex = *std::max_element(rootDeviceIndices.begin(), rootDeviceIndices.end(), std::less<uint32_t const>());
|
||||
@@ -438,13 +447,8 @@ AsyncEventsHandler &Context::getAsyncEventsHandler() const {
|
||||
return *static_cast<ClExecutionEnvironment *>(devices[0]->getExecutionEnvironment())->getAsyncEventsHandler();
|
||||
}
|
||||
|
||||
DeviceBitfield Context::getDeviceBitfieldForAllocation() const {
|
||||
DeviceBitfield deviceBitfield{};
|
||||
for (const auto &pDevice : devices) {
|
||||
deviceBitfield |= pDevice->getDeviceBitfield();
|
||||
}
|
||||
|
||||
return deviceBitfield;
|
||||
DeviceBitfield Context::getDeviceBitfieldForAllocation(uint32_t rootDeviceIndex) const {
|
||||
return deviceBitfields.at(rootDeviceIndex);
|
||||
}
|
||||
|
||||
void Context::setupContextType() {
|
||||
|
||||
Reference in New Issue
Block a user