mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
AubManager to accept memory bank size in bytes
Change-Id: Ie98cb7c0c0eaf93c9a2312aa87428173421609a9
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -14,8 +14,8 @@ namespace OCLRT {
|
||||
AubCenter::AubCenter(const HardwareInfo *pHwInfo, bool localMemoryEnabled, const std::string &aubFileName) {
|
||||
if (DebugManager.flags.UseAubStream.get()) {
|
||||
auto devicesCount = AubHelper::getDevicesCount(pHwInfo);
|
||||
auto memoryBankSizeInGB = AubHelper::getMemBankSizeInGigabytes();
|
||||
aubManager.reset(createAubManager(pHwInfo->pPlatform->eRenderCoreFamily, devicesCount, memoryBankSizeInGB, localMemoryEnabled, pHwInfo->capabilityTable.aubDeviceId, aubFileName));
|
||||
auto memoryBankSize = AubHelper::getMemBankSize();
|
||||
aubManager.reset(createAubManager(pHwInfo->pPlatform->eRenderCoreFamily, devicesCount, memoryBankSize, localMemoryEnabled, aubFileName));
|
||||
}
|
||||
addressMapper = std::make_unique<AddressMapper>();
|
||||
streamProvider = std::make_unique<AubFileStreamProvider>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace OCLRT {
|
||||
struct HardwareInfo;
|
||||
extern AubDump::AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, size_t memoryBankSizeInGB, bool localMemorySupported, uint32_t deviceId, const std::string &aubFileName);
|
||||
extern AubDump::AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, bool localMemorySupported, const std::string &aubFileName);
|
||||
|
||||
class AubCenter {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "runtime/aub/aub_helper.h"
|
||||
#include "runtime/aub_mem_dump/aub_mem_dump.h"
|
||||
#include "runtime/helpers/basic_math.h"
|
||||
#include "runtime/os_interface/debug_settings_manager.h"
|
||||
|
||||
namespace OCLRT {
|
||||
@@ -26,8 +27,8 @@ uint32_t AubHelper::getMemType(uint32_t addressSpace) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t AubHelper::getMemBankSizeInGigabytes() {
|
||||
return 2;
|
||||
uint64_t AubHelper::getMemBankSize() {
|
||||
return 2 * GB;
|
||||
}
|
||||
|
||||
uint32_t AubHelper::getDevicesCount(const HardwareInfo *pHwInfo) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,7 +30,7 @@ class AubHelper : public NonCopyableOrMovableClass {
|
||||
static uint64_t getPTEntryBits(uint64_t pdEntryBits);
|
||||
static void checkPTEAddress(uint64_t address);
|
||||
static uint32_t getMemType(uint32_t addressSpace);
|
||||
static uint32_t getMemBankSizeInGigabytes();
|
||||
static uint64_t getMemBankSize();
|
||||
static uint32_t getDevicesCount(const HardwareInfo *pHwInfo);
|
||||
|
||||
virtual int getDataHintForPml4Entry() const = 0;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "runtime/aub/aub_center.h"
|
||||
using namespace AubDump;
|
||||
namespace OCLRT {
|
||||
AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, size_t memoryBankSizeInGB, bool localMemorySupported, uint32_t deviceId, const std::string &aubFileName) {
|
||||
return AubDump::AubManager::create(gfxFamily, devicesCount, memoryBankSizeInGB, localMemorySupported, deviceId, aubFileName);
|
||||
AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, bool localMemorySupported, const std::string &aubFileName) {
|
||||
return AubDump::AubManager::create(gfxFamily, devicesCount, memoryBankSize, localMemorySupported, aubFileName);
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace AubDump {
|
||||
|
||||
AubManager *AubManager::create(uint32_t gfxFamily, uint32_t devicesCount, size_t memoryBankSizeInGB, bool localMemorySupported, uint32_t deviceId, const std::string &aubFileName) {
|
||||
AubManager *AubManager::create(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSizeInGB, bool localMemorySupported, const std::string &aubFileName) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
3
third_party/aub_stream/headers/aub_manager.h
vendored
3
third_party/aub_stream/headers/aub_manager.h
vendored
@@ -17,8 +17,9 @@ class AubManager {
|
||||
public:
|
||||
virtual ~AubManager() = default;
|
||||
virtual HardwareContext *createHardwareContext(uint32_t device, uint32_t engine) = 0;
|
||||
virtual void writeMemory(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, int hint, size_t pageSize = 65536) = 0;
|
||||
|
||||
static AubManager *create(uint32_t gfxFamily, uint32_t devicesCount, size_t memoryBankSizeInGB, bool localMemorySupported, uint32_t deviceId, const std::string &aubFileName);
|
||||
static AubManager *create(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, bool localMemorySupported, const std::string &aubFileName);
|
||||
};
|
||||
|
||||
} // namespace AubDump
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "runtime/aub_mem_dump/aub_mem_dump.h"
|
||||
#include "runtime/aub_mem_dump/page_table_entry_bits.h"
|
||||
#include "runtime/command_stream/aub_command_stream_receiver_hw.h"
|
||||
#include "runtime/helpers/basic_math.h"
|
||||
#include "unit_tests/fixtures/device_fixture.h"
|
||||
#include "unit_tests/helpers/debug_manager_state_restore.h"
|
||||
#include "test.h"
|
||||
@@ -47,6 +48,11 @@ TEST(AubHelper, WhenCreateMultipleDevicesIsSetThenGetDevicesCountReturnedCorrect
|
||||
EXPECT_EQ(devicesCount, 1u);
|
||||
}
|
||||
|
||||
TEST(AubHelper, WhenGetMemBankSizeIsCalledThenItReturnsCorrectValue) {
|
||||
auto memBankSize = AubHelper::getMemBankSize();
|
||||
EXPECT_EQ(memBankSize, 2 * GB);
|
||||
}
|
||||
|
||||
typedef Test<DeviceFixture> AubHelperHwTest;
|
||||
|
||||
HWTEST_F(AubHelperHwTest, GivenDisabledLocalMemoryWhenGetDataHintForPml4EntryIsCalledThenTraceNotypeIsReturned) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "unit_tests/mocks/mock_aub_manager.h"
|
||||
|
||||
namespace OCLRT {
|
||||
AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, size_t memoryBankSizeInGB, bool localMemorySupported, uint32_t deviceId, const std::string &aubFileName) {
|
||||
AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, bool localMemorySupported, const std::string &aubFileName) {
|
||||
return new MockAubManager();
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -37,6 +37,7 @@ class MockAubManager : public AubManager {
|
||||
~MockAubManager() override {}
|
||||
|
||||
HardwareContext *createHardwareContext(uint32_t device, uint32_t engine) override { return new MockHardwareContext(); }
|
||||
void writeMemory(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, int hint, size_t pageSize = 65536) override {}
|
||||
|
||||
protected:
|
||||
HardwareContext *hardwareContext = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user