mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Rename AllocationType to FragmentPosition
- better reflects enums usage - make the type scoped enum Change-Id: Id2712e43028258ffc038a5738ec9e546d19d9e2e
This commit is contained in:

committed by
sys_ocldev

parent
0a1c4a5e41
commit
c34ed02f57
@ -31,7 +31,7 @@ typedef OsHandle OsGraphicsHandle;
|
||||
|
||||
const int max_fragments_count = 3;
|
||||
|
||||
enum AllocationType {
|
||||
enum class FragmentPosition {
|
||||
NONE = 0,
|
||||
LEADING,
|
||||
MIDDLE,
|
||||
@ -59,7 +59,7 @@ struct ResidencyData {
|
||||
};
|
||||
|
||||
struct PartialAllocation {
|
||||
int allocationType = NONE;
|
||||
FragmentPosition fragmentPosition = FragmentPosition::NONE;
|
||||
const void *allocationPtr = nullptr;
|
||||
size_t allocationSize = 0u;
|
||||
};
|
||||
|
@ -70,7 +70,7 @@ AllocationRequirements OCLRT::HostPtrManager::getAllocationRequirements(const vo
|
||||
if (alignedStartAddress != inputPtr) {
|
||||
leadingNeeded = true;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationPtr = alignedStartAddress;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationType = LEADING;
|
||||
requiredAllocations.AllocationFragments[allocationCount].fragmentPosition = FragmentPosition::LEADING;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationSize = MemoryConstants::pageSize;
|
||||
allocationCount++;
|
||||
}
|
||||
@ -86,14 +86,14 @@ AllocationRequirements OCLRT::HostPtrManager::getAllocationRequirements(const vo
|
||||
auto middleSize = wholeAllocationSize - (trailingNeeded + leadingNeeded) * MemoryConstants::pageSize;
|
||||
if (middleSize) {
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationPtr = alignUp(inputPtr, MemoryConstants::pageSize);
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationType = MIDDLE;
|
||||
requiredAllocations.AllocationFragments[allocationCount].fragmentPosition = FragmentPosition::MIDDLE;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationSize = middleSize;
|
||||
allocationCount++;
|
||||
}
|
||||
|
||||
if (trailingNeeded) {
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationPtr = alignedEndAddress;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationType = TRAILING;
|
||||
requiredAllocations.AllocationFragments[allocationCount].fragmentPosition = FragmentPosition::TRAILING;
|
||||
requiredAllocations.AllocationFragments[allocationCount].allocationSize = MemoryConstants::pageSize;
|
||||
allocationCount++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user