Skip to content

Commit f6ceb8f

Browse files
Remove default parameters from setArgSvm function.
Change-Id: I4408ddedfca464d56e24c4daa0c8c7b73791d6a0
1 parent c0d4122 commit f6ceb8f

File tree

10 files changed

+34
-34
lines changed

10 files changed

+34
-34
lines changed

runtime/built_ins/built_ins.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferToBuffer> : public BuiltinDispa
250250
} else if (operationParams.dstMemObj) {
251251
kernelSplit1DBuilder.setArg(1, operationParams.dstMemObj);
252252
} else {
253-
kernelSplit1DBuilder.setArgSvm(1, operationParams.size.x + operationParams.dstOffset.x, operationParams.dstPtr);
253+
kernelSplit1DBuilder.setArgSvm(1, operationParams.size.x + operationParams.dstOffset.x, operationParams.dstPtr, nullptr, 0u);
254254
}
255255

256256
// Set-up srcOffset
@@ -325,14 +325,14 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferRect> : public BuiltinDispatchI
325325
if (operationParams.srcMemObj) {
326326
kernelNoSplit3DBuilder.setArg(0, operationParams.srcMemObj);
327327
} else {
328-
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, is3D ? operationParams.srcPtr : ptrOffset(operationParams.srcPtr, operationParams.srcOffset.z * operationParams.srcSlicePitch));
328+
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, is3D ? operationParams.srcPtr : ptrOffset(operationParams.srcPtr, operationParams.srcOffset.z * operationParams.srcSlicePitch), nullptr, CL_MEM_READ_ONLY);
329329
}
330330

331331
// arg1 = dst
332332
if (operationParams.dstMemObj) {
333333
kernelNoSplit3DBuilder.setArg(1, operationParams.dstMemObj);
334334
} else {
335-
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, is3D ? operationParams.dstPtr : ptrOffset(operationParams.dstPtr, operationParams.dstOffset.z * operationParams.dstSlicePitch));
335+
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, is3D ? operationParams.dstPtr : ptrOffset(operationParams.dstPtr, operationParams.dstOffset.z * operationParams.dstSlicePitch), nullptr, 0u);
336336
}
337337

338338
// arg2 = srcOrigin
@@ -415,7 +415,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::FillBuffer> : public BuiltinDispatchInfoB
415415
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Right, 1, static_cast<uint32_t>(operationParams.dstOffset.x + leftSize + middleSizeBytes));
416416

417417
// Set-up srcMemObj with pattern
418-
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), operationParams.srcMemObj->getGraphicsAllocation()->getUnderlyingBuffer(), operationParams.srcMemObj->getGraphicsAllocation());
418+
kernelSplit1DBuilder.setArgSvm(2, operationParams.srcMemObj->getSize(), operationParams.srcMemObj->getGraphicsAllocation()->getUnderlyingBuffer(), operationParams.srcMemObj->getGraphicsAllocation(), CL_MEM_READ_ONLY);
419419

420420
// Set-up patternSizeInEls
421421
kernelSplit1DBuilder.setArg(SplitDispatch::RegionCoordX::Left, 3, static_cast<uint32_t>(operationParams.srcMemObj->getSize()));
@@ -485,7 +485,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyBufferToImage3d> : public BuiltinDisp
485485

486486
// Set-up source host ptr / buffer
487487
if (operationParams.srcPtr) {
488-
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, operationParams.srcPtr);
488+
kernelNoSplit3DBuilder.setArgSvm(0, hostPtrSize, operationParams.srcPtr, nullptr, CL_MEM_READ_ONLY);
489489
} else {
490490
kernelNoSplit3DBuilder.setArg(0, operationParams.srcMemObj);
491491
}
@@ -575,7 +575,7 @@ class BuiltInOp<HWFamily, EBuiltInOps::CopyImage3dToBuffer> : public BuiltinDisp
575575

576576
// Set-up destination host ptr / buffer
577577
if (operationParams.dstPtr) {
578-
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, operationParams.dstPtr);
578+
kernelNoSplit3DBuilder.setArgSvm(1, hostPtrSize, operationParams.dstPtr, nullptr, 0u);
579579
} else {
580580
kernelNoSplit3DBuilder.setArg(1, operationParams.dstMemObj);
581581
}

runtime/built_ins/built_ins.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -38,11 +38,11 @@ bool BuiltInOp<HWFamily, EBuiltInOps::AuxTranslation>::buildDispatchInfos(MultiD
3838
if (AuxTranslationDirection::AuxToNonAux == operationParams.auxTranslationDirection) {
3939
builder.setKernel(convertToNonAuxKernel.at(kernelInstanceNumber++).get());
4040
builder.setArg(0, memObj);
41-
builder.setArgSvm(1, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()));
41+
builder.setArgSvm(1, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()), nullptr, 0u);
4242
} else {
4343
UNRECOVERABLE_IF(AuxTranslationDirection::NonAuxToAux != operationParams.auxTranslationDirection);
4444
builder.setKernel(convertToAuxKernel.at(kernelInstanceNumber++).get());
45-
builder.setArgSvm(0, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()));
45+
builder.setArgSvm(0, allocationSize, reinterpret_cast<void *>(graphicsAllocation->getGpuAddress()), nullptr, 0u);
4646
builder.setArg(1, memObj);
4747
}
4848

runtime/kernel/kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -121,7 +121,7 @@ class Kernel : public BaseObject<_cl_kernel> {
121121

122122
// API entry points
123123
cl_int setArg(uint32_t argIndex, size_t argSize, const void *argVal);
124-
cl_int setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, GraphicsAllocation *svmAlloc = nullptr, cl_mem_flags svmFlags = 0);
124+
cl_int setArgSvm(uint32_t argIndex, size_t svmAllocSize, void *svmPtr, GraphicsAllocation *svmAlloc, cl_mem_flags svmFlags);
125125
cl_int setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc);
126126

127127
void setKernelExecInfo(GraphicsAllocation *argValue);

unit_tests/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -378,7 +378,7 @@ struct AUBSimpleArgNonUniformFixture : public KernelAUBFixture<SimpleArgNonUnifo
378378

379379
memset(expectedMemory, 0x0, sizeUserMemory);
380380

381-
kernel->setArgSvm(1, sizeUserMemory, destMemory);
381+
kernel->setArgSvm(1, sizeUserMemory, destMemory, nullptr, 0u);
382382

383383
outBuffer = createHostPtrAllocationFromSvmPtr(destMemory, sizeUserMemory);
384384
}

unit_tests/aub_tests/fixtures/simple_arg_fixture.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -76,7 +76,7 @@ struct SimpleArgFixture : public FixtureFactory::IndirectHeapFixture,
7676
memset(pExpectedMemory, 0x22, sizeUserMemory);
7777

7878
pKernel->setArg(0, sizeof(int), &argVal);
79-
pKernel->setArgSvm(1, sizeUserMemory, pDestMemory);
79+
pKernel->setArgSvm(1, sizeUserMemory, pDestMemory, nullptr, 0u);
8080

8181
outBuffer = AUBCommandStreamFixture::createResidentAllocationAndStoreItInCsr(pDestMemory, sizeUserMemory);
8282
ASSERT_NE(nullptr, outBuffer);

unit_tests/fixtures/simple_arg_fixture.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*

unit_tests/helpers/dispatch_info_builder_tests.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -878,7 +878,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArg) {
878878
EXPECT_EQ(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
879879
char data[128];
880880
void *svmPtr = &data;
881-
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr));
881+
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr, nullptr, 0u));
882882
MockGraphicsAllocation svmAlloc(svmPtr, 128);
883883
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvmAlloc(2, svmPtr, &svmAlloc));
884884

@@ -945,17 +945,17 @@ TEST_F(DispatchInfoBuilderTest, SetArgSplit) {
945945

946946
//Set arg SVM
947947
clearCrossThreadData();
948-
builder1D.setArgSvm(SplitDispatch::RegionCoordX::Left, 1, sizeof(svmPtr), svmPtr);
948+
builder1D.setArgSvm(SplitDispatch::RegionCoordX::Left, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
949949
for (auto &dispatchInfo : mdi1D) {
950950
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
951951
}
952952
clearCrossThreadData();
953-
builder2D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, 1, sizeof(svmPtr), svmPtr);
953+
builder2D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
954954
for (auto &dispatchInfo : mdi2D) {
955955
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
956956
}
957957
clearCrossThreadData();
958-
builder3D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, SplitDispatch::RegionCoordZ::Front, 1, sizeof(svmPtr), svmPtr);
958+
builder3D.setArgSvm(SplitDispatch::RegionCoordX::Left, SplitDispatch::RegionCoordY::Top, SplitDispatch::RegionCoordZ::Front, 1, sizeof(svmPtr), svmPtr, nullptr, 0u);
959959
for (auto &dispatchInfo : mdi3D) {
960960
EXPECT_EQ(svmPtr, *(reinterpret_cast<void **>(dispatchInfo.getKernel()->getCrossThreadData() + 0x30)));
961961
}
@@ -978,7 +978,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArgNegative) {
978978

979979
diBuilder->bake(multiDispatchInfo);
980980
EXPECT_NE(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
981-
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(void *), nullptr));
981+
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(void *), nullptr, nullptr, 0u));
982982

983983
delete diBuilder;
984984
delete[] buffer;
@@ -1000,7 +1000,7 @@ TEST_F(DispatchInfoBuilderTest, setKernelArgNullKernel) {
10001000

10011001
diBuilder->bake(multiDispatchInfo);
10021002
EXPECT_EQ(CL_SUCCESS, diBuilder->setArg(0, sizeof(cl_mem *), pVal));
1003-
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr));
1003+
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvm(1, sizeof(svmPtr), svmPtr, nullptr, 0u));
10041004
EXPECT_EQ(CL_SUCCESS, diBuilder->setArgSvmAlloc(2, svmPtr, &svmAlloc));
10051005

10061006
delete diBuilder;

unit_tests/kernel/clone_kernel_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -420,7 +420,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CloneKernelTest, cloneKernelWithArgDeviceQueue) {
420420
TEST_F(CloneKernelTest, cloneKernelWithArgSvm) {
421421
char *svmPtr = new char[256];
422422

423-
retVal = pSourceKernel->setArgSvm(0, 256, svmPtr);
423+
retVal = pSourceKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
424424
ASSERT_EQ(CL_SUCCESS, retVal);
425425

426426
EXPECT_EQ(1u, pSourceKernel->getKernelArguments().size());

unit_tests/kernel/kernel_arg_svm_tests.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -82,7 +82,7 @@ typedef Test<KernelArgSvmFixture_> KernelArgSvmTest;
8282
TEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtr) {
8383
char *svmPtr = new char[256];
8484

85-
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
85+
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
8686
EXPECT_EQ(CL_SUCCESS, retVal);
8787

8888
auto pKernelArg = (void **)(pKernel->getCrossThreadData() +
@@ -98,7 +98,7 @@ TEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtrStateless) {
9898
pKernelInfo->usesSsh = false;
9999
pKernelInfo->requiresSshForBuffers = false;
100100

101-
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
101+
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
102102
EXPECT_EQ(CL_SUCCESS, retVal);
103103

104104
EXPECT_EQ(0u, pKernel->getSurfaceStateHeapSize());
@@ -112,7 +112,7 @@ HWTEST_F(KernelArgSvmTest, SetKernelArgValidSvmPtrStateful) {
112112
pKernelInfo->usesSsh = true;
113113
pKernelInfo->requiresSshForBuffers = true;
114114

115-
auto retVal = pKernel->setArgSvm(0, 256, svmPtr);
115+
auto retVal = pKernel->setArgSvm(0, 256, svmPtr, nullptr, 0u);
116116
EXPECT_EQ(CL_SUCCESS, retVal);
117117

118118
EXPECT_NE(0u, pKernel->getSurfaceStateHeapSize());
@@ -317,7 +317,7 @@ class KernelArgSvmTestTyped : public KernelArgSvmTest {
317317

318318
struct SetArgHandlerSetArgSvm {
319319
static void setArg(Kernel &kernel, uint32_t argNum, void *ptrToPatch, size_t allocSize, GraphicsAllocation &alloc) {
320-
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc);
320+
kernel.setArgSvm(argNum, allocSize, ptrToPatch, &alloc, 0u);
321321
}
322322

323323
static constexpr bool supportsOffsets() {

unit_tests/kernel/kernel_is_patched_tests.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -77,11 +77,11 @@ TEST_F(PatchedKernelTest, givenKernelWithAllArgsSetWithSvmWhenIsPatchedIsCalledT
7777
uint32_t size = sizeof(int);
7878
auto argsNum = kernel->getKernelArgsNumber();
7979
for (uint32_t i = 0; i < argsNum; i++) {
80-
kernel->setArgSvm(0, size, nullptr, nullptr);
80+
kernel->setArgSvm(0, size, nullptr, nullptr, 0u);
8181
}
8282
EXPECT_FALSE(kernel->isPatched());
8383
for (uint32_t i = 0; i < argsNum; i++) {
84-
kernel->setArgSvm(i, size, nullptr, nullptr);
84+
kernel->setArgSvm(i, size, nullptr, nullptr, 0u);
8585
}
8686
EXPECT_TRUE(kernel->isPatched());
8787
}
@@ -97,7 +97,7 @@ TEST_F(PatchedKernelTest, givenKernelWithOneArgumentToPatchWhichIsNonzeroIndexed
9797
kernel.reset(mockKernel.mockKernel);
9898
kernel->initialize();
9999
EXPECT_FALSE(kernel->Kernel::isPatched());
100-
kernel->setArgSvm(1, size, nullptr, nullptr);
100+
kernel->setArgSvm(1, size, nullptr, nullptr, 0u);
101101
EXPECT_TRUE(kernel->Kernel::isPatched());
102102
kernel.release();
103103
}

0 commit comments

Comments
 (0)