aub_stream interfaces update

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-02-16 10:20:34 +00:00
committed by Compute-Runtime-Automation
parent 6dd0f0c728
commit 584da13ff8
11 changed files with 110 additions and 35 deletions

View File

@ -0,0 +1,31 @@
/*
* Copyright (C) 2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstddef>
#include <cstdint>
namespace aub_stream {
struct AllocationParams {
AllocationParams() = delete;
AllocationParams(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, int hint, size_t pageSize)
: gfxAddress(gfxAddress), size(size), pageSize(pageSize), memoryBanks(memoryBanks), hint(hint), memory(memory) {
}
uint64_t gfxAddress = 0;
size_t size = 0;
size_t pageSize;
uint32_t memoryBanks;
int hint = 0;
const void *memory = nullptr;
struct AdditionalParams {
bool compressionEnabled = false;
} additionalParams;
};
} // namespace aub_stream

View File

@ -6,13 +6,15 @@
*/
#pragma once
#include "page_info.h"
#include <cstdint>
#include <string>
#include <vector>
#include "page_info.h"
namespace aub_stream {
struct AllocationParams;
struct HardwareContext;
class AubManager {
@ -28,7 +30,7 @@ class AubManager {
virtual void pause(bool onoff) = 0;
virtual void addComment(const char *message) = 0;
virtual void writeMemory(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks,int hint, size_t pageSize) = 0;
virtual void writeMemory(uint64_t gfxAddress, const void *memory, size_t size, uint32_t memoryBanks, int hint, size_t pageSize) = 0;
virtual void writePageTableEntries(uint64_t gfxAddress, size_t size, uint32_t memoryBanks, int hint,
std::vector<PageInfo> &lastLevelPages, size_t pageSize) = 0;
@ -37,6 +39,8 @@ class AubManager {
static AubManager *create(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping,
bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace);
virtual void writeMemory2(AllocationParams allocationParams) = 0;
};
} // namespace aub_stream

View File

@ -6,11 +6,12 @@
*/
#pragma once
#include <cstdint>
#include <cstddef>
#include <cstdint>
namespace aub_stream {
struct AllocationParams;
struct SurfaceInfo;
struct HardwareContext {
@ -25,6 +26,7 @@ struct HardwareContext {
virtual void dumpBufferBIN(uint64_t gfxAddress, size_t size) = 0;
virtual void dumpSurface(const SurfaceInfo &surfaceInfo) = 0;
virtual ~HardwareContext() = default;
virtual void writeMemory2(AllocationParams allocationParams) = 0;
};
} // namespace aub_stream

View File

@ -1,10 +1,13 @@
/*
* Copyright (C) 2018-2019 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include <cstddef>
#include <cstdint>
namespace aub_stream {
struct PageInfo {
@ -13,4 +16,4 @@ struct PageInfo {
bool isLocalMemory;
uint32_t memoryBank;
};
} // namespace aub_stream
} // namespace aub_stream