mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Use std::bitset for deviceBitfield.
Change-Id: I9078ffbb38967b753980cb1c5ebcab00f5292598 Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
@@ -7,18 +7,15 @@
|
||||
|
||||
#include "runtime/helpers/hardware_context_controller.h"
|
||||
|
||||
#include "common/helpers/bit_helpers.h"
|
||||
#include "runtime/memory_manager/memory_constants.h"
|
||||
#include "runtime/os_interface/os_context.h"
|
||||
|
||||
#include <limits>
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
HardwareContextController::HardwareContextController(aub_stream::AubManager &aubManager, OsContext &osContext, uint32_t engineIndex, uint32_t flags) {
|
||||
constexpr uint32_t maxIndex = std::numeric_limits<decltype(osContext.getDeviceBitfield())>::digits;
|
||||
for (uint32_t deviceIndex = 0; deviceIndex < maxIndex; deviceIndex++) {
|
||||
if (isBitSet(osContext.getDeviceBitfield(), deviceIndex)) {
|
||||
auto deviceBitfield = osContext.getDeviceBitfield();
|
||||
for (uint32_t deviceIndex = 0; deviceIndex < deviceBitfield.size(); deviceIndex++) {
|
||||
if (deviceBitfield.test(deviceIndex)) {
|
||||
hardwareContexts.emplace_back(aubManager.createHardwareContext(deviceIndex, engineIndex, flags));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user