mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Revert "Create a new class for handling multi device SVM arguments in kernel"
This reverts commit 00b2a28818.
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fa80f60ab5
commit
f583ec7d8f
@@ -4799,7 +4799,7 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MultiGraphicsAllocation *pSvmAllocs = nullptr;
|
GraphicsAllocation *pSvmAlloc = nullptr;
|
||||||
if (argValue != nullptr) {
|
if (argValue != nullptr) {
|
||||||
auto svmManager = pKernel->getContext().getSVMAllocsManager();
|
auto svmManager = pKernel->getContext().getSVMAllocsManager();
|
||||||
auto svmData = svmManager->getSVMAlloc(argValue);
|
auto svmData = svmManager->getSVMAlloc(argValue);
|
||||||
@@ -4812,11 +4812,11 @@ cl_int CL_API_CALL clSetKernelArgSVMPointer(cl_kernel kernel,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pSvmAllocs = &svmData->gpuAllocations;
|
pSvmAlloc = svmData->gpuAllocations.getGraphicsAllocation(pKernel->getDevices()[0]->getRootDeviceIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal = pKernel->setArgMultiDeviceSvmAlloc(argIndex, const_cast<void *>(argValue), pSvmAllocs);
|
retVal = pKernel->setArgSvmAlloc(argIndex, const_cast<void *>(argValue), pSvmAlloc);
|
||||||
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
|
TRACING_EXIT(clSetKernelArgSVMPointer, &retVal);
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -323,9 +323,8 @@ class BuiltInOp<EBuiltInOps::FillBuffer> : public BuiltinDispatchInfoBuilder {
|
|||||||
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Right, 1, static_cast<OffsetType>(operationParams.dstOffset.x + leftSize + middleSizeBytes));
|
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Right, 1, static_cast<OffsetType>(operationParams.dstOffset.x + leftSize + middleSizeBytes));
|
||||||
|
|
||||||
// Set-up srcMemObj with pattern
|
// Set-up srcMemObj with pattern
|
||||||
auto multiGraphicsAllocation = &operationParams.srcMemObj->getMultiGraphicsAllocation();
|
auto graphicsAllocation = operationParams.srcMemObj->getMultiGraphicsAllocation().getDefaultGraphicsAllocation();
|
||||||
auto graphicsAllocation = multiGraphicsAllocation->getDefaultGraphicsAllocation();
|
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), graphicsAllocation->getUnderlyingBuffer(), graphicsAllocation, CL_MEM_READ_ONLY);
|
||||||
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), graphicsAllocation->getUnderlyingBuffer(), multiGraphicsAllocation, CL_MEM_READ_ONLY);
|
|
||||||
|
|
||||||
// Set-up patternSizeInEls
|
// Set-up patternSizeInEls
|
||||||
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Left, 3, static_cast<OffsetType>(operationParams.srcMemObj->getSize()));
|
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Left, 3, static_cast<OffsetType>(operationParams.srcMemObj->getSize()));
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ set(RUNTIME_SRCS_KERNEL
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_cl.h
|
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_cl.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_objects_for_aux_translation.h
|
${CMAKE_CURRENT_SOURCE_DIR}/kernel_objects_for_aux_translation.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/kernel_extra.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/kernel_extra.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/svm_object_arg.cpp
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/svm_object_arg.h
|
|
||||||
)
|
)
|
||||||
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_KERNEL})
|
target_sources(${NEO_STATIC_LIB_NAME} PRIVATE ${RUNTIME_SRCS_KERNEL})
|
||||||
set_property(GLOBAL PROPERTY RUNTIME_SRCS_KERNEL ${RUNTIME_SRCS_KERNEL})
|
set_property(GLOBAL PROPERTY RUNTIME_SRCS_KERNEL ${RUNTIME_SRCS_KERNEL})
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
#include "opencl/source/kernel/image_transformer.h"
|
#include "opencl/source/kernel/image_transformer.h"
|
||||||
#include "opencl/source/kernel/kernel.inl"
|
#include "opencl/source/kernel/kernel.inl"
|
||||||
#include "opencl/source/kernel/kernel_info_cl.h"
|
#include "opencl/source/kernel/kernel_info_cl.h"
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/source/mem_obj/buffer.h"
|
#include "opencl/source/mem_obj/buffer.h"
|
||||||
#include "opencl/source/mem_obj/image.h"
|
#include "opencl/source/mem_obj/image.h"
|
||||||
#include "opencl/source/mem_obj/pipe.h"
|
#include "opencl/source/mem_obj/pipe.h"
|
||||||
@@ -102,14 +101,11 @@ Kernel::~Kernel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (uint32_t i = 0; i < patchedArgumentsNum; i++) {
|
for (uint32_t i = 0; i < patchedArgumentsNum; i++) {
|
||||||
if (SAMPLER_OBJ == kernelArguments[i].type) {
|
if (SAMPLER_OBJ == getKernelArguments()[i].type) {
|
||||||
auto sampler = castToObject<Sampler>(kernelArguments[i].object);
|
auto sampler = castToObject<Sampler>(kernelArguments.at(i).object);
|
||||||
if (sampler) {
|
if (sampler) {
|
||||||
sampler->decRefInternal();
|
sampler->decRefInternal();
|
||||||
}
|
}
|
||||||
} else if (SVM_ALLOC_OBJ == kernelArguments[i].type) {
|
|
||||||
auto svmObjectArg = reinterpret_cast<SvmObjectArg *>(kernelArguments[i].object);
|
|
||||||
delete svmObjectArg;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +375,6 @@ cl_int Kernel::initialize() {
|
|||||||
}
|
}
|
||||||
auto numArgs = kernelInfo.kernelArgInfo.size();
|
auto numArgs = kernelInfo.kernelArgInfo.size();
|
||||||
kernelDeviceInfo.slmSizes.resize(numArgs);
|
kernelDeviceInfo.slmSizes.resize(numArgs);
|
||||||
kernelDeviceInfo.kernelArgRequiresCacheFlush.resize(numArgs);
|
|
||||||
isDeviceInitialized.set(rootDeviceIndex);
|
isDeviceInitialized.set(rootDeviceIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,6 +388,7 @@ cl_int Kernel::initialize() {
|
|||||||
auto numArgs = defaultKernelInfo.kernelArgInfo.size();
|
auto numArgs = defaultKernelInfo.kernelArgInfo.size();
|
||||||
kernelArguments.resize(numArgs);
|
kernelArguments.resize(numArgs);
|
||||||
kernelArgHandlers.resize(numArgs);
|
kernelArgHandlers.resize(numArgs);
|
||||||
|
kernelArgRequiresCacheFlush.resize(numArgs);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < numArgs; ++i) {
|
for (uint32_t i = 0; i < numArgs; ++i) {
|
||||||
storeKernelArg(i, NONE_OBJ, nullptr, nullptr, 0);
|
storeKernelArg(i, NONE_OBJ, nullptr, nullptr, 0);
|
||||||
@@ -456,11 +452,11 @@ cl_int Kernel::cloneKernel(Kernel *pSourceKernel) {
|
|||||||
break;
|
break;
|
||||||
case SVM_OBJ:
|
case SVM_OBJ:
|
||||||
setArgSvm(i, pSourceKernel->getKernelArgInfo(i).size, const_cast<void *>(pSourceKernel->getKernelArgInfo(i).value),
|
setArgSvm(i, pSourceKernel->getKernelArgInfo(i).size, const_cast<void *>(pSourceKernel->getKernelArgInfo(i).value),
|
||||||
pSourceKernel->getKernelArgInfo(i).pSvmAllocs, pSourceKernel->getKernelArgInfo(i).svmFlags);
|
pSourceKernel->getKernelArgInfo(i).pSvmAlloc, pSourceKernel->getKernelArgInfo(i).svmFlags);
|
||||||
break;
|
break;
|
||||||
case SVM_ALLOC_OBJ:
|
case SVM_ALLOC_OBJ:
|
||||||
setArgMultiDeviceSvmAlloc(i, const_cast<void *>(pSourceKernel->getKernelArgInfo(i).value),
|
setArgSvmAlloc(i, const_cast<void *>(pSourceKernel->getKernelArgInfo(i).value),
|
||||||
reinterpret_cast<SvmObjectArg *>(pSourceKernel->getKernelArgInfo(i).object)->getMultiDeviceSvmAlloc());
|
(GraphicsAllocation *)pSourceKernel->getKernelArgInfo(i).object);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
setArg(i, pSourceKernel->getKernelArgInfo(i).size, pSourceKernel->getKernelArgInfo(i).value);
|
setArg(i, pSourceKernel->getKernelArgInfo(i).size, pSourceKernel->getKernelArgInfo(i).value);
|
||||||
@@ -930,41 +926,37 @@ void *Kernel::patchBufferOffset(const KernelArgInfo &argInfo, void *svmPtr, Grap
|
|||||||
return ptrToPatch;
|
return ptrToPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
cl_int Kernel::setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, const MultiGraphicsAllocation *svmAllocs, cl_mem_flags svmFlags) {
|
cl_int Kernel::setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, GraphicsAllocation *svmAlloc, cl_mem_flags svmFlags) {
|
||||||
|
auto rootDeviceIndex = getDevice().getRootDeviceIndex();
|
||||||
|
auto &kernelInfo = getKernelInfo(rootDeviceIndex);
|
||||||
|
void *ptrToPatch = patchBufferOffset(kernelInfo.kernelArgInfo[argIndex], svmPtr, svmAlloc, rootDeviceIndex);
|
||||||
setArgImmediate(argIndex, sizeof(void *), &svmPtr);
|
setArgImmediate(argIndex, sizeof(void *), &svmPtr);
|
||||||
storeKernelArg(argIndex, SVM_OBJ, nullptr, svmPtr, sizeof(void *), svmAllocs, svmFlags);
|
|
||||||
|
|
||||||
std::bitset<64> isArgSet{};
|
storeKernelArg(argIndex, SVM_OBJ, nullptr, svmPtr, sizeof(void *), svmAlloc, svmFlags);
|
||||||
|
|
||||||
for (const auto &pClDevice : getDevices()) {
|
if (requiresSshForBuffers(rootDeviceIndex)) {
|
||||||
auto rootDeviceIndex = pClDevice->getRootDeviceIndex();
|
const auto &kernelArgInfo = kernelInfo.kernelArgInfo[argIndex];
|
||||||
if (isArgSet.test(rootDeviceIndex)) {
|
auto surfaceState = ptrOffset(getSurfaceStateHeap(rootDeviceIndex), kernelArgInfo.offsetHeap);
|
||||||
continue;
|
Buffer::setSurfaceState(&getDevice().getDevice(), surfaceState, false, false, svmAllocSize + ptrDiff(svmPtr, ptrToPatch), ptrToPatch, 0, svmAlloc, svmFlags, 0);
|
||||||
}
|
|
||||||
|
|
||||||
auto svmAlloc = svmAllocs ? svmAllocs->getGraphicsAllocation(rootDeviceIndex) : nullptr;
|
|
||||||
auto &kernelInfo = getKernelInfo(rootDeviceIndex);
|
|
||||||
void *ptrToPatch = patchBufferOffset(kernelInfo.kernelArgInfo[argIndex], svmPtr, svmAlloc, rootDeviceIndex);
|
|
||||||
|
|
||||||
if (requiresSshForBuffers(rootDeviceIndex)) {
|
|
||||||
const auto &kernelArgInfo = kernelInfo.kernelArgInfo[argIndex];
|
|
||||||
auto surfaceState = ptrOffset(getSurfaceStateHeap(rootDeviceIndex), kernelArgInfo.offsetHeap);
|
|
||||||
Buffer::setSurfaceState(&pClDevice->getDevice(), surfaceState, false, false, svmAllocSize + ptrDiff(svmPtr, ptrToPatch), ptrToPatch, 0, svmAlloc, svmFlags, 0);
|
|
||||||
}
|
|
||||||
addAllocationToCacheFlushVector(argIndex, svmAlloc, rootDeviceIndex);
|
|
||||||
isArgSet.set(rootDeviceIndex);
|
|
||||||
}
|
}
|
||||||
if (!kernelArguments[argIndex].isPatched) {
|
if (!kernelArguments[argIndex].isPatched) {
|
||||||
patchedArgumentsNum++;
|
patchedArgumentsNum++;
|
||||||
kernelArguments[argIndex].isPatched = true;
|
kernelArguments[argIndex].isPatched = true;
|
||||||
}
|
}
|
||||||
|
addAllocationToCacheFlushVector(argIndex, svmAlloc);
|
||||||
|
|
||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
void Kernel::setArgSvmAllocForSingleDevice(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc, const Device &device) {
|
|
||||||
auto rootDeviceIndex = device.getRootDeviceIndex();
|
cl_int Kernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc) {
|
||||||
|
DBG_LOG_INPUTS("setArgBuffer svm_alloc", svmAlloc);
|
||||||
|
|
||||||
|
auto rootDeviceIndex = getDevice().getRootDeviceIndex();
|
||||||
auto &kernelInfo = getKernelInfo(rootDeviceIndex);
|
auto &kernelInfo = getKernelInfo(rootDeviceIndex);
|
||||||
const auto &kernelArgInfo = kernelInfo.kernelArgInfo[argIndex];
|
const auto &kernelArgInfo = kernelInfo.kernelArgInfo[argIndex];
|
||||||
|
|
||||||
|
storeKernelArg(argIndex, SVM_ALLOC_OBJ, svmAlloc, svmPtr, sizeof(uintptr_t));
|
||||||
|
|
||||||
void *ptrToPatch = patchBufferOffset(kernelArgInfo, svmPtr, svmAlloc, rootDeviceIndex);
|
void *ptrToPatch = patchBufferOffset(kernelArgInfo, svmPtr, svmAlloc, rootDeviceIndex);
|
||||||
|
|
||||||
auto patchLocation = ptrOffset(getCrossThreadData(rootDeviceIndex),
|
auto patchLocation = ptrOffset(getCrossThreadData(rootDeviceIndex),
|
||||||
@@ -999,62 +991,27 @@ void Kernel::setArgSvmAllocForSingleDevice(uint32_t argIndex, void *svmPtr, Grap
|
|||||||
offset = ptrDiff(ptrToPatch, svmAlloc->getGpuAddressToPatch());
|
offset = ptrDiff(ptrToPatch, svmAlloc->getGpuAddressToPatch());
|
||||||
allocSize -= offset;
|
allocSize -= offset;
|
||||||
}
|
}
|
||||||
Buffer::setSurfaceState(&device, surfaceState, forceNonAuxMode, disableL3, allocSize, ptrToPatch, offset, svmAlloc, 0, 0);
|
Buffer::setSurfaceState(&getDevice().getDevice(), surfaceState, forceNonAuxMode, disableL3, allocSize, ptrToPatch, offset, svmAlloc, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
addAllocationToCacheFlushVector(argIndex, svmAlloc, rootDeviceIndex);
|
|
||||||
}
|
|
||||||
cl_int Kernel::setArgMultiDeviceSvmAlloc(uint32_t argIndex, void *svmPtr, MultiGraphicsAllocation *svmAllocs) {
|
|
||||||
DBG_LOG_INPUTS("setArgMultiDeviceSvmAlloc svm_allocs", svmAllocs);
|
|
||||||
if (kernelArguments[argIndex].object) {
|
|
||||||
delete reinterpret_cast<SvmObjectArg *>(kernelArguments[argIndex].object);
|
|
||||||
}
|
|
||||||
storeKernelArg(argIndex, SVM_ALLOC_OBJ, new SvmObjectArg(svmAllocs), svmPtr, sizeof(uintptr_t));
|
|
||||||
|
|
||||||
std::bitset<64> isArgSet{};
|
|
||||||
|
|
||||||
for (const auto &pClDevice : getDevices()) {
|
|
||||||
auto rootDeviceIndex = pClDevice->getRootDeviceIndex();
|
|
||||||
if (isArgSet.test(rootDeviceIndex)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
auto pSvmAlloc = svmAllocs ? svmAllocs->getGraphicsAllocation(rootDeviceIndex) : nullptr;
|
|
||||||
setArgSvmAllocForSingleDevice(argIndex, svmPtr, pSvmAlloc, pClDevice->getDevice());
|
|
||||||
isArgSet.set(rootDeviceIndex);
|
|
||||||
}
|
|
||||||
if (!kernelArguments[argIndex].isPatched) {
|
if (!kernelArguments[argIndex].isPatched) {
|
||||||
patchedArgumentsNum++;
|
patchedArgumentsNum++;
|
||||||
kernelArguments[argIndex].isPatched = true;
|
kernelArguments[argIndex].isPatched = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CL_SUCCESS;
|
addAllocationToCacheFlushVector(argIndex, svmAlloc);
|
||||||
}
|
|
||||||
|
|
||||||
cl_int Kernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc) {
|
|
||||||
DBG_LOG_INPUTS("setArgSvmAlloc svm_alloc", svmAlloc);
|
|
||||||
if (kernelArguments[argIndex].object && SVM_ALLOC_OBJ == kernelArguments[argIndex].type) {
|
|
||||||
delete reinterpret_cast<SvmObjectArg *>(kernelArguments[argIndex].object);
|
|
||||||
}
|
|
||||||
storeKernelArg(argIndex, SVM_ALLOC_OBJ, new SvmObjectArg(svmAlloc), svmPtr, sizeof(uintptr_t));
|
|
||||||
|
|
||||||
setArgSvmAllocForSingleDevice(argIndex, svmPtr, svmAlloc, getDevice().getDevice());
|
|
||||||
|
|
||||||
if (!kernelArguments[argIndex].isPatched) {
|
|
||||||
patchedArgumentsNum++;
|
|
||||||
kernelArguments[argIndex].isPatched = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kernel::storeKernelArg(uint32_t argIndex, kernelArgType argType, void *argObject,
|
void Kernel::storeKernelArg(uint32_t argIndex, kernelArgType argType, void *argObject,
|
||||||
const void *argValue, size_t argSize,
|
const void *argValue, size_t argSize,
|
||||||
const MultiGraphicsAllocation *argSvmAllocs, cl_mem_flags argSvmFlags) {
|
GraphicsAllocation *argSvmAlloc, cl_mem_flags argSvmFlags) {
|
||||||
kernelArguments[argIndex].type = argType;
|
kernelArguments[argIndex].type = argType;
|
||||||
kernelArguments[argIndex].object = argObject;
|
kernelArguments[argIndex].object = argObject;
|
||||||
kernelArguments[argIndex].value = argValue;
|
kernelArguments[argIndex].value = argValue;
|
||||||
kernelArguments[argIndex].size = argSize;
|
kernelArguments[argIndex].size = argSize;
|
||||||
kernelArguments[argIndex].pSvmAllocs = argSvmAllocs;
|
kernelArguments[argIndex].pSvmAlloc = argSvmAlloc;
|
||||||
kernelArguments[argIndex].svmFlags = argSvmFlags;
|
kernelArguments[argIndex].svmFlags = argSvmFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1178,12 +1135,11 @@ uint32_t Kernel::getMaxWorkGroupCount(const cl_uint workDim, const size_t *local
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Kernel::makeArgsResident(CommandStreamReceiver &commandStreamReceiver) {
|
inline void Kernel::makeArgsResident(CommandStreamReceiver &commandStreamReceiver) {
|
||||||
auto rootDeviceIndex = commandStreamReceiver.getRootDeviceIndex();
|
auto numArgs = kernelInfos[commandStreamReceiver.getRootDeviceIndex()]->kernelArgInfo.size();
|
||||||
auto numArgs = kernelInfos[rootDeviceIndex]->kernelArgInfo.size();
|
|
||||||
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
||||||
if (kernelArguments[argIndex].object) {
|
if (kernelArguments[argIndex].object) {
|
||||||
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
||||||
auto pSVMAlloc = reinterpret_cast<SvmObjectArg *>(kernelArguments[argIndex].object)->getGraphicsAllocation(rootDeviceIndex);
|
auto pSVMAlloc = (GraphicsAllocation *)kernelArguments[argIndex].object;
|
||||||
auto pageFaultManager = executionEnvironment.memoryManager->getPageFaultManager();
|
auto pageFaultManager = executionEnvironment.memoryManager->getPageFaultManager();
|
||||||
if (pageFaultManager &&
|
if (pageFaultManager &&
|
||||||
this->isUnifiedMemorySyncRequired) {
|
this->isUnifiedMemorySyncRequired) {
|
||||||
@@ -1197,8 +1153,8 @@ inline void Kernel::makeArgsResident(CommandStreamReceiver &commandStreamReceive
|
|||||||
if (image && image->isImageFromImage()) {
|
if (image && image->isImageFromImage()) {
|
||||||
commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushBefore);
|
commandStreamReceiver.setSamplerCacheFlushRequired(CommandStreamReceiver::SamplerCacheFlushState::samplerCacheFlushBefore);
|
||||||
}
|
}
|
||||||
memObj->getMigrateableMultiGraphicsAllocation().ensureMemoryOnDevice(*executionEnvironment.memoryManager, rootDeviceIndex);
|
memObj->getMigrateableMultiGraphicsAllocation().ensureMemoryOnDevice(*executionEnvironment.memoryManager, commandStreamReceiver.getRootDeviceIndex());
|
||||||
commandStreamReceiver.makeResident(*memObj->getGraphicsAllocation(rootDeviceIndex));
|
commandStreamReceiver.makeResident(*memObj->getGraphicsAllocation(commandStreamReceiver.getRootDeviceIndex()));
|
||||||
if (memObj->getMcsAllocation()) {
|
if (memObj->getMcsAllocation()) {
|
||||||
commandStreamReceiver.makeResident(*memObj->getMcsAllocation());
|
commandStreamReceiver.makeResident(*memObj->getMcsAllocation());
|
||||||
}
|
}
|
||||||
@@ -1370,7 +1326,7 @@ void Kernel::getResidency(std::vector<Surface *> &dst, uint32_t rootDeviceIndex)
|
|||||||
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
||||||
if (kernelArguments[argIndex].object) {
|
if (kernelArguments[argIndex].object) {
|
||||||
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
||||||
auto pSVMAlloc = reinterpret_cast<SvmObjectArg *>(kernelArguments[argIndex].object)->getGraphicsAllocation(rootDeviceIndex);
|
auto pSVMAlloc = (GraphicsAllocation *)kernelArguments[argIndex].object;
|
||||||
dst.push_back(new GeneralSurface(pSVMAlloc));
|
dst.push_back(new GeneralSurface(pSVMAlloc));
|
||||||
} else if (Kernel::isMemObj(kernelArguments[argIndex].type)) {
|
} else if (Kernel::isMemObj(kernelArguments[argIndex].type)) {
|
||||||
auto clMem = const_cast<cl_mem>(static_cast<const _cl_mem *>(kernelArguments[argIndex].object));
|
auto clMem = const_cast<cl_mem>(static_cast<const _cl_mem *>(kernelArguments[argIndex].object));
|
||||||
@@ -1395,7 +1351,8 @@ bool Kernel::requiresCoherency() {
|
|||||||
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
for (decltype(numArgs) argIndex = 0; argIndex < numArgs; argIndex++) {
|
||||||
if (kernelArguments[argIndex].object) {
|
if (kernelArguments[argIndex].object) {
|
||||||
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
if (kernelArguments[argIndex].type == SVM_ALLOC_OBJ) {
|
||||||
if (reinterpret_cast<SvmObjectArg *>(kernelArguments[argIndex].object)->isCoherent()) {
|
auto pSVMAlloc = (GraphicsAllocation *)kernelArguments[argIndex].object;
|
||||||
|
if (pSVMAlloc->isCoherent()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1544,7 +1501,7 @@ cl_int Kernel::setArgBuffer(uint32_t argIndex,
|
|||||||
allocationForCacheFlush = nullptr;
|
allocationForCacheFlush = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
addAllocationToCacheFlushVector(argIndex, allocationForCacheFlush, rootDeviceIndex);
|
addAllocationToCacheFlushVector(argIndex, allocationForCacheFlush);
|
||||||
isArgSet.set(rootDeviceIndex);
|
isArgSet.set(rootDeviceIndex);
|
||||||
}
|
}
|
||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
@@ -1689,7 +1646,7 @@ cl_int Kernel::setArgImageWithMipLevel(uint32_t argIndex,
|
|||||||
patch<uint32_t, size_t>((imageDesc.image_height * pixelSize) - 1, crossThreadData, kernelArgInfo.offsetFlatHeight);
|
patch<uint32_t, size_t>((imageDesc.image_height * pixelSize) - 1, crossThreadData, kernelArgInfo.offsetFlatHeight);
|
||||||
patch<uint32_t, size_t>(imageDesc.image_row_pitch - 1, crossThreadData, kernelArgInfo.offsetFlatPitch);
|
patch<uint32_t, size_t>(imageDesc.image_row_pitch - 1, crossThreadData, kernelArgInfo.offsetFlatPitch);
|
||||||
|
|
||||||
addAllocationToCacheFlushVector(argIndex, graphicsAllocation, rootDeviceIndex);
|
addAllocationToCacheFlushVector(argIndex, graphicsAllocation);
|
||||||
retVal = CL_SUCCESS;
|
retVal = CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2630,7 +2587,7 @@ void Kernel::fillWithKernelObjsForAuxTranslation(KernelObjsForAuxTranslation &ke
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SVM_ALLOC_OBJ == getKernelArguments().at(i).type && !kernelInfo.kernelArgInfo.at(i).pureStatefulBufferAccess) {
|
if (SVM_ALLOC_OBJ == getKernelArguments().at(i).type && !kernelInfo.kernelArgInfo.at(i).pureStatefulBufferAccess) {
|
||||||
auto svmAlloc = reinterpret_cast<SvmObjectArg *>(kernelArguments[i].object)->getGraphicsAllocation(rootDeviceIndex);
|
auto svmAlloc = reinterpret_cast<GraphicsAllocation *>(const_cast<void *>(getKernelArg(i)));
|
||||||
if (svmAlloc && svmAlloc->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
|
if (svmAlloc && svmAlloc->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
|
||||||
kernelObjsForAuxTranslation.insert({KernelObjForAuxTranslation::Type::GFX_ALLOC, svmAlloc});
|
kernelObjsForAuxTranslation.insert({KernelObjForAuxTranslation::Type::GFX_ALLOC, svmAlloc});
|
||||||
auto &context = this->program->getContext();
|
auto &context = this->program->getContext();
|
||||||
@@ -2652,8 +2609,8 @@ bool Kernel::hasDirectStatelessAccessToHostMemory() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SVM_ALLOC_OBJ == kernelArguments.at(i).type && !getDefaultKernelInfo().kernelArgInfo.at(i).pureStatefulBufferAccess) {
|
if (SVM_ALLOC_OBJ == kernelArguments.at(i).type && !getDefaultKernelInfo().kernelArgInfo.at(i).pureStatefulBufferAccess) {
|
||||||
auto svmObjectArg = reinterpret_cast<SvmObjectArg *>(kernelArguments[i].object);
|
auto svmAlloc = reinterpret_cast<const GraphicsAllocation *>(getKernelArg(i));
|
||||||
if (svmObjectArg && svmObjectArg->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) {
|
if (svmAlloc && svmAlloc->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2683,7 +2640,7 @@ void Kernel::getAllocationsForCacheFlush(CacheFlushAllocationsVec &out, uint32_t
|
|||||||
if (false == HwHelper::cacheFlushAfterWalkerSupported(getHardwareInfo(rootDeviceIndex))) {
|
if (false == HwHelper::cacheFlushAfterWalkerSupported(getHardwareInfo(rootDeviceIndex))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (GraphicsAllocation *alloc : this->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush) {
|
for (GraphicsAllocation *alloc : this->kernelArgRequiresCacheFlush) {
|
||||||
if (nullptr == alloc) {
|
if (nullptr == alloc) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2709,8 +2666,7 @@ bool Kernel::allocationForCacheFlush(GraphicsAllocation *argAllocation) const {
|
|||||||
return argAllocation->isFlushL3Required();
|
return argAllocation->isFlushL3Required();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kernel::addAllocationToCacheFlushVector(uint32_t argIndex, GraphicsAllocation *argAllocation, uint32_t rootDeviceIndex) {
|
void Kernel::addAllocationToCacheFlushVector(uint32_t argIndex, GraphicsAllocation *argAllocation) {
|
||||||
auto &kernelArgRequiresCacheFlush = kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
|
||||||
if (argAllocation == nullptr) {
|
if (argAllocation == nullptr) {
|
||||||
kernelArgRequiresCacheFlush[argIndex] = nullptr;
|
kernelArgRequiresCacheFlush[argIndex] = nullptr;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
void *object;
|
void *object;
|
||||||
const void *value;
|
const void *value;
|
||||||
size_t size;
|
size_t size;
|
||||||
const MultiGraphicsAllocation *pSvmAllocs;
|
GraphicsAllocation *pSvmAlloc;
|
||||||
cl_mem_flags svmFlags;
|
cl_mem_flags svmFlags;
|
||||||
bool isPatched = false;
|
bool isPatched = false;
|
||||||
bool isStatelessUncacheable = false;
|
bool isStatelessUncacheable = false;
|
||||||
@@ -148,9 +148,8 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
|
|
||||||
// API entry points
|
// API entry points
|
||||||
cl_int setArg(uint32_t argIndex, size_t argSize, const void *argVal);
|
cl_int setArg(uint32_t argIndex, size_t argSize, const void *argVal);
|
||||||
cl_int setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, const MultiGraphicsAllocation *svmAlloc, cl_mem_flags svmFlags);
|
cl_int setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, GraphicsAllocation *svmAlloc, cl_mem_flags svmFlags);
|
||||||
cl_int setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc);
|
cl_int setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc);
|
||||||
cl_int setArgMultiDeviceSvmAlloc(uint32_t argIndex, void *svmPtr, MultiGraphicsAllocation *svmAlloc);
|
|
||||||
|
|
||||||
void setSvmKernelExecInfo(GraphicsAllocation *argValue);
|
void setSvmKernelExecInfo(GraphicsAllocation *argValue);
|
||||||
void clearSvmKernelExecInfo();
|
void clearSvmKernelExecInfo();
|
||||||
@@ -294,7 +293,7 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
void *argObject,
|
void *argObject,
|
||||||
const void *argValue,
|
const void *argValue,
|
||||||
size_t argSize,
|
size_t argSize,
|
||||||
const MultiGraphicsAllocation *argSvmAllocs = nullptr,
|
GraphicsAllocation *argSvmAlloc = nullptr,
|
||||||
cl_mem_flags argSvmFlags = 0);
|
cl_mem_flags argSvmFlags = 0);
|
||||||
const void *getKernelArg(uint32_t argIndex) const;
|
const void *getKernelArg(uint32_t argIndex) const;
|
||||||
const SimpleKernelArgInfo &getKernelArgInfo(uint32_t argIndex) const;
|
const SimpleKernelArgInfo &getKernelArgInfo(uint32_t argIndex) const;
|
||||||
@@ -510,11 +509,9 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
bool hasDirectStatelessAccessToHostMemory() const;
|
bool hasDirectStatelessAccessToHostMemory() const;
|
||||||
bool hasIndirectStatelessAccessToHostMemory() const;
|
bool hasIndirectStatelessAccessToHostMemory() const;
|
||||||
|
|
||||||
void addAllocationToCacheFlushVector(uint32_t argIndex, GraphicsAllocation *argAllocation, uint32_t rootDeviceIndex);
|
void addAllocationToCacheFlushVector(uint32_t argIndex, GraphicsAllocation *argAllocation);
|
||||||
bool allocationForCacheFlush(GraphicsAllocation *argAllocation) const;
|
bool allocationForCacheFlush(GraphicsAllocation *argAllocation) const;
|
||||||
|
|
||||||
void setArgSvmAllocForSingleDevice(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc, const Device &device);
|
|
||||||
|
|
||||||
const HardwareInfo &getHardwareInfo(uint32_t rootDeviceIndex) const;
|
const HardwareInfo &getHardwareInfo(uint32_t rootDeviceIndex) const;
|
||||||
|
|
||||||
const ClDevice &getDevice() const {
|
const ClDevice &getDevice() const {
|
||||||
@@ -550,6 +547,7 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
|
|
||||||
bool specialPipelineSelectMode = false;
|
bool specialPipelineSelectMode = false;
|
||||||
bool svmAllocationsRequireCacheFlush = false;
|
bool svmAllocationsRequireCacheFlush = false;
|
||||||
|
std::vector<GraphicsAllocation *> kernelArgRequiresCacheFlush;
|
||||||
UnifiedMemoryControls unifiedMemoryControls{};
|
UnifiedMemoryControls unifiedMemoryControls{};
|
||||||
bool isUnifiedMemorySyncRequired = true;
|
bool isUnifiedMemorySyncRequired = true;
|
||||||
bool debugEnabled = false;
|
bool debugEnabled = false;
|
||||||
@@ -600,7 +598,6 @@ class Kernel : public BaseObject<_cl_kernel> {
|
|||||||
|
|
||||||
GraphicsAllocation *privateSurface = nullptr;
|
GraphicsAllocation *privateSurface = nullptr;
|
||||||
uint64_t privateSurfaceSize = 0u;
|
uint64_t privateSurfaceSize = 0u;
|
||||||
std::vector<GraphicsAllocation *> kernelArgRequiresCacheFlush;
|
|
||||||
};
|
};
|
||||||
std::vector<KernelDeviceInfo> kernelDeviceInfos;
|
std::vector<KernelDeviceInfo> kernelDeviceInfos;
|
||||||
const uint32_t defaultRootDeviceIndex;
|
const uint32_t defaultRootDeviceIndex;
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
|
|
||||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
|
||||||
|
|
||||||
namespace NEO {
|
|
||||||
SvmObjectArg::SvmObjectArg(GraphicsAllocation *graphicsAllocation) : type(SvmObjectArgType::SingleDeviceSvm), singleDeviceSvmAlloc(graphicsAllocation) {}
|
|
||||||
SvmObjectArg::SvmObjectArg(MultiGraphicsAllocation *multiGraphicsAllocation) : type(SvmObjectArgType::MultiDeviceSvm), multiDeviceSvmAlloc(multiGraphicsAllocation) {}
|
|
||||||
|
|
||||||
GraphicsAllocation *SvmObjectArg::getGraphicsAllocation(uint32_t rootDeviceIndex) const {
|
|
||||||
if (SvmObjectArgType::SingleDeviceSvm == type) {
|
|
||||||
DEBUG_BREAK_IF(singleDeviceSvmAlloc && rootDeviceIndex != singleDeviceSvmAlloc->getRootDeviceIndex());
|
|
||||||
return singleDeviceSvmAlloc;
|
|
||||||
}
|
|
||||||
if (multiDeviceSvmAlloc) {
|
|
||||||
return multiDeviceSvmAlloc->getGraphicsAllocation(rootDeviceIndex);
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool SvmObjectArg::isCoherent() const {
|
|
||||||
if (SvmObjectArgType::SingleDeviceSvm == type) {
|
|
||||||
return singleDeviceSvmAlloc->isCoherent();
|
|
||||||
}
|
|
||||||
return multiDeviceSvmAlloc->isCoherent();
|
|
||||||
}
|
|
||||||
GraphicsAllocation::AllocationType SvmObjectArg::getAllocationType() const {
|
|
||||||
if (SvmObjectArgType::SingleDeviceSvm == type) {
|
|
||||||
return singleDeviceSvmAlloc->getAllocationType();
|
|
||||||
}
|
|
||||||
return multiDeviceSvmAlloc->getAllocationType();
|
|
||||||
}
|
|
||||||
} // namespace NEO
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
|
||||||
|
|
||||||
namespace NEO {
|
|
||||||
class GraphicsAllocation;
|
|
||||||
class MultiGraphicsAllocation;
|
|
||||||
class SvmObjectArg {
|
|
||||||
public:
|
|
||||||
SvmObjectArg(GraphicsAllocation *graphicsAllocation);
|
|
||||||
SvmObjectArg(MultiGraphicsAllocation *multiGraphicsAllocation);
|
|
||||||
|
|
||||||
GraphicsAllocation *getGraphicsAllocation(uint32_t rootDeviceIndex) const;
|
|
||||||
bool isCoherent() const;
|
|
||||||
GraphicsAllocation::AllocationType getAllocationType() const;
|
|
||||||
MultiGraphicsAllocation *getMultiDeviceSvmAlloc() const { return multiDeviceSvmAlloc; }
|
|
||||||
|
|
||||||
protected:
|
|
||||||
enum class SvmObjectArgType {
|
|
||||||
SingleDeviceSvm,
|
|
||||||
MultiDeviceSvm
|
|
||||||
};
|
|
||||||
|
|
||||||
const SvmObjectArgType type;
|
|
||||||
GraphicsAllocation *singleDeviceSvmAlloc = nullptr;
|
|
||||||
MultiGraphicsAllocation *multiDeviceSvmAlloc = nullptr;
|
|
||||||
};
|
|
||||||
} // namespace NEO
|
|
||||||
@@ -376,19 +376,17 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clMemLocallyUncachedResourceFixture, givenBuffersTha
|
|||||||
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferUncacheableInSurfaceState);
|
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferUncacheableInSurfaceState);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
auto &kernelArgRequiresCacheFlush = kernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
EXPECT_EQ(nullptr, kernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, kernelArgRequiresCacheFlush[0]);
|
|
||||||
|
|
||||||
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferCacheable);
|
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferCacheable);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
EXPECT_NE(nullptr, kernelArgRequiresCacheFlush[0]);
|
EXPECT_NE(nullptr, kernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferUncacheable);
|
retVal = clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufferUncacheable);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, kernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
clReleaseMemObject(bufferUncacheableInSurfaceState);
|
clReleaseMemObject(bufferUncacheableInSurfaceState);
|
||||||
clReleaseMemObject(bufferUncacheable);
|
clReleaseMemObject(bufferUncacheable);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||||
|
|
||||||
#include "opencl/source/api/api.h"
|
#include "opencl/source/api/api.h"
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
#include "opencl/test/unit_test/command_queue/command_queue_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
@@ -649,8 +648,8 @@ TEST(clUnifiedSharedMemoryTests, whenClSetKernelArgMemPointerINTELisCalledWithVa
|
|||||||
retVal = clSetKernelArgMemPointerINTEL(mockKernel.mockKernel, 0, unfiedMemoryDeviceAllocation);
|
retVal = clSetKernelArgMemPointerINTEL(mockKernel.mockKernel, 0, unfiedMemoryDeviceAllocation);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
auto svmAlloc = mockContext->getSVMAllocsManager()->getSVMAlloc(unfiedMemoryDeviceAllocation);
|
auto svmAlloc = mockContext->getSVMAllocsManager()->getSVMAlloc(unfiedMemoryDeviceAllocation);
|
||||||
auto multiGraphicsAllocation = reinterpret_cast<SvmObjectArg *>(mockKernel.mockKernel->kernelArguments[0].object)->getMultiDeviceSvmAlloc();
|
EXPECT_EQ(mockKernel.mockKernel->kernelArguments[0].object,
|
||||||
EXPECT_EQ(multiGraphicsAllocation, &svmAlloc->gpuAllocations);
|
svmAlloc->gpuAllocations.getGraphicsAllocation(mockContext->getDevice(0)->getRootDeviceIndex()));
|
||||||
|
|
||||||
retVal = clMemFreeINTEL(mockContext.get(), unfiedMemoryDeviceAllocation);
|
retVal = clMemFreeINTEL(mockContext.get(), unfiedMemoryDeviceAllocation);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include "opencl/source/built_ins/vme_dispatch_builder.h"
|
#include "opencl/source/built_ins/vme_dispatch_builder.h"
|
||||||
#include "opencl/source/helpers/dispatch_info_builder.h"
|
#include "opencl/source/helpers/dispatch_info_builder.h"
|
||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/test/unit_test/built_ins/built_ins_file_names.h"
|
#include "opencl/test/unit_test/built_ins/built_ins_file_names.h"
|
||||||
#include "opencl/test/unit_test/fixtures/built_in_fixture.h"
|
#include "opencl/test/unit_test/fixtures/built_in_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
@@ -279,16 +278,14 @@ HWTEST_P(AuxBuiltInTests, givenInputBufferWhenBuildingNonAuxDispatchInfoForAuxTr
|
|||||||
Vec3<size_t> gws = {xGws, 1, 1};
|
Vec3<size_t> gws = {xGws, 1, 1};
|
||||||
EXPECT_EQ(gws, dispatchInfo.getGWS());
|
EXPECT_EQ(gws, dispatchInfo.getGWS());
|
||||||
} else {
|
} else {
|
||||||
auto gfxAllocation = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(0).object)->getGraphicsAllocation(rootDeviceIndex);
|
auto gfxAllocation = static_cast<GraphicsAllocation *>(kernel->getKernelArguments().at(0).object);
|
||||||
auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation});
|
auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation});
|
||||||
EXPECT_NE(nullptr, kernelObj.object);
|
EXPECT_NE(nullptr, kernelObj.object);
|
||||||
EXPECT_EQ(KernelObjForAuxTranslation::Type::GFX_ALLOC, kernelObj.type);
|
EXPECT_EQ(KernelObjForAuxTranslation::Type::GFX_ALLOC, kernelObj.type);
|
||||||
kernelObjsForAuxTranslation.erase(kernelObj);
|
kernelObjsForAuxTranslation.erase(kernelObj);
|
||||||
|
|
||||||
auto svmArg0 = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(0).object);
|
EXPECT_EQ(gfxAllocation, kernel->getKernelArguments().at(0).object);
|
||||||
auto svmArg1 = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(1).object);
|
EXPECT_EQ(gfxAllocation, kernel->getKernelArguments().at(1).object);
|
||||||
EXPECT_EQ(gfxAllocation, svmArg0->getGraphicsAllocation(rootDeviceIndex));
|
|
||||||
EXPECT_EQ(gfxAllocation, svmArg1->getGraphicsAllocation(rootDeviceIndex));
|
|
||||||
|
|
||||||
EXPECT_EQ(1u, dispatchInfo.getDim());
|
EXPECT_EQ(1u, dispatchInfo.getDim());
|
||||||
size_t xGws = alignUp(gfxAllocation->getUnderlyingBufferSize(), 512) / 16;
|
size_t xGws = alignUp(gfxAllocation->getUnderlyingBufferSize(), 512) / 16;
|
||||||
@@ -347,16 +344,14 @@ HWTEST_P(AuxBuiltInTests, givenInputBufferWhenBuildingAuxDispatchInfoForAuxTrans
|
|||||||
Vec3<size_t> gws = {xGws, 1, 1};
|
Vec3<size_t> gws = {xGws, 1, 1};
|
||||||
EXPECT_EQ(gws, dispatchInfo.getGWS());
|
EXPECT_EQ(gws, dispatchInfo.getGWS());
|
||||||
} else {
|
} else {
|
||||||
auto gfxAllocation = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(0).object)->getGraphicsAllocation(rootDeviceIndex);
|
auto gfxAllocation = static_cast<GraphicsAllocation *>(kernel->getKernelArguments().at(0).object);
|
||||||
auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation});
|
auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation});
|
||||||
EXPECT_NE(nullptr, kernelObj.object);
|
EXPECT_NE(nullptr, kernelObj.object);
|
||||||
EXPECT_EQ(KernelObjForAuxTranslation::Type::GFX_ALLOC, kernelObj.type);
|
EXPECT_EQ(KernelObjForAuxTranslation::Type::GFX_ALLOC, kernelObj.type);
|
||||||
kernelObjsForAuxTranslation.erase(kernelObj);
|
kernelObjsForAuxTranslation.erase(kernelObj);
|
||||||
|
|
||||||
auto svmArg0 = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(0).object);
|
EXPECT_EQ(gfxAllocation, kernel->getKernelArguments().at(0).object);
|
||||||
auto svmArg1 = reinterpret_cast<SvmObjectArg *>(kernel->getKernelArguments().at(1).object);
|
EXPECT_EQ(gfxAllocation, kernel->getKernelArguments().at(1).object);
|
||||||
EXPECT_EQ(gfxAllocation, svmArg0->getGraphicsAllocation(rootDeviceIndex));
|
|
||||||
EXPECT_EQ(gfxAllocation, svmArg1->getGraphicsAllocation(rootDeviceIndex));
|
|
||||||
|
|
||||||
EXPECT_EQ(1u, dispatchInfo.getDim());
|
EXPECT_EQ(1u, dispatchInfo.getDim());
|
||||||
size_t xGws = alignUp(gfxAllocation->getUnderlyingBufferSize(), 512) / 16;
|
size_t xGws = alignUp(gfxAllocation->getUnderlyingBufferSize(), 512) / 16;
|
||||||
|
|||||||
@@ -472,10 +472,9 @@ HWTEST_F(CommandQueueCommandStreamTest, givenMultiDispatchInfoWithSingleKernelWi
|
|||||||
pDevice->getUltCommandStreamReceiver<FamilyType>().multiOsContextCapable = true;
|
pDevice->getUltCommandStreamReceiver<FamilyType>().multiOsContextCapable = true;
|
||||||
MockKernelWithInternals mockKernelWithInternals(*pClDevice, context.get());
|
MockKernelWithInternals mockKernelWithInternals(*pClDevice, context.get());
|
||||||
|
|
||||||
auto &kernelArgRequiresCacheFlush = mockKernelWithInternals.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
mockKernelWithInternals.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
kernelArgRequiresCacheFlush.resize(1);
|
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
mockKernelWithInternals.mockKernel->kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
|
|
||||||
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({mockKernelWithInternals.mockKernel}));
|
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({mockKernelWithInternals.mockKernel}));
|
||||||
|
|
||||||
@@ -489,11 +488,10 @@ HWTEST_F(CommandQueueCommandStreamTest, givenMultiDispatchInfoWithSingleKernelWi
|
|||||||
|
|
||||||
MockCommandQueueHw<FamilyType> cmdQ(context.get(), pClDevice, nullptr);
|
MockCommandQueueHw<FamilyType> cmdQ(context.get(), pClDevice, nullptr);
|
||||||
MockKernelWithInternals mockKernelWithInternals(*pClDevice, context.get());
|
MockKernelWithInternals mockKernelWithInternals(*pClDevice, context.get());
|
||||||
auto &kernelArgRequiresCacheFlush = mockKernelWithInternals.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
|
||||||
|
|
||||||
kernelArgRequiresCacheFlush.resize(1);
|
mockKernelWithInternals.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
mockKernelWithInternals.mockKernel->kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
|
|
||||||
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({mockKernelWithInternals.mockKernel}));
|
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({mockKernelWithInternals.mockKernel}));
|
||||||
|
|
||||||
|
|||||||
@@ -1151,12 +1151,10 @@ HWTEST_F(DispatchWalkerTest, GivenCacheFlushAfterWalkerDisabledWhenAllocationReq
|
|||||||
DebugManager.flags.EnableCacheFlushAfterWalker.set(0);
|
DebugManager.flags.EnableCacheFlushAfterWalker.set(0);
|
||||||
|
|
||||||
MockKernel kernel1(program.get(), MockKernel::toKernelInfoContainer(kernelInfo, rootDeviceIndex));
|
MockKernel kernel1(program.get(), MockKernel::toKernelInfoContainer(kernelInfo, rootDeviceIndex));
|
||||||
|
|
||||||
auto &kernelArgRequiresCacheFlush = kernel1.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
|
||||||
ASSERT_EQ(CL_SUCCESS, kernel1.initialize());
|
ASSERT_EQ(CL_SUCCESS, kernel1.initialize());
|
||||||
kernelArgRequiresCacheFlush.resize(1);
|
kernel1.kernelArgRequiresCacheFlush.resize(1);
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
kernel1.kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
|
|
||||||
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({&kernel1}));
|
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({&kernel1}));
|
||||||
// create commandStream
|
// create commandStream
|
||||||
@@ -1190,11 +1188,11 @@ HWTEST_F(DispatchWalkerTest, GivenCacheFlushAfterWalkerEnabledWhenWalkerWithTwoK
|
|||||||
MockKernel kernel2(program.get(), MockKernel::toKernelInfoContainer(kernelInfoWithSampler, rootDeviceIndex));
|
MockKernel kernel2(program.get(), MockKernel::toKernelInfoContainer(kernelInfoWithSampler, rootDeviceIndex));
|
||||||
ASSERT_EQ(CL_SUCCESS, kernel2.initialize());
|
ASSERT_EQ(CL_SUCCESS, kernel2.initialize());
|
||||||
|
|
||||||
kernel1.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel1.kernelArgRequiresCacheFlush.resize(1);
|
||||||
kernel2.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel2.kernelArgRequiresCacheFlush.resize(1);
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
kernel1.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
kernel1.kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
kernel2.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
kernel2.kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
|
|
||||||
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({&kernel1, &kernel2}));
|
MockMultiDispatchInfo multiDispatchInfo(pClDevice, std::vector<Kernel *>({&kernel1, &kernel2}));
|
||||||
// create commandStream
|
// create commandStream
|
||||||
@@ -1228,11 +1226,11 @@ HWTEST_F(DispatchWalkerTest, GivenCacheFlushAfterWalkerEnabledWhenTwoWalkersForQ
|
|||||||
MockKernel kernel2(program.get(), MockKernel::toKernelInfoContainer(kernelInfoWithSampler, rootDeviceIndex));
|
MockKernel kernel2(program.get(), MockKernel::toKernelInfoContainer(kernelInfoWithSampler, rootDeviceIndex));
|
||||||
ASSERT_EQ(CL_SUCCESS, kernel2.initialize());
|
ASSERT_EQ(CL_SUCCESS, kernel2.initialize());
|
||||||
|
|
||||||
kernel1.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel1.kernelArgRequiresCacheFlush.resize(1);
|
||||||
kernel2.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel2.kernelArgRequiresCacheFlush.resize(1);
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
kernel1.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
kernel1.kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
kernel2.kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
kernel2.kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
|
|
||||||
MockMultiDispatchInfo multiDispatchInfo1(pClDevice, std::vector<Kernel *>({&kernel1}));
|
MockMultiDispatchInfo multiDispatchInfo1(pClDevice, std::vector<Kernel *>({&kernel1}));
|
||||||
MockMultiDispatchInfo multiDispatchInfo2(pClDevice, std::vector<Kernel *>({&kernel2}));
|
MockMultiDispatchInfo multiDispatchInfo2(pClDevice, std::vector<Kernel *>({&kernel2}));
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void HardwareCommandsTest::addSpaceForSingleKernelArg() {
|
|||||||
mockKernelWithInternal->kernelInfo.kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset = 0;
|
mockKernelWithInternal->kernelInfo.kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset = 0;
|
||||||
mockKernelWithInternal->kernelInfo.kernelArgInfo[0].kernelArgPatchInfoVector[0].size = sizeof(uintptr_t);
|
mockKernelWithInternal->kernelInfo.kernelArgInfo[0].kernelArgPatchInfoVector[0].size = sizeof(uintptr_t);
|
||||||
mockKernelWithInternal->mockKernel->setKernelArguments(kernelArguments);
|
mockKernelWithInternal->mockKernel->setKernelArguments(kernelArguments);
|
||||||
mockKernelWithInternal->mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
mockKernelWithInternal->mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenProgramInterfaceDescriptorDataIsCreatedThenOnlyRequiredSpaceOnIndirectHeapIsAllocated) {
|
HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, WhenProgramInterfaceDescriptorDataIsCreatedThenOnlyRequiredSpaceOnIndirectHeapIsAllocated) {
|
||||||
@@ -1278,9 +1278,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, givenCacheFlushAfterWalkerEnab
|
|||||||
|
|
||||||
addSpaceForSingleKernelArg();
|
addSpaceForSingleKernelArg();
|
||||||
MockGraphicsAllocation cacheRequiringAllocation;
|
MockGraphicsAllocation cacheRequiringAllocation;
|
||||||
auto &kernelArgRequiresCacheFlush = mockKernelWithInternal->mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush;
|
mockKernelWithInternal->mockKernel->kernelArgRequiresCacheFlush.resize(2);
|
||||||
kernelArgRequiresCacheFlush.resize(2);
|
mockKernelWithInternal->mockKernel->kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
||||||
kernelArgRequiresCacheFlush[0] = &cacheRequiringAllocation;
|
|
||||||
|
|
||||||
Kernel::CacheFlushAllocationsVec allocs;
|
Kernel::CacheFlushAllocationsVec allocs;
|
||||||
mockKernelWithInternal->mockKernel->getAllocationsForCacheFlush(allocs, rootDeviceIndex);
|
mockKernelWithInternal->mockKernel->getAllocationsForCacheFlush(allocs, rootDeviceIndex);
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ set(IGDRCL_SRCS_tests_kernel
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_kernel_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/debug_kernel_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/parent_kernel_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/parent_kernel_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/substitute_kernel_heap_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/substitute_kernel_heap_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/svm_object_arg_tests.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_kernel})
|
target_sources(igdrcl_tests PRIVATE ${IGDRCL_SRCS_tests_kernel})
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
#include "opencl/source/accelerators/intel_motion_estimation.h"
|
||||||
#include "opencl/source/helpers/sampler_helpers.h"
|
#include "opencl/source/helpers/sampler_helpers.h"
|
||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/source/mem_obj/pipe.h"
|
#include "opencl/source/mem_obj/pipe.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||||
@@ -459,10 +458,8 @@ TEST_F(CloneKernelTest, GivenArgSvmWhenCloningKernelThenKernelInfoIsCorrect) {
|
|||||||
TEST_F(CloneKernelTest, GivenArgSvmAllocWhenCloningKernelThenKernelInfoIsCorrect) {
|
TEST_F(CloneKernelTest, GivenArgSvmAllocWhenCloningKernelThenKernelInfoIsCorrect) {
|
||||||
char *svmPtr = new char[256];
|
char *svmPtr = new char[256];
|
||||||
MockGraphicsAllocation svmAlloc(svmPtr, 256);
|
MockGraphicsAllocation svmAlloc(svmPtr, 256);
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(svmAlloc.getRootDeviceIndex());
|
|
||||||
multiGraphicsAllocation.addAllocation(&svmAlloc);
|
|
||||||
|
|
||||||
retVal = pSourceKernel->setArgMultiDeviceSvmAlloc(0, svmPtr, &multiGraphicsAllocation);
|
retVal = pSourceKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
||||||
ASSERT_EQ(CL_SUCCESS, retVal);
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
||||||
|
|
||||||
EXPECT_EQ(1u, pSourceKernel->getKernelArguments().size());
|
EXPECT_EQ(1u, pSourceKernel->getKernelArguments().size());
|
||||||
@@ -476,10 +473,7 @@ TEST_F(CloneKernelTest, GivenArgSvmAllocWhenCloningKernelThenKernelInfoIsCorrect
|
|||||||
|
|
||||||
EXPECT_EQ(pSourceKernel->getKernelArguments().size(), pClonedKernel->getKernelArguments().size());
|
EXPECT_EQ(pSourceKernel->getKernelArguments().size(), pClonedKernel->getKernelArguments().size());
|
||||||
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).type, pClonedKernel->getKernelArgInfo(0).type);
|
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).type, pClonedKernel->getKernelArgInfo(0).type);
|
||||||
EXPECT_NE(nullptr, pSourceKernel->getKernelArgInfo(0).object);
|
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).object, pClonedKernel->getKernelArgInfo(0).object);
|
||||||
auto srcSvm = reinterpret_cast<SvmObjectArg *>(pSourceKernel->getKernelArgInfo(0).object);
|
|
||||||
auto clonedSvm = reinterpret_cast<SvmObjectArg *>(pClonedKernel->getKernelArgInfo(0).object);
|
|
||||||
EXPECT_EQ(srcSvm->getMultiDeviceSvmAlloc(), clonedSvm->getMultiDeviceSvmAlloc());
|
|
||||||
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).value, pClonedKernel->getKernelArgInfo(0).value);
|
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).value, pClonedKernel->getKernelArgInfo(0).value);
|
||||||
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).size, pClonedKernel->getKernelArgInfo(0).size);
|
EXPECT_EQ(pSourceKernel->getKernelArgInfo(0).size, pClonedKernel->getKernelArgInfo(0).size);
|
||||||
EXPECT_EQ(pSourceKernel->getPatchedArgumentsNum(), pClonedKernel->getPatchedArgumentsNum());
|
EXPECT_EQ(pSourceKernel->getPatchedArgumentsNum(), pClonedKernel->getPatchedArgumentsNum());
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ TEST_F(KernelArgBufferTest, givenWritableBufferWhenSettingAsArgThenDoNotExpectAl
|
|||||||
|
|
||||||
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelArgBufferTest, givenCacheFlushBufferWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
TEST_F(KernelArgBufferTest, givenCacheFlushBufferWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
||||||
@@ -337,7 +337,7 @@ TEST_F(KernelArgBufferTest, givenCacheFlushBufferWhenSettingAsArgThenExpectAlloc
|
|||||||
|
|
||||||
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(&buffer->mockGfxAllocation, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(&buffer->mockGfxAllocation, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelArgBufferTest, givenNoCacheFlushBufferWhenSettingAsArgThenNotExpectAllocationInCacheFlushVector) {
|
TEST_F(KernelArgBufferTest, givenNoCacheFlushBufferWhenSettingAsArgThenNotExpectAllocationInCacheFlushVector) {
|
||||||
@@ -350,7 +350,7 @@ TEST_F(KernelArgBufferTest, givenNoCacheFlushBufferWhenSettingAsArgThenNotExpect
|
|||||||
|
|
||||||
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
auto retVal = pKernel->setArg(0, sizeof(cl_mem *), pVal);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnFalse) {
|
TEST_F(KernelArgBufferTest, givenBufferWhenHasDirectStatelessAccessToHostMemoryIsCalledThenReturnFalse) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "opencl/source/mem_obj/buffer.h"
|
#include "opencl/source/mem_obj/buffer.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/multi_root_device_fixture.h"
|
|
||||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||||
@@ -340,7 +339,7 @@ class KernelArgSvmTestTyped : public KernelArgSvmTest {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct SetArgHandlerSetArgSvm {
|
struct SetArgHandlerSetArgSvm {
|
||||||
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, MultiGraphicsAllocation &alloc) {
|
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, GraphicsAllocation &alloc) {
|
||||||
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc, 0u);
|
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc, 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,8 +349,8 @@ struct SetArgHandlerSetArgSvm {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct SetArgHandlerSetArgSvmAlloc {
|
struct SetArgHandlerSetArgSvmAlloc {
|
||||||
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, MultiGraphicsAllocation &alloc) {
|
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, GraphicsAllocation &alloc) {
|
||||||
kernel.setArgMultiDeviceSvmAlloc(argNum, ptrToPatch, &alloc);
|
kernel.setArgSvmAlloc(argNum, ptrToPatch, &alloc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr bool supportsOffsets() {
|
static constexpr bool supportsOffsets() {
|
||||||
@@ -360,8 +359,8 @@ struct SetArgHandlerSetArgSvmAlloc {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct SetArgHandlerSetArgBuffer {
|
struct SetArgHandlerSetArgBuffer {
|
||||||
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, MultiGraphicsAllocation &alloc) {
|
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, GraphicsAllocation &alloc) {
|
||||||
MockBuffer mb{*alloc.getDefaultGraphicsAllocation()};
|
MockBuffer mb{alloc};
|
||||||
cl_mem memObj = &mb;
|
cl_mem memObj = &mb;
|
||||||
kernel.setArgBuffer(argNum, sizeof(cl_mem), &memObj);
|
kernel.setArgBuffer(argNum, sizeof(cl_mem), &memObj);
|
||||||
}
|
}
|
||||||
@@ -411,10 +410,7 @@ HWTEST_TYPED_TEST(KernelArgSvmTestTyped, GivenBufferKernelArgWhenBufferOffsetIsN
|
|||||||
RENDER_SURFACE_STATE *surfState = reinterpret_cast<RENDER_SURFACE_STATE *>(this->pKernel->getSurfaceStateHeap(rootDeviceIndex));
|
RENDER_SURFACE_STATE *surfState = reinterpret_cast<RENDER_SURFACE_STATE *>(this->pKernel->getSurfaceStateHeap(rootDeviceIndex));
|
||||||
memset(surfState, 0, rendSurfSize);
|
memset(surfState, 0, rendSurfSize);
|
||||||
|
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(svmAlloc.getRootDeviceIndex());
|
TypeParam::setArg(*this->pKernel, 0U, ptrToPatch, sizeToPatch, svmAlloc);
|
||||||
multiGraphicsAllocation.addAllocation(&svmAlloc);
|
|
||||||
|
|
||||||
TypeParam::setArg(*this->pKernel, 0U, ptrToPatch, sizeToPatch, multiGraphicsAllocation);
|
|
||||||
|
|
||||||
// surface state for comparison
|
// surface state for comparison
|
||||||
RENDER_SURFACE_STATE expectedSurfaceState;
|
RENDER_SURFACE_STATE expectedSurfaceState;
|
||||||
@@ -451,7 +447,7 @@ TEST_F(KernelArgSvmTest, givenWritableSvmAllocationWhenSettingAsArgThenDoNotExpe
|
|||||||
|
|
||||||
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
alignedFree(svmPtr);
|
alignedFree(svmPtr);
|
||||||
}
|
}
|
||||||
@@ -466,7 +462,7 @@ TEST_F(KernelArgSvmTest, givenCacheFlushSvmAllocationWhenSettingAsArgThenExpectA
|
|||||||
|
|
||||||
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(&svmAlloc, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(&svmAlloc, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
alignedFree(svmPtr);
|
alignedFree(svmPtr);
|
||||||
}
|
}
|
||||||
@@ -481,7 +477,7 @@ TEST_F(KernelArgSvmTest, givenNoCacheFlushSvmAllocationWhenSettingAsArgThenNotEx
|
|||||||
|
|
||||||
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
auto retVal = pKernel->setArgSvmAlloc(0, svmPtr, &svmAlloc);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
|
|
||||||
alignedFree(svmPtr);
|
alignedFree(svmPtr);
|
||||||
}
|
}
|
||||||
@@ -563,140 +559,3 @@ TEST_F(KernelArgSvmTest, givenCpuAddressIsNullWhenGpuAddressIsValidThenPatchBuff
|
|||||||
EXPECT_EQ(svmPtr.data(), returnedPtr);
|
EXPECT_EQ(svmPtr.data(), returnedPtr);
|
||||||
EXPECT_EQ(0U, *expectedPatchPtr);
|
EXPECT_EQ(0U, *expectedPatchPtr);
|
||||||
}
|
}
|
||||||
struct KernelArgSvmMultiDeviceTest : public MultiRootDeviceWithSubDevicesFixture {
|
|
||||||
void SetUp() override {
|
|
||||||
MultiRootDeviceWithSubDevicesFixture::SetUp();
|
|
||||||
program = std::make_unique<MockProgram>(context.get(), false, context->getDevices());
|
|
||||||
|
|
||||||
KernelInfoContainer kernelInfos;
|
|
||||||
kernelInfos.resize(3);
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
pKernelInfo[rootDeviceIndex] = std::make_unique<KernelInfo>();
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelDescriptor.kernelAttributes.simdSize = 1;
|
|
||||||
|
|
||||||
// setup kernel arg offsets
|
|
||||||
KernelArgPatchInfo kernelArgPatchInfo;
|
|
||||||
|
|
||||||
pKernelInfo[rootDeviceIndex]->heapInfo.pSsh = pSshLocal[rootDeviceIndex];
|
|
||||||
pKernelInfo[rootDeviceIndex]->heapInfo.SurfaceStateHeapSize = sizeof(pSshLocal[rootDeviceIndex]);
|
|
||||||
pKernelInfo[rootDeviceIndex]->usesSsh = true;
|
|
||||||
pKernelInfo[rootDeviceIndex]->requiresSshForBuffers = true;
|
|
||||||
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo.resize(1);
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector.push_back(kernelArgPatchInfo);
|
|
||||||
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset = 0x30;
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector[0].size = (uint32_t)sizeof(void *);
|
|
||||||
|
|
||||||
kernelInfos[rootDeviceIndex] = pKernelInfo[rootDeviceIndex].get();
|
|
||||||
}
|
|
||||||
|
|
||||||
pKernel = new MockKernel(program.get(), kernelInfos);
|
|
||||||
ASSERT_EQ(CL_SUCCESS, pKernel->initialize());
|
|
||||||
pKernel->setCrossThreadData(pCrossThreadData, sizeof(pCrossThreadData));
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
pKernel->setCrossThreadDataForRootDeviceIndex(rootDeviceIndex, &pCrossThreadData[rootDeviceIndex], sizeof(pCrossThreadData[rootDeviceIndex]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void TearDown() override {
|
|
||||||
delete pKernel;
|
|
||||||
|
|
||||||
MultiRootDeviceWithSubDevicesFixture::TearDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
cl_int retVal = CL_SUCCESS;
|
|
||||||
std::unique_ptr<MockProgram> program;
|
|
||||||
MockKernel *pKernel = nullptr;
|
|
||||||
SKernelBinaryHeaderCommon kernelHeader;
|
|
||||||
std::unique_ptr<KernelInfo> pKernelInfo[3];
|
|
||||||
char pCrossThreadData[3][0x60];
|
|
||||||
char pSshLocal[3][64];
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_F(KernelArgSvmMultiDeviceTest, GivenValidSvmPtrWhenSettingKernelArgThenSvmPtrIsCorrect) {
|
|
||||||
char svmPtr[256] = {};
|
|
||||||
|
|
||||||
auto retVal = pKernel->setArgSvm(0, 256, &svmPtr, nullptr, 0u);
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
auto pKernelArg = (void **)(pKernel->getCrossThreadData(rootDeviceIndex) +
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset);
|
|
||||||
EXPECT_EQ(svmPtr, *pKernelArg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TEST_F(KernelArgSvmMultiDeviceTest, GivenValidSvmAllocWhenSettingKernelArgThenArgumentsAreSetCorrectly) {
|
|
||||||
char svmPtr[256] = {};
|
|
||||||
|
|
||||||
GraphicsAllocation graphicsAllocation1{1u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
GraphicsAllocation graphicsAllocation2{2u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
|
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(2);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation1);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation2);
|
|
||||||
|
|
||||||
auto retVal = pKernel->setArgMultiDeviceSvmAlloc(0, svmPtr, &multiGraphicsAllocation);
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
auto pKernelArg = (void **)(pKernel->getCrossThreadData(rootDeviceIndex) +
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset);
|
|
||||||
EXPECT_EQ(svmPtr, *pKernelArg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(KernelArgSvmMultiDeviceTest, whenSettingArgTwiceThenOverrideWithCorrectValue) {
|
|
||||||
char svmPtr[256] = {};
|
|
||||||
char svmPtr2[256] = {};
|
|
||||||
|
|
||||||
GraphicsAllocation graphicsAllocation1{1u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
GraphicsAllocation graphicsAllocation2{2u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
|
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(2);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation1);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation2);
|
|
||||||
|
|
||||||
auto retVal = pKernel->setArgMultiDeviceSvmAlloc(0, svmPtr, &multiGraphicsAllocation);
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
||||||
retVal = pKernel->setArgMultiDeviceSvmAlloc(0, svmPtr2, &multiGraphicsAllocation);
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
auto pKernelArg = (void **)(pKernel->getCrossThreadData(rootDeviceIndex) +
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].kernelArgPatchInfoVector[0].crossthreadOffset);
|
|
||||||
EXPECT_EQ(svmPtr2, *pKernelArg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(KernelArgSvmMultiDeviceTest, GivenValidSvmAllocStatefulWhenSettingKernelArgThenArgumentsAreSetCorrectly) {
|
|
||||||
char svmPtr[256] = {};
|
|
||||||
|
|
||||||
GraphicsAllocation graphicsAllocation1{1u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
GraphicsAllocation graphicsAllocation2{2u, GraphicsAllocation::AllocationType::BUFFER, &svmPtr, sizeof(svmPtr), 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
|
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(2);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation1);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation2);
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
pKernelInfo[rootDeviceIndex]->usesSsh = true;
|
|
||||||
pKernelInfo[rootDeviceIndex]->requiresSshForBuffers = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto retVal = pKernel->setArgMultiDeviceSvmAlloc(0, svmPtr, &multiGraphicsAllocation);
|
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
|
||||||
|
|
||||||
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
|
|
||||||
|
|
||||||
for (auto &rootDeviceIndex : this->context->getRootDeviceIndices()) {
|
|
||||||
EXPECT_NE(0u, pKernel->getSurfaceStateHeapSize(rootDeviceIndex));
|
|
||||||
auto surfaceState = reinterpret_cast<const RENDER_SURFACE_STATE *>(
|
|
||||||
ptrOffset(pKernel->getSurfaceStateHeap(rootDeviceIndex),
|
|
||||||
pKernelInfo[rootDeviceIndex]->kernelArgInfo[0].offsetHeap));
|
|
||||||
|
|
||||||
void *surfaceAddress = reinterpret_cast<void *>(surfaceState->getSurfaceBaseAddress());
|
|
||||||
EXPECT_EQ(svmPtr, surfaceAddress);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ TEST_F(KernelImageArgTest, givenWritableImageWhenSettingAsArgThenDoNotExpectAllo
|
|||||||
|
|
||||||
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelImageArgTest, givenCacheFlushImageWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
TEST_F(KernelImageArgTest, givenCacheFlushImageWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
||||||
@@ -332,7 +332,7 @@ TEST_F(KernelImageArgTest, givenCacheFlushImageWhenSettingAsArgThenExpectAllocat
|
|||||||
|
|
||||||
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(image.graphicsAllocation, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(image.graphicsAllocation, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelImageArgTest, givenNoCacheFlushImageWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
TEST_F(KernelImageArgTest, givenNoCacheFlushImageWhenSettingAsArgThenExpectAllocationInCacheFlushVector) {
|
||||||
@@ -344,7 +344,7 @@ TEST_F(KernelImageArgTest, givenNoCacheFlushImageWhenSettingAsArgThenExpectAlloc
|
|||||||
|
|
||||||
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
pKernel->setArg(0, sizeof(imageObj), &imageObj);
|
||||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||||
EXPECT_EQ(nullptr, pKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, pKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
class KernelImageArgTestBindless : public KernelImageArgTest {
|
class KernelImageArgTestBindless : public KernelImageArgTest {
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include "opencl/source/helpers/memory_properties_helpers.h"
|
#include "opencl/source/helpers/memory_properties_helpers.h"
|
||||||
#include "opencl/source/helpers/surface_formats.h"
|
#include "opencl/source/helpers/surface_formats.h"
|
||||||
#include "opencl/source/kernel/kernel.h"
|
#include "opencl/source/kernel/kernel.h"
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/source/mem_obj/image.h"
|
#include "opencl/source/mem_obj/image.h"
|
||||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||||
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
#include "opencl/test/unit_test/fixtures/device_host_queue_fixture.h"
|
||||||
@@ -1768,8 +1767,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryAndNotRequiredMemSyncWhenM
|
|||||||
|
|
||||||
EXPECT_EQ(mockPageFaultManager->transferToCpuCalled, 0);
|
EXPECT_EQ(mockPageFaultManager->transferToCpuCalled, 0);
|
||||||
auto gpuAllocation = unifiedMemoryGraphicsAllocation->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex());
|
auto gpuAllocation = unifiedMemoryGraphicsAllocation->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex());
|
||||||
SvmObjectArg svmObjectArg{gpuAllocation};
|
mockKernel.mockKernel->kernelArguments[0] = {Kernel::kernelArgType::SVM_ALLOC_OBJ, gpuAllocation, unifiedMemoryAllocation, 4096u, gpuAllocation, sizeof(uintptr_t)};
|
||||||
mockKernel.mockKernel->kernelArguments[0] = {Kernel::kernelArgType::SVM_ALLOC_OBJ, &svmObjectArg, unifiedMemoryAllocation, 4096u, nullptr, sizeof(uintptr_t)};
|
|
||||||
mockKernel.mockKernel->setUnifiedMemorySyncRequirement(false);
|
mockKernel.mockKernel->setUnifiedMemorySyncRequirement(false);
|
||||||
|
|
||||||
mockKernel.mockKernel->makeResident(commandStreamReceiver);
|
mockKernel.mockKernel->makeResident(commandStreamReceiver);
|
||||||
@@ -1797,8 +1795,7 @@ HWTEST_F(KernelResidencyTest, givenSharedUnifiedMemoryRequiredMemSyncWhenMakeRes
|
|||||||
|
|
||||||
auto gpuAllocation = unifiedMemoryGraphicsAllocation->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex());
|
auto gpuAllocation = unifiedMemoryGraphicsAllocation->gpuAllocations.getGraphicsAllocation(pDevice->getRootDeviceIndex());
|
||||||
EXPECT_EQ(mockPageFaultManager->transferToCpuCalled, 0);
|
EXPECT_EQ(mockPageFaultManager->transferToCpuCalled, 0);
|
||||||
SvmObjectArg svmObjectArg{gpuAllocation};
|
mockKernel.mockKernel->kernelArguments[0] = {Kernel::kernelArgType::SVM_ALLOC_OBJ, gpuAllocation, unifiedMemoryAllocation, 4096u, gpuAllocation, sizeof(uintptr_t)};
|
||||||
mockKernel.mockKernel->kernelArguments[0] = {Kernel::kernelArgType::SVM_ALLOC_OBJ, &svmObjectArg, unifiedMemoryAllocation, 4096u, nullptr, sizeof(uintptr_t)};
|
|
||||||
mockKernel.mockKernel->setUnifiedMemorySyncRequirement(true);
|
mockKernel.mockKernel->setUnifiedMemorySyncRequirement(true);
|
||||||
|
|
||||||
mockKernel.mockKernel->makeResident(commandStreamReceiver);
|
mockKernel.mockKernel->makeResident(commandStreamReceiver);
|
||||||
@@ -2776,13 +2773,12 @@ TEST(KernelTest, givenKernelWithPairArgumentWhenItIsInitializedThenPatchImmediat
|
|||||||
|
|
||||||
TEST(KernelTest, whenNullAllocationThenAssignNullPointerToCacheFlushVector) {
|
TEST(KernelTest, whenNullAllocationThenAssignNullPointerToCacheFlushVector) {
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
|
||||||
MockKernelWithInternals kernel(*device);
|
MockKernelWithInternals kernel(*device);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = reinterpret_cast<GraphicsAllocation *>(0x1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush[0] = reinterpret_cast<GraphicsAllocation *>(0x1);
|
||||||
|
|
||||||
kernel.mockKernel->addAllocationToCacheFlushVector(0, nullptr, rootDeviceIndex);
|
kernel.mockKernel->addAllocationToCacheFlushVector(0, nullptr);
|
||||||
EXPECT_EQ(nullptr, kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, kernel.mockKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(KernelTest, givenKernelCompiledWithSimdSizeLowerThanExpectedWhenInitializingThenReturnError) {
|
TEST(KernelTest, givenKernelCompiledWithSimdSizeLowerThanExpectedWhenInitializingThenReturnError) {
|
||||||
@@ -2813,15 +2809,14 @@ TEST(KernelTest, givenKernelCompiledWithSimdOneWhenInitializingThenReturnError)
|
|||||||
TEST(KernelTest, whenAllocationRequiringCacheFlushThenAssignAllocationPointerToCacheFlushVector) {
|
TEST(KernelTest, whenAllocationRequiringCacheFlushThenAssignAllocationPointerToCacheFlushVector) {
|
||||||
MockGraphicsAllocation mockAllocation;
|
MockGraphicsAllocation mockAllocation;
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
|
||||||
MockKernelWithInternals kernel(*device);
|
MockKernelWithInternals kernel(*device);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
|
|
||||||
mockAllocation.setMemObjectsAllocationWithWritableFlags(false);
|
mockAllocation.setMemObjectsAllocationWithWritableFlags(false);
|
||||||
mockAllocation.setFlushL3Required(true);
|
mockAllocation.setFlushL3Required(true);
|
||||||
|
|
||||||
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation, rootDeviceIndex);
|
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation);
|
||||||
EXPECT_EQ(&mockAllocation, kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(&mockAllocation, kernel.mockKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(KernelTest, whenKernelRequireCacheFlushAfterWalkerThenRequireCacheFlushAfterWalker) {
|
TEST(KernelTest, whenKernelRequireCacheFlushAfterWalkerThenRequireCacheFlushAfterWalker) {
|
||||||
@@ -2845,30 +2840,28 @@ TEST(KernelTest, whenKernelRequireCacheFlushAfterWalkerThenRequireCacheFlushAfte
|
|||||||
TEST(KernelTest, whenAllocationWriteableThenDoNotAssignAllocationPointerToCacheFlushVector) {
|
TEST(KernelTest, whenAllocationWriteableThenDoNotAssignAllocationPointerToCacheFlushVector) {
|
||||||
MockGraphicsAllocation mockAllocation;
|
MockGraphicsAllocation mockAllocation;
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
|
||||||
MockKernelWithInternals kernel(*device);
|
MockKernelWithInternals kernel(*device);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
|
|
||||||
mockAllocation.setMemObjectsAllocationWithWritableFlags(true);
|
mockAllocation.setMemObjectsAllocationWithWritableFlags(true);
|
||||||
mockAllocation.setFlushL3Required(false);
|
mockAllocation.setFlushL3Required(false);
|
||||||
|
|
||||||
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation, rootDeviceIndex);
|
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation);
|
||||||
EXPECT_EQ(nullptr, kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, kernel.mockKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(KernelTest, whenAllocationReadOnlyNonFlushRequiredThenAssignNullPointerToCacheFlushVector) {
|
TEST(KernelTest, whenAllocationReadOnlyNonFlushRequiredThenAssignNullPointerToCacheFlushVector) {
|
||||||
MockGraphicsAllocation mockAllocation;
|
MockGraphicsAllocation mockAllocation;
|
||||||
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
|
||||||
auto rootDeviceIndex = device->getRootDeviceIndex();
|
|
||||||
MockKernelWithInternals kernel(*device);
|
MockKernelWithInternals kernel(*device);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush.resize(1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush.resize(1);
|
||||||
kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0] = reinterpret_cast<GraphicsAllocation *>(0x1);
|
kernel.mockKernel->kernelArgRequiresCacheFlush[0] = reinterpret_cast<GraphicsAllocation *>(0x1);
|
||||||
|
|
||||||
mockAllocation.setMemObjectsAllocationWithWritableFlags(false);
|
mockAllocation.setMemObjectsAllocationWithWritableFlags(false);
|
||||||
mockAllocation.setFlushL3Required(false);
|
mockAllocation.setFlushL3Required(false);
|
||||||
|
|
||||||
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation, rootDeviceIndex);
|
kernel.mockKernel->addAllocationToCacheFlushVector(0, &mockAllocation);
|
||||||
EXPECT_EQ(nullptr, kernel.mockKernel->kernelDeviceInfos[rootDeviceIndex].kernelArgRequiresCacheFlush[0]);
|
EXPECT_EQ(nullptr, kernel.mockKernel->kernelArgRequiresCacheFlush[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(KernelTest, givenKernelUsesPrivateMemoryWhenDeviceReleasedBeforeKernelThenKernelUsesMemoryManagerFromEnvironment) {
|
TEST(KernelTest, givenKernelUsesPrivateMemoryWhenDeviceReleasedBeforeKernelThenKernelUsesMemoryManagerFromEnvironment) {
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2021 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: MIT
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
|
||||||
|
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
|
||||||
|
|
||||||
using namespace NEO;
|
|
||||||
|
|
||||||
TEST(SvmObjectArgTest, givenSingleGraphicsAllocationWhenCreatingSvmObjectArgThenProperPropertiesAreStored) {
|
|
||||||
GraphicsAllocation graphicsAllocation{0u, GraphicsAllocation::AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
|
|
||||||
SvmObjectArg svmObjectArg(&graphicsAllocation);
|
|
||||||
|
|
||||||
EXPECT_EQ(&graphicsAllocation, svmObjectArg.getGraphicsAllocation(0u));
|
|
||||||
EXPECT_EQ(graphicsAllocation.isCoherent(), svmObjectArg.isCoherent());
|
|
||||||
EXPECT_EQ(graphicsAllocation.getAllocationType(), svmObjectArg.getAllocationType());
|
|
||||||
EXPECT_EQ(nullptr, svmObjectArg.getMultiDeviceSvmAlloc());
|
|
||||||
}
|
|
||||||
TEST(SvmObjectArgTest, givenMultiGraphicsAllocationWhenCreatingSvmObjectArgThenProperPropertiesAreStored) {
|
|
||||||
GraphicsAllocation graphicsAllocation0{0u, GraphicsAllocation::AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
GraphicsAllocation graphicsAllocation1{1u, GraphicsAllocation::AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, 1u};
|
|
||||||
|
|
||||||
MultiGraphicsAllocation multiGraphicsAllocation(1);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation0);
|
|
||||||
multiGraphicsAllocation.addAllocation(&graphicsAllocation1);
|
|
||||||
|
|
||||||
SvmObjectArg svmObjectArg(&multiGraphicsAllocation);
|
|
||||||
|
|
||||||
EXPECT_EQ(&graphicsAllocation0, svmObjectArg.getGraphicsAllocation(0u));
|
|
||||||
EXPECT_EQ(&graphicsAllocation1, svmObjectArg.getGraphicsAllocation(1u));
|
|
||||||
EXPECT_EQ(multiGraphicsAllocation.isCoherent(), svmObjectArg.isCoherent());
|
|
||||||
EXPECT_EQ(multiGraphicsAllocation.getAllocationType(), svmObjectArg.getAllocationType());
|
|
||||||
EXPECT_EQ(&multiGraphicsAllocation, svmObjectArg.getMultiDeviceSvmAlloc());
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(SvmObjectArgTest, givenNullPtrAllocationWhenGettingGraphicsAllocationFromSvmObjectArgThenNullptrIsReturned) {
|
|
||||||
{
|
|
||||||
GraphicsAllocation *nullGraphicsAllocation = nullptr;
|
|
||||||
SvmObjectArg svmObjectArg(nullGraphicsAllocation);
|
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, svmObjectArg.getGraphicsAllocation(0u));
|
|
||||||
}
|
|
||||||
{
|
|
||||||
MultiGraphicsAllocation *nullMultiGraphicsAllocation = nullptr;
|
|
||||||
SvmObjectArg svmObjectArg(nullMultiGraphicsAllocation);
|
|
||||||
|
|
||||||
EXPECT_EQ(nullptr, svmObjectArg.getGraphicsAllocation(0u));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -66,6 +66,7 @@ class MockKernel : public Kernel {
|
|||||||
using Kernel::hasIndirectStatelessAccessToHostMemory;
|
using Kernel::hasIndirectStatelessAccessToHostMemory;
|
||||||
using Kernel::isSchedulerKernel;
|
using Kernel::isSchedulerKernel;
|
||||||
using Kernel::kernelArgHandlers;
|
using Kernel::kernelArgHandlers;
|
||||||
|
using Kernel::kernelArgRequiresCacheFlush;
|
||||||
using Kernel::kernelArguments;
|
using Kernel::kernelArguments;
|
||||||
using Kernel::KernelConfig;
|
using Kernel::KernelConfig;
|
||||||
using Kernel::kernelDeviceInfos;
|
using Kernel::kernelDeviceInfos;
|
||||||
@@ -363,9 +364,7 @@ class MockKernelWithInternals {
|
|||||||
kernelInfo.kernelArgInfo[1].metadata.accessQualifier = NEO::KernelArgMetadata::AccessReadWrite;
|
kernelInfo.kernelArgInfo[1].metadata.accessQualifier = NEO::KernelArgMetadata::AccessReadWrite;
|
||||||
|
|
||||||
mockKernel->setKernelArguments(defaultKernelArguments);
|
mockKernel->setKernelArguments(defaultKernelArguments);
|
||||||
for (const auto &pClDevice : deviceVector) {
|
mockKernel->kernelArgRequiresCacheFlush.resize(2);
|
||||||
mockKernel->kernelDeviceInfos[pClDevice->getRootDeviceIndex()].kernelArgRequiresCacheFlush.resize(2);
|
|
||||||
}
|
|
||||||
mockKernel->kernelArgHandlers.resize(2);
|
mockKernel->kernelArgHandlers.resize(2);
|
||||||
mockKernel->kernelArgHandlers[0] = &Kernel::setArgBuffer;
|
mockKernel->kernelArgHandlers[0] = &Kernel::setArgBuffer;
|
||||||
mockKernel->kernelArgHandlers[1] = &Kernel::setArgBuffer;
|
mockKernel->kernelArgHandlers[1] = &Kernel::setArgBuffer;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "shared/test/unit_test/mocks/mock_graphics_allocation.h"
|
#include "shared/test/unit_test/mocks/mock_graphics_allocation.h"
|
||||||
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
||||||
|
|
||||||
#include "opencl/source/kernel/svm_object_arg.h"
|
|
||||||
#include "opencl/source/scheduler/scheduler_kernel.h"
|
#include "opencl/source/scheduler/scheduler_kernel.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||||
@@ -152,8 +151,7 @@ TEST(SchedulerKernelTest, WhenSettingArgsForSchedulerKernelThenAllocationsAreCor
|
|||||||
allocs[8].get());
|
allocs[8].get());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < 9; i++) {
|
for (uint32_t i = 0; i < 9; i++) {
|
||||||
auto graphicsAllocation = reinterpret_cast<const SvmObjectArg *>(scheduler->getKernelArg(i))->getGraphicsAllocation(device->getRootDeviceIndex());
|
EXPECT_EQ(allocs[i].get(), scheduler->getKernelArg(i));
|
||||||
EXPECT_EQ(allocs[i].get(), graphicsAllocation);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,8 +180,7 @@ TEST(SchedulerKernelTest, GivenNullDebugQueueWhenSettingArgsForSchedulerKernelTh
|
|||||||
allocs[7].get());
|
allocs[7].get());
|
||||||
|
|
||||||
for (uint32_t i = 0; i < 8; i++) {
|
for (uint32_t i = 0; i < 8; i++) {
|
||||||
auto graphicsAllocation = reinterpret_cast<const SvmObjectArg *>(scheduler->getKernelArg(i))->getGraphicsAllocation(device->getRootDeviceIndex());
|
EXPECT_EQ(allocs[i].get(), scheduler->getKernelArg(i));
|
||||||
EXPECT_EQ(allocs[i].get(), graphicsAllocation);
|
|
||||||
}
|
}
|
||||||
EXPECT_EQ(nullptr, scheduler->getKernelArg(8));
|
EXPECT_EQ(nullptr, scheduler->getKernelArg(8));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user