mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Store bcsEngine in an std::vector in OpenCL CommandQUeue
Related-To: NEO-6057 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eccebfb49d
commit
c910a58aa0
@@ -18,7 +18,7 @@
|
||||
namespace NEO {
|
||||
class MockCommandQueue : public CommandQueue {
|
||||
public:
|
||||
using CommandQueue::bcsEngine;
|
||||
using CommandQueue::bcsEngines;
|
||||
using CommandQueue::blitEnqueueAllowed;
|
||||
using CommandQueue::blitEnqueueImageAllowed;
|
||||
using CommandQueue::blitEnqueuePreferred;
|
||||
@@ -36,6 +36,22 @@ class MockCommandQueue : public CommandQueue {
|
||||
using CommandQueue::throttle;
|
||||
using CommandQueue::timestampPacketContainer;
|
||||
|
||||
void clearBcsEngines() {
|
||||
std::fill(bcsEngines.begin(), bcsEngines.end(), nullptr);
|
||||
}
|
||||
|
||||
void insertBcsEngine(aub_stream::EngineType bcsEngineType) {
|
||||
const auto index = NEO::EngineHelpers::getBcsIndex(bcsEngineType);
|
||||
const auto engine = &getDevice().getEngine(bcsEngineType, EngineUsage::Regular);
|
||||
bcsEngines[index] = engine;
|
||||
}
|
||||
|
||||
size_t countBcsEngines() const {
|
||||
return std::count_if(bcsEngines.begin(), bcsEngines.end(), [](const EngineControl *engine) {
|
||||
return engine != nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
void setProfilingEnabled() {
|
||||
commandQueueProperties |= CL_QUEUE_PROFILING_ENABLE;
|
||||
}
|
||||
@@ -198,7 +214,7 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
|
||||
using BaseClass = CommandQueueHw<GfxFamily>;
|
||||
|
||||
public:
|
||||
using BaseClass::bcsEngine;
|
||||
using BaseClass::bcsEngines;
|
||||
using BaseClass::bcsState;
|
||||
using BaseClass::blitEnqueueAllowed;
|
||||
using BaseClass::commandQueueProperties;
|
||||
@@ -218,6 +234,10 @@ class MockCommandQueueHw : public CommandQueueHw<GfxFamily> {
|
||||
cl_queue_properties *properties) : BaseClass(context, device, properties, false) {
|
||||
}
|
||||
|
||||
void clearBcsEngines() {
|
||||
std::fill(bcsEngines.begin(), bcsEngines.end(), nullptr);
|
||||
}
|
||||
|
||||
cl_int flush() override {
|
||||
flushCalled = true;
|
||||
return BaseClass::flush();
|
||||
|
||||
Reference in New Issue
Block a user