2021-02-16 18:20:34 +08:00
|
|
|
/*
|
2022-09-16 22:29:51 +08:00
|
|
|
* Copyright (C) 2022 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2021-02-16 18:20:34 +08:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
2022-09-16 22:29:51 +08:00
|
|
|
#include <type_traits>
|
2021-02-16 18:20:34 +08:00
|
|
|
|
|
|
|
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)
|
2022-09-16 22:29:51 +08:00
|
|
|
: gfxAddress(gfxAddress), memory(memory), size(size), memoryBanks(memoryBanks), hint(hint), pageSize(pageSize) {
|
2022-04-12 21:27:35 +08:00
|
|
|
additionalParams = {};
|
2021-02-16 18:20:34 +08:00
|
|
|
}
|
2022-09-16 22:29:51 +08:00
|
|
|
|
2021-02-16 18:20:34 +08:00
|
|
|
uint64_t gfxAddress = 0;
|
2022-09-16 22:29:51 +08:00
|
|
|
const void *memory = nullptr;
|
2021-02-16 18:20:34 +08:00
|
|
|
size_t size = 0;
|
2022-09-16 22:29:51 +08:00
|
|
|
uint32_t memoryBanks = 0;
|
2021-02-16 18:20:34 +08:00
|
|
|
int hint = 0;
|
2022-09-16 22:29:51 +08:00
|
|
|
size_t pageSize = 0;
|
2021-02-16 18:20:34 +08:00
|
|
|
|
|
|
|
struct AdditionalParams {
|
2022-09-16 22:29:51 +08:00
|
|
|
bool compressionEnabled : 1;
|
2022-04-12 21:27:35 +08:00
|
|
|
bool uncached : 1;
|
|
|
|
bool padding : 6;
|
2022-09-16 22:29:51 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
AdditionalParams additionalParams;
|
2021-02-16 18:20:34 +08:00
|
|
|
};
|
|
|
|
|
2022-09-16 22:29:51 +08:00
|
|
|
static_assert(std::is_standard_layout<AllocationParams>::value, "AllocationParams is not standard layout type");
|
|
|
|
|
2021-02-16 18:20:34 +08:00
|
|
|
} // namespace aub_stream
|