mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 15:03:02 +08:00
Add function to check if kernel has direct stateless access to host memory
Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b83922ecdb
commit
847bad4763
@@ -2464,6 +2464,18 @@ void Kernel::fillWithBuffersForAuxTranslation(MemObjsForAuxTranslation &memObjsF
|
||||
}
|
||||
}
|
||||
|
||||
bool Kernel::hasDirectStatelessAccessToHostMemory() const {
|
||||
for (uint32_t i = 0; i < getKernelArgsNumber(); i++) {
|
||||
if (BUFFER_OBJ == kernelArguments.at(i).type && !getDefaultKernelInfo().kernelArgInfo.at(i).pureStatefulBufferAccess) {
|
||||
auto buffer = castToObject<Buffer>(getKernelArg(i));
|
||||
if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Kernel::getAllocationsForCacheFlush(CacheFlushAllocationsVec &out, uint32_t rootDeviceIndex) const {
|
||||
if (false == HwHelper::cacheFlushAfterWalkerSupported(getHardwareInfo(rootDeviceIndex))) {
|
||||
return;
|
||||
|
||||
@@ -114,6 +114,8 @@ class Kernel : public BaseObject<_cl_kernel> {
|
||||
}
|
||||
|
||||
bool isAuxTranslationRequired() const { return auxTranslationRequired; }
|
||||
void setAuxTranslationRequired(bool onOff) { auxTranslationRequired = onOff; }
|
||||
void updateAuxTranslationRequired();
|
||||
|
||||
char *getCrossThreadData(uint32_t rootDeviceIndex) const {
|
||||
return kernelDeviceInfos[rootDeviceIndex].crossThreadData;
|
||||
@@ -491,6 +493,7 @@ class Kernel : public BaseObject<_cl_kernel> {
|
||||
void resolveArgs();
|
||||
|
||||
void reconfigureKernel(uint32_t rootDeviceIndex);
|
||||
bool hasDirectStatelessAccessToHostMemory() const;
|
||||
|
||||
void addAllocationToCacheFlushVector(uint32_t argIndex, GraphicsAllocation *argAllocation);
|
||||
bool allocationForCacheFlush(GraphicsAllocation *argAllocation) const;
|
||||
|
||||
@@ -41,4 +41,6 @@ int32_t Kernel::setAdditionalKernelExecInfoWithParam(uint32_t paramName, size_t
|
||||
return CL_INVALID_VALUE;
|
||||
}
|
||||
|
||||
void Kernel::updateAuxTranslationRequired() {
|
||||
}
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user