Update aub_stream headers

- pass hwInfo and localMemoryEnabled to AubCenter ctor
- initialize AubCenter in Platform:intialize() when Device is
 created - only when CSR is not CsrHw
- move aub_center files to runtime/aub directory

Change-Id: Iceb4bf1cb2bb55b42d438502cca667a449f11411
This commit is contained in:
Hoppe, Mateusz
2018-11-10 22:25:48 +01:00
committed by sys_ocldev
parent 12ece3a220
commit 0942edd6af
23 changed files with 205 additions and 144 deletions

View File

@@ -6,6 +6,8 @@
set(RUNTIME_SRCS_AUB
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/aub_center.cpp
${CMAKE_CURRENT_SOURCE_DIR}/aub_center.h
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/aub_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.h
${CMAKE_CURRENT_SOURCE_DIR}/aub_helper.inl

View File

@@ -0,0 +1,21 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/aub/aub_center.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/os_interface/debug_settings_manager.h"
namespace OCLRT {
AubCenter::AubCenter(const HardwareInfo *pHwInfo, bool localMemoryEnabled) {
if (DebugManager.flags.UseAubStream.get()) {
std::string filename("aub.aub");
aubManager.reset(AubDump::AubManager::create(pHwInfo->pPlatform->eRenderCoreFamily, 1, 1, localMemoryEnabled, filename));
}
addressMapper = std::make_unique<AddressMapper>();
streamProvider = std::make_unique<AubFileStreamProvider>();
}
} // namespace OCLRT

46
runtime/aub/aub_center.h Normal file
View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "runtime/command_stream/aub_stream_provider.h"
#include "runtime/memory_manager/address_mapper.h"
#include "runtime/memory_manager/physical_address_allocator.h"
#include "third_party/aub_stream/headers/aub_manager.h"
namespace OCLRT {
struct HardwareInfo;
class AubCenter {
public:
AubCenter(const HardwareInfo *pHwInfo, bool localMemoryEnabled);
virtual ~AubCenter() = default;
void initPhysicalAddressAllocator(PhysicalAddressAllocator *pPhysicalAddressAllocator) {
physicalAddressAllocator = std::unique_ptr<PhysicalAddressAllocator>(pPhysicalAddressAllocator);
}
PhysicalAddressAllocator *getPhysicalAddressAllocator() const {
return physicalAddressAllocator.get();
}
AddressMapper *getAddressMapper() const {
return addressMapper.get();
}
AubStreamProvider *getStreamProvider() const {
return streamProvider.get();
}
protected:
std::unique_ptr<PhysicalAddressAllocator> physicalAddressAllocator;
std::unique_ptr<AddressMapper> addressMapper;
std::unique_ptr<AubStreamProvider> streamProvider;
std::unique_ptr<AubDump::AubManager> aubManager;
};
} // namespace OCLRT