From d39309adf290f8f33eb1ab7289ded916e94127c8 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Wed, 28 Nov 2018 09:42:11 +0100 Subject: [PATCH] Use const values instead of constexpr from std::array::size() Change-Id: I705888b77801cd32487c4d53fc320cf839ec9079 Signed-off-by: Dunajski, Bartosz --- runtime/command_stream/aub_command_stream_receiver_hw.h | 4 ++-- runtime/command_stream/definitions/engine_node.h | 7 +++++-- runtime/device/device.h | 2 +- runtime/execution_environment/execution_environment.h | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/runtime/command_stream/aub_command_stream_receiver_hw.h b/runtime/command_stream/aub_command_stream_receiver_hw.h index 3f5745981b..98e09445bd 100644 --- a/runtime/command_stream/aub_command_stream_receiver_hw.h +++ b/runtime/command_stream/aub_command_stream_receiver_hw.h @@ -105,8 +105,8 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw subCaptureManager; uint32_t aubDeviceId; diff --git a/runtime/command_stream/definitions/engine_node.h b/runtime/command_stream/definitions/engine_node.h index 5f590179bb..6f0695f79d 100644 --- a/runtime/command_stream/definitions/engine_node.h +++ b/runtime/command_stream/definitions/engine_node.h @@ -20,6 +20,9 @@ enum EngineType : uint32_t { }; struct EngineInstanceT { + static const size_t numAllEngineInstances = 5; + static const size_t numGpgpuEngineInstances = 2; + constexpr EngineInstanceT(EngineType type) : type(type), id(0) {} constexpr EngineInstanceT(EngineType type, int id) : type(type), id(id) {} @@ -27,7 +30,7 @@ struct EngineInstanceT { int id; }; -static constexpr std::array allEngineInstances = {{ +static constexpr std::array allEngineInstances = {{ {ENGINE_RCS, 0}, {ENGINE_RCS, 1}, {ENGINE_BCS}, @@ -35,7 +38,7 @@ static constexpr std::array allEngineInstances = {{ {ENGINE_VECS}, }}; -static constexpr std::array gpgpuEngineInstances = {{ +static constexpr std::array gpgpuEngineInstances = {{ {ENGINE_RCS, 0}, {ENGINE_RCS, 1}, }}; diff --git a/runtime/device/device.h b/runtime/device/device.h index 15c8f743e1..aef4ed8056 100644 --- a/runtime/device/device.h +++ b/runtime/device/device.h @@ -152,7 +152,7 @@ class Device : public BaseObject<_cl_device_id> { std::unique_ptr driverInfo; std::unique_ptr performanceCounters; - std::array engines = {{}}; + std::array engines = {{}}; void *slmWindowStartAddress = nullptr; diff --git a/runtime/execution_environment/execution_environment.h b/runtime/execution_environment/execution_environment.h index d1ec8634c4..896d868882 100644 --- a/runtime/execution_environment/execution_environment.h +++ b/runtime/execution_environment/execution_environment.h @@ -24,7 +24,7 @@ class BuiltIns; struct HardwareInfo; class OSInterface; -using CsrContainer = std::array, gpgpuEngineInstances.size()>; +using CsrContainer = std::array, EngineInstanceT::numGpgpuEngineInstances>; class ExecutionEnvironment : public ReferenceTrackedObject { private: