mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
Change signature of CommandStreamReceiver::expectMemory
return bool value Change-Id: Ia3471199c5fc4449ce13f92705080a4db96f88dd Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e46142be4d
commit
bd3931a9fb
@@ -5183,8 +5183,8 @@ CL_API_ENTRY cl_int CL_API_CALL clEnqueueVerifyMemoryINTEL(cl_command_queue comm
|
||||
}
|
||||
|
||||
auto &csr = pCommandQueue->getGpgpuCommandStreamReceiver();
|
||||
retVal = csr.expectMemory(allocationPtr, expectedData, sizeOfComparison, comparisonMode);
|
||||
return retVal;
|
||||
auto status = csr.expectMemory(allocationPtr, expectedData, sizeOfComparison, comparisonMode);
|
||||
return status ? CL_SUCCESS : CL_INVALID_VALUE;
|
||||
}
|
||||
|
||||
cl_int CL_API_CALL clAddCommentINTEL(cl_device_id device, const char *comment) {
|
||||
|
||||
@@ -54,7 +54,7 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
bool writeMemory(GraphicsAllocation &gfxAllocation) override;
|
||||
MOCKABLE_VIRTUAL bool writeMemory(AllocationView &allocationView);
|
||||
void expectMMIO(uint32_t mmioRegister, uint32_t expectedValue);
|
||||
int32_t expectMemory(const void *gfxAddress, const void *srcAddress, size_t length, uint32_t compareOperation) override;
|
||||
bool expectMemory(const void *gfxAddress, const void *srcAddress, size_t length, uint32_t compareOperation) override;
|
||||
|
||||
AubSubCaptureStatus checkAndActivateAubSubCapture(const MultiDispatchInfo &dispatchInfo) override;
|
||||
void addAubComment(const char *message) override;
|
||||
|
||||
@@ -675,8 +675,8 @@ void AUBCommandStreamReceiverHw<GfxFamily>::expectMMIO(uint32_t mmioRegister, ui
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
int32_t AUBCommandStreamReceiverHw<GfxFamily>::expectMemory(const void *gfxAddress, const void *srcAddress,
|
||||
size_t length, uint32_t compareOperation) {
|
||||
bool AUBCommandStreamReceiverHw<GfxFamily>::expectMemory(const void *gfxAddress, const void *srcAddress,
|
||||
size_t length, uint32_t compareOperation) {
|
||||
pollForCompletion();
|
||||
|
||||
auto streamLocked = getAubStream()->lockStream();
|
||||
@@ -696,8 +696,7 @@ int32_t AUBCommandStreamReceiverHw<GfxFamily>::expectMemory(const void *gfxAddre
|
||||
};
|
||||
|
||||
this->ppgtt->pageWalk(reinterpret_cast<uintptr_t>(gfxAddress), length, 0, PageTableEntry::nonValidBits, walker, MemoryBanks::BankNotSpecified);
|
||||
|
||||
return CL_SUCCESS;
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
|
||||
@@ -22,8 +22,7 @@ struct clEnqueueVerifyMemoryINTELSettings {
|
||||
const cl_uint comparisonMode = CL_MEM_COMPARE_EQUAL;
|
||||
const size_t bufferSize = 1;
|
||||
static constexpr size_t expectedSize = 1;
|
||||
int expected[expectedSize];
|
||||
// Use any valid pointer as gpu address because non aub tests will not actually validate the memory
|
||||
int expected[expectedSize]{};
|
||||
void *gpuAddress = expected;
|
||||
};
|
||||
|
||||
@@ -51,7 +50,13 @@ TEST_F(clEnqueueVerifyMemoryINTELTests, givenInvalidCommandQueueWhenCallingVerif
|
||||
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retval);
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueVerifyMemoryINTELTests, givenCommandQueueWithoutAubCsrWhenCallingVerifyMemoryThenSuccessIsReturned) {
|
||||
TEST_F(clEnqueueVerifyMemoryINTELTests, givenEqualMemoryWhenCallingVerifyMemoryThenSuccessIsReturned) {
|
||||
cl_int retval = clEnqueueVerifyMemoryINTEL(pCommandQueue, gpuAddress, expected, expectedSize, comparisonMode);
|
||||
EXPECT_EQ(CL_SUCCESS, retval);
|
||||
}
|
||||
|
||||
TEST_F(clEnqueueVerifyMemoryINTELTests, givenNotEqualMemoryWhenCallingVerifyMemoryThenInvalidValueErrorIsReturned) {
|
||||
int differentMemory = expected[0] + 1;
|
||||
cl_int retval = clEnqueueVerifyMemoryINTEL(pCommandQueue, gpuAddress, &differentMemory, sizeof(differentMemory), comparisonMode);
|
||||
EXPECT_EQ(CL_INVALID_VALUE, retval);
|
||||
}
|
||||
|
||||
@@ -833,10 +833,9 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenAskedForMemoryExpectation
|
||||
public:
|
||||
using AUBCommandStreamReceiverHw<FamilyType>::AUBCommandStreamReceiverHw;
|
||||
|
||||
cl_int expectMemory(const void *gfxAddress, const void *srcAddress, size_t length, uint32_t compareOperation) override {
|
||||
bool expectMemory(const void *gfxAddress, const void *srcAddress, size_t length, uint32_t compareOperation) override {
|
||||
inputCompareOperation = compareOperation;
|
||||
AUBCommandStreamReceiverHw<FamilyType>::expectMemory(gfxAddress, srcAddress, length, compareOperation);
|
||||
return CL_SUCCESS;
|
||||
return AUBCommandStreamReceiverHw<FamilyType>::expectMemory(gfxAddress, srcAddress, length, compareOperation);
|
||||
}
|
||||
uint32_t inputCompareOperation = 0;
|
||||
};
|
||||
|
||||
@@ -430,15 +430,15 @@ TEST(CommandStreamReceiverSimpleTest, givenVariousDataSetsWhenVerifyingMemoryThe
|
||||
constexpr auto compareEqual = AubMemDump::CmdServicesMemTraceMemoryCompare::CompareOperationValues::CompareEqual;
|
||||
constexpr auto compareNotEqual = AubMemDump::CmdServicesMemTraceMemoryCompare::CompareOperationValues::CompareNotEqual;
|
||||
|
||||
EXPECT_EQ(CL_SUCCESS, csr.expectMemory(setA1, setA2, setSize, compareEqual));
|
||||
EXPECT_EQ(CL_SUCCESS, csr.expectMemory(setB1, setB2, setSize, compareEqual));
|
||||
EXPECT_EQ(CL_INVALID_VALUE, csr.expectMemory(setA1, setA2, setSize, compareNotEqual));
|
||||
EXPECT_EQ(CL_INVALID_VALUE, csr.expectMemory(setB1, setB2, setSize, compareNotEqual));
|
||||
EXPECT_TRUE(csr.expectMemory(setA1, setA2, setSize, compareEqual));
|
||||
EXPECT_TRUE(csr.expectMemory(setB1, setB2, setSize, compareEqual));
|
||||
EXPECT_FALSE(csr.expectMemory(setA1, setA2, setSize, compareNotEqual));
|
||||
EXPECT_FALSE(csr.expectMemory(setB1, setB2, setSize, compareNotEqual));
|
||||
|
||||
EXPECT_EQ(CL_INVALID_VALUE, csr.expectMemory(setA1, setB1, setSize, compareEqual));
|
||||
EXPECT_EQ(CL_INVALID_VALUE, csr.expectMemory(setA2, setB2, setSize, compareEqual));
|
||||
EXPECT_EQ(CL_SUCCESS, csr.expectMemory(setA1, setB1, setSize, compareNotEqual));
|
||||
EXPECT_EQ(CL_SUCCESS, csr.expectMemory(setA2, setB2, setSize, compareNotEqual));
|
||||
EXPECT_FALSE(csr.expectMemory(setA1, setB1, setSize, compareEqual));
|
||||
EXPECT_FALSE(csr.expectMemory(setA2, setB2, setSize, compareEqual));
|
||||
EXPECT_TRUE(csr.expectMemory(setA1, setB1, setSize, compareNotEqual));
|
||||
EXPECT_TRUE(csr.expectMemory(setA2, setB2, setSize, compareNotEqual));
|
||||
}
|
||||
|
||||
TEST(CommandStreamReceiverMultiContextTests, givenMultipleCsrsWhenSameResourcesAreUsedThenResidencyIsProperlyHandled) {
|
||||
|
||||
Reference in New Issue
Block a user