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:
Slawomir Milczarek
2020-12-15 17:13:28 +00:00
committed by Compute-Runtime-Automation
parent b83922ecdb
commit 847bad4763
6 changed files with 72 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -41,4 +41,6 @@ int32_t Kernel::setAdditionalKernelExecInfoWithParam(uint32_t paramName, size_t
return CL_INVALID_VALUE;
}
void Kernel::updateAuxTranslationRequired() {
}
} // namespace NEO