Remove default parameters from setArgSvm function.

Change-Id: I4408ddedfca464d56e24c4daa0c8c7b73791d6a0
This commit is contained in:
Mrozek, Michal
2019-01-28 10:24:11 +01:00
committed by sys_ocldev
parent c0d4122c26
commit f6ceb8fb4f
10 changed files with 34 additions and 34 deletions

View File

@ -250,7 +250,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferToBuffer> : public BuiltinDispa
} else if (operationParams.dstMemObj) {
kernelSplit1DBuilder.setArg(1, operationParams.dstMemObj);
} else {
kernelSplit1DBuilder.setArgSvm(1, operationParams.size.x + operationParams.dstOffset.x, operationParams.dstPtr);
kernelSplit1DBuilder.setArgSvm(1, operationParams.size.x + operationParams.dstOffset.x, operationParams.dstPtr, nullptr, 0u);
}
// Set-up srcOffset
@ -325,14 +325,14 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferRect> : public BuiltinDispatchI
if (operationParams.srcMemObj) {
kernelNoSplit3DBuilder.setArg(0, operationParams.srcMemObj);
} else {
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, is3D ? operationParams.srcPtr : ptrOffset(operationParams.srcPtr, operationParams.srcOffset.z * operationParams.srcSlicePitch));
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, is3D ? operationParams.srcPtr : ptrOffset(operationParams.srcPtr, operationParams.srcOffset.z * operationParams.srcSlicePitch), nullptr, CL_MEM_READ_ONLY);
}
// arg1 = dst
if (operationParams.dstMemObj) {
kernelNoSplit3DBuilder.setArg(1, operationParams.dstMemObj);
} else {
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, is3D ? operationParams.dstPtr : ptrOffset(operationParams.dstPtr, operationParams.dstOffset.z * operationParams.dstSlicePitch));
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, is3D ? operationParams.dstPtr : ptrOffset(operationParams.dstPtr, operationParams.dstOffset.z * operationParams.dstSlicePitch), nullptr, 0u);
}
// arg2 = srcOrigin
@ -415,7 +415,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::FillBuffer> : public BuiltinDispatchInfoB
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Right, 1, static_cast<uint32_t>(operationParams.dstOffset.x + leftSize + middleSizeBytes));
// Set-up srcMemObj with pattern
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), operationParams.srcMemObj->getGraphicsAllocation()->getUnderlyingBuffer(), operationParams.srcMemObj->getGraphicsAllocation());
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), operationParams.srcMemObj->getGraphicsAllocation()->getUnderlyingBuffer(), operationParams.srcMemObj->getGraphicsAllocation(), CL_MEM_READ_ONLY);
// Set-up patternSizeInEls
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Left, 3, static_cast<uint32_t>(operationParams.srcMemObj->getSize()));
@ -485,7 +485,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferToImage3d> : public BuiltinDisp
// Set-up source host ptr / buffer
if (operationParams.srcPtr) {
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, operationParams.srcPtr);
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, operationParams.srcPtr, nullptr, CL_MEM_READ_ONLY);
} else {
kernelNoSplit3DBuilder.setArg(0, operationParams.srcMemObj);
}
@ -575,7 +575,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyImage3dToBuffer> : public BuiltinDisp
// Set-up destination host ptr / buffer
if (operationParams.dstPtr) {
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, operationParams.dstPtr);
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, operationParams.dstPtr, nullptr, 0u);
} else {
kernelNoSplit3DBuilder.setArg(1, operationParams.dstMemObj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Intel Corporation
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -38,11 +38,11 @@ bool BuiltInOp<HWFamily, EBuiltInOps::AuxTranslation>::buildDispatchInfos(MultiD
if (AuxTranslationDirection::AuxToNonAux == operationParams.auxTranslationDirection) {
builder.setKernel(convertToNonAuxKernel.at(kernelInstanceNumber++).get());
builder.setArg(0, memObj);
builder.setArgSvm(1, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()));
builder.setArgSvm(1, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()), nullptr, 0u);
} else {
UNRECOVERABLE_IF(AuxTranslationDirection::NonAuxToAux != operationParams.auxTranslationDirection);
builder.setKernel(convertToAuxKernel.at(kernelInstanceNumber++).get());
builder.setArgSvm(0, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()));
builder.setArgSvm(0, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()), nullptr, 0u);
builder.setArg(1, memObj);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -121,7 +121,7 @@ class Kernel : public BaseObject<_cl_kernel> {
// API entry points
cl_int setArg(uint32_t argIndex, size_t argSize, const void *argVal);
cl_int setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, GraphicsAllocation *svmAlloc = nullptr, cl_mem_flags svmFlags = 0);
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);
void setKernelExecInfo(GraphicsAllocation *argValue);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -378,7 +378,7 @@ struct AUBSimpleArgNonUniformFixture : public KernelAUBFixture<SimpleArgNonUnifo
memset(expectedMemory, 0x0, sizeUserMemory);
kernel->setArgSvm(1, sizeUserMemory, destMemory);
kernel->setArgSvm(1, sizeUserMemory, destMemory, nullptr, 0u);
outBuffer = createHostPtrAllocationFromSvmPtr(destMemory, sizeUserMemory);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -76,7 +76,7 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture,
memset(pExpectedMemory, 0x22, sizeUserMemory);
pKernel->setArg(0, sizeof(int), &argVal);
pKernel->setArgSvm(1, sizeUserMemory, pDestMemory);
pKernel->setArgSvm(1, sizeUserMemory, pDestMemory, nullptr, 0u);
outBuffer = AUBCommandStreamFixture::createResidentAllocationAndStoreItInCsr(pDestMemory, sizeUserMemory);
ASSERT_NE(nullptr, outBuffer);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -878,7 +878,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArg) {
EXPECT_EQ(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
char data[128];
void *svmPtr = &data;
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr, nullptr, 0u));
MockGraphicsAllocation svmAlloc(svmPtr, 128);
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvmAlloc(2, svmPtr, &svmAlloc));
@ -945,17 +945,17 @@ TEST_F(DispatchInfoBuilderTest, SetArgSplit) {
//Set arg SVM
clearCrossThreadData();
builder1D.setArgSvm(SplitDispatch::RegionCoordX::Left, 1, sizeof(svmPtr), svmPtr);
builder1D.setArgSvm(SplitDispatch::RegionCoordX::Left, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
for (auto &dispatchInfo : mdi1D) {
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
}
clearCrossThreadData();
builder2D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, 1, sizeof(svmPtr), svmPtr);
builder2D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
for (auto &dispatchInfo : mdi2D) {
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
}
clearCrossThreadData();
builder3D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, SplitDispatch::RegionCoordZ::Front, 1, sizeof(svmPtr), svmPtr);
builder3D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, SplitDispatch::RegionCoordZ::Front, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
for (auto &dispatchInfo : mdi3D) {
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
}
@ -978,7 +978,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArgNegative) {
diBuilder->bake(multiDispatchInfo);
EXPECT_NE(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(void *), nullptr));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(void *), nullptr, nullptr, 0u));
delete diBuilder;
delete[] buffer;
@ -1000,7 +1000,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArgNullKernel) {
diBuilder->bake(multiDispatchInfo);
EXPECT_EQ(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr, nullptr, 0u));
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvmAlloc(2, svmPtr, &svmAlloc));
delete diBuilder;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -420,7 +420,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CloneKernelTest, cloneKernelWithArgDeviceQueue) {
TEST_F(CloneKernelTest, cloneKernelWithArgSvm) {
char *svmPtr = new char[256];
retVal = pSourceKernel->setArgSvm(0, 256, svmPtr);
retVal = pSourceKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(1u, pSourceKernel->getKernelArguments().size());

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -82,7 +82,7 @@ typedef Test<KernelArgSvmFixture_> KernelArgSvmTest;
TEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtr) {
char *svmPtr = new char[256];
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
EXPECT_EQ(CL_SUCCESS, retVal);
auto pKernelArg = (void **)(pKernel->getCrossThreadData() +
@ -98,7 +98,7 @@ TEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtrStateless) {
pKernelInfo->usesSsh = false;
pKernelInfo->requiresSshForBuffers = false;
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(0u, pKernel->getSurfaceStateHeapSize());
@ -112,7 +112,7 @@ HWTEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtrStateful) {
pKernelInfo->usesSsh = true;
pKernelInfo->requiresSshForBuffers = true;
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_NE(0u, pKernel->getSurfaceStateHeapSize());
@ -317,7 +317,7 @@ class KernelArgSvmTestTyped : public KernelArgSvmTest {
struct SetArgHandlerSetArgSvm {
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, GraphicsAllocation &alloc) {
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc);
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc, 0u);
}
static constexpr bool supportsOffsets() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2018 Intel Corporation
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -77,11 +77,11 @@ TEST_F(PatchedKernelTest, givenKernelWithAllArgsSetWithSvmWhenIsPatchedIsCalledT
uint32_t size = sizeof(int);
auto argsNum = kernel->getKernelArgsNumber();
for (uint32_t i = 0; i < argsNum; i++) {
kernel->setArgSvm(0, size, nullptr, nullptr);
kernel->setArgSvm(0, size, nullptr, nullptr, 0u);
}
EXPECT_FALSE(kernel->isPatched());
for (uint32_t i = 0; i < argsNum; i++) {
kernel->setArgSvm(i, size, nullptr, nullptr);
kernel->setArgSvm(i, size, nullptr, nullptr, 0u);
}
EXPECT_TRUE(kernel->isPatched());
}
@ -97,7 +97,7 @@ TEST_F(PatchedKernelTest, givenKernelWithOneArgumentToPatchWhichIsNonzeroIndexed
kernel.reset(mockKernel.mockKernel);
kernel->initialize();
EXPECT_FALSE(kernel->Kernel::isPatched());
kernel->setArgSvm(1, size, nullptr, nullptr);
kernel->setArgSvm(1, size, nullptr, nullptr, 0u);
EXPECT_TRUE(kernel->Kernel::isPatched());
kernel.release();
}