mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Reorganization directory structure [3/n]
Change-Id: If3dfa3f6007f8810a6a1ae1a4f0c7da38544648d
This commit is contained in:
80
shared/source/helpers/address_patch.h
Normal file
80
shared/source/helpers/address_patch.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
enum PatchInfoAllocationType {
|
||||
Default = 0,
|
||||
KernelArg,
|
||||
GeneralStateHeap,
|
||||
DynamicStateHeap,
|
||||
IndirectObjectHeap,
|
||||
SurfaceStateHeap,
|
||||
InstructionHeap,
|
||||
TagAddress,
|
||||
TagValue,
|
||||
GUCStartMessage,
|
||||
ScratchSpace
|
||||
};
|
||||
|
||||
struct PatchInfoData {
|
||||
uint64_t sourceAllocation;
|
||||
uint64_t sourceAllocationOffset;
|
||||
PatchInfoAllocationType sourceType;
|
||||
uint64_t targetAllocation;
|
||||
uint64_t targetAllocationOffset;
|
||||
PatchInfoAllocationType targetType;
|
||||
uint32_t patchAddressSize;
|
||||
|
||||
PatchInfoData(uint64_t sourceAllocation,
|
||||
uint64_t sourceAllocationOffset,
|
||||
PatchInfoAllocationType sourceType,
|
||||
uint64_t targetAllocation,
|
||||
uint64_t targetAllocationOffset,
|
||||
PatchInfoAllocationType targetType,
|
||||
uint32_t patchAddressSize)
|
||||
: sourceAllocation(sourceAllocation),
|
||||
sourceAllocationOffset(sourceAllocationOffset),
|
||||
sourceType(sourceType),
|
||||
targetAllocation(targetAllocation),
|
||||
targetAllocationOffset(targetAllocationOffset),
|
||||
targetType(targetType),
|
||||
patchAddressSize(patchAddressSize) {
|
||||
}
|
||||
|
||||
PatchInfoData(uint64_t sourceAllocation,
|
||||
uint64_t sourceAllocationOffset,
|
||||
PatchInfoAllocationType sourceType,
|
||||
uint64_t targetAllocation,
|
||||
uint64_t targetAllocationOffset,
|
||||
PatchInfoAllocationType targetType)
|
||||
: sourceAllocation(sourceAllocation),
|
||||
sourceAllocationOffset(sourceAllocationOffset),
|
||||
sourceType(sourceType),
|
||||
targetAllocation(targetAllocation),
|
||||
targetAllocationOffset(targetAllocationOffset),
|
||||
targetType(targetType),
|
||||
patchAddressSize(sizeof(void *)) {
|
||||
}
|
||||
|
||||
bool requiresIndirectPatching() {
|
||||
return (targetType != PatchInfoAllocationType::Default && targetType != PatchInfoAllocationType::GUCStartMessage);
|
||||
}
|
||||
};
|
||||
|
||||
struct CommandChunk {
|
||||
uint64_t baseAddressCpu = 0;
|
||||
uint64_t baseAddressGpu = 0;
|
||||
uint64_t startOffset = 0;
|
||||
uint64_t endOffset = 0;
|
||||
uint64_t batchBufferStartLocation = 0;
|
||||
uint64_t batchBufferStartAddress = 0;
|
||||
};
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user