Move definitions out of engine_node.h.
Change-Id: I18692a444663c11103f8991415b38000c633f24a Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
This commit is contained in:
parent
83aa28e294
commit
cc13045ddd
|
@ -18,11 +18,4 @@ enum EngineType : uint32_t {
|
||||||
NUM_ENGINES
|
NUM_ENGINES
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace EngineInstanceConstants {
|
|
||||||
constexpr uint32_t lowPriorityGpgpuEngineIndex = 1;
|
|
||||||
constexpr uint32_t numGpgpuEngineInstances = 2;
|
|
||||||
} // namespace EngineInstanceConstants
|
|
||||||
|
|
||||||
constexpr uint32_t maxOsContextCount = EngineInstanceConstants::numGpgpuEngineInstances;
|
|
||||||
constexpr uint32_t maxHandleCount = 1u;
|
|
||||||
} // namespace OCLRT
|
} // namespace OCLRT
|
||||||
|
|
|
@ -175,7 +175,7 @@ bool Device::createEngines(const HardwareInfo *pHwInfo) {
|
||||||
|
|
||||||
DeviceBitfield deviceBitfield;
|
DeviceBitfield deviceBitfield;
|
||||||
deviceBitfield.set(getDeviceIndex());
|
deviceBitfield.set(getDeviceIndex());
|
||||||
bool lowPriority = deviceCsrIndex == EngineInstanceConstants::lowPriorityGpgpuEngineIndex;
|
bool lowPriority = deviceCsrIndex == HwHelper::lowPriorityGpgpuEngineIndex;
|
||||||
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver, gpgpuEngines[deviceCsrIndex],
|
auto osContext = executionEnvironment->memoryManager->createAndRegisterOsContext(commandStreamReceiver, gpgpuEngines[deviceCsrIndex],
|
||||||
deviceBitfield, preemptionMode, lowPriority);
|
deviceBitfield, preemptionMode, lowPriority);
|
||||||
commandStreamReceiver->setupContext(*osContext);
|
commandStreamReceiver->setupContext(*osContext);
|
||||||
|
|
|
@ -60,6 +60,8 @@ class HwHelper {
|
||||||
virtual const std::vector<EngineType> getGpgpuEngineInstances() const = 0;
|
virtual const std::vector<EngineType> getGpgpuEngineInstances() const = 0;
|
||||||
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
virtual bool getEnableLocalMemory(const HardwareInfo &hwInfo) const = 0;
|
||||||
|
|
||||||
|
static constexpr uint32_t lowPriorityGpgpuEngineIndex = 1;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HwHelper() = default;
|
HwHelper() = default;
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,6 +14,7 @@ set(RUNTIME_SRCS_MEMORY_MANAGER
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h
|
${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.h
|
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/engine_limits.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/storage_info.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/storage_info.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/storage_info.h
|
${CMAKE_CURRENT_SOURCE_DIR}/definitions${BRANCH_DIR_SUFFIX}/storage_info.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/gfx_partition.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/gfx_partition.cpp
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2017-2019 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace OCLRT {
|
||||||
|
|
||||||
|
constexpr uint32_t numGpgpuEngineInstances = 2u;
|
||||||
|
constexpr uint32_t maxOsContextCount = numGpgpuEngineInstances;
|
||||||
|
constexpr uint32_t maxHandleCount = 1u;
|
||||||
|
|
||||||
|
} // namespace OCLRT
|
|
@ -17,6 +17,7 @@
|
||||||
#include "runtime/utilities/idlist.h"
|
#include "runtime/utilities/idlist.h"
|
||||||
#include "runtime/utilities/stackvec.h"
|
#include "runtime/utilities/stackvec.h"
|
||||||
|
|
||||||
|
#include "engine_limits.h"
|
||||||
#include "storage_info.h"
|
#include "storage_info.h"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
|
@ -6,21 +6,15 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "engine_node.h"
|
#include "engine_limits.h"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cinttypes>
|
#include <cstdint>
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace OCLRT {
|
namespace OCLRT {
|
||||||
|
|
||||||
struct ResidencyData {
|
struct ResidencyData {
|
||||||
ResidencyData() {
|
bool resident[maxOsContextCount] = {};
|
||||||
std::fill_n(resident, sizeof(resident), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
~ResidencyData() = default;
|
|
||||||
bool resident[maxOsContextCount];
|
|
||||||
|
|
||||||
void updateCompletionData(uint64_t newFenceValue, uint32_t contextId);
|
void updateCompletionData(uint64_t newFenceValue, uint32_t contextId);
|
||||||
uint64_t getFenceValueForContextId(uint32_t contextId);
|
uint64_t getFenceValueForContextId(uint32_t contextId);
|
||||||
|
|
|
@ -58,7 +58,7 @@ TEST_F(DeviceTest, givenDeviceWhenEngineIsCreatedThenSetInitialValueForTag) {
|
||||||
TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenRetrunIt) {
|
TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenRetrunIt) {
|
||||||
auto &engines = HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances();
|
auto &engines = HwHelper::get(platformDevices[0]->pPlatform->eRenderCoreFamily).getGpgpuEngineInstances();
|
||||||
for (uint32_t i = 0; i < engines.size(); i++) {
|
for (uint32_t i = 0; i < engines.size(); i++) {
|
||||||
bool lowPriority = (EngineInstanceConstants::lowPriorityGpgpuEngineIndex == i);
|
bool lowPriority = (HwHelper::lowPriorityGpgpuEngineIndex == i);
|
||||||
auto &deviceEngine = pDevice->getEngine(engines[i], lowPriority);
|
auto &deviceEngine = pDevice->getEngine(engines[i], lowPriority);
|
||||||
EXPECT_EQ(deviceEngine.osContext->getEngineType(), engines[i]);
|
EXPECT_EQ(deviceEngine.osContext->getEngineType(), engines[i]);
|
||||||
EXPECT_EQ(deviceEngine.osContext->isLowPriority(), lowPriority);
|
EXPECT_EQ(deviceEngine.osContext->isLowPriority(), lowPriority);
|
||||||
|
|
|
@ -1472,8 +1472,8 @@ using GraphicsAllocationTests = ::testing::Test;
|
||||||
|
|
||||||
HWTEST_F(GraphicsAllocationTests, givenAllocationUsedOnlyByNonDefaultCsrWhenCheckingUsageBeforeDestroyThenStoreItAsTemporaryAllocation) {
|
HWTEST_F(GraphicsAllocationTests, givenAllocationUsedOnlyByNonDefaultCsrWhenCheckingUsageBeforeDestroyThenStoreItAsTemporaryAllocation) {
|
||||||
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
|
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(platformDevices[0]));
|
||||||
auto nonDefaultOsContext = device->engines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].osContext;
|
auto nonDefaultOsContext = device->engines[HwHelper::lowPriorityGpgpuEngineIndex].osContext;
|
||||||
auto nonDefaultCsr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(device->engines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].commandStreamReceiver);
|
auto nonDefaultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(device->engines[HwHelper::lowPriorityGpgpuEngineIndex].commandStreamReceiver);
|
||||||
|
|
||||||
auto memoryManager = device->getExecutionEnvironment()->memoryManager.get();
|
auto memoryManager = device->getExecutionEnvironment()->memoryManager.get();
|
||||||
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
auto graphicsAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||||
|
@ -1519,9 +1519,9 @@ HWTEST_F(GraphicsAllocationTests, givenAllocationUsedByManyOsContextsWhenCheckin
|
||||||
memoryManager->multiContextResourceDestructor.reset(multiContextDestructor);
|
memoryManager->multiContextResourceDestructor.reset(multiContextDestructor);
|
||||||
|
|
||||||
auto device = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(platformDevices[0], executionEnvironment, 0u));
|
auto device = std::unique_ptr<MockDevice>(MockDevice::create<MockDevice>(platformDevices[0], executionEnvironment, 0u));
|
||||||
auto nonDefaultOsContext = device->engines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].osContext;
|
auto nonDefaultOsContext = device->engines[HwHelper::lowPriorityGpgpuEngineIndex].osContext;
|
||||||
auto nonDefaultCsr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(device->engines[EngineInstanceConstants::lowPriorityGpgpuEngineIndex].commandStreamReceiver);
|
auto nonDefaultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(device->engines[HwHelper::lowPriorityGpgpuEngineIndex].commandStreamReceiver);
|
||||||
auto defaultCsr = reinterpret_cast<UltCommandStreamReceiver<FamilyType> *>(device->getDefaultEngine().commandStreamReceiver);
|
auto defaultCsr = static_cast<UltCommandStreamReceiver<FamilyType> *>(device->getDefaultEngine().commandStreamReceiver);
|
||||||
auto defaultOsContext = device->getDefaultEngine().osContext;
|
auto defaultOsContext = device->getDefaultEngine().osContext;
|
||||||
|
|
||||||
EXPECT_FALSE(defaultOsContext->isLowPriority());
|
EXPECT_FALSE(defaultOsContext->isLowPriority());
|
||||||
|
|
Loading…
Reference in New Issue