User space AUBs capable of memory re-dumps on CPU-side memory modifications.

Any CPU related updates such as clEnqueueMapBuffer or similar
need to trigger a re-dump of memory prior to the next clEnqueue call.

Change-Id: I7b31e559278e92ff55b6ebab8ef4190caef1ebc0
This commit is contained in:
Milczarek, Slawomir
2018-04-01 18:42:42 +02:00
committed by sys_ocldev
parent e1697d7002
commit b56289a507
8 changed files with 142 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -203,3 +203,22 @@ TEST_F(EnqueueUnmapMemObjTest, UnmapMemObjWaitEvent) {
clReleaseEvent(waitEvent);
clReleaseEvent(retEvent);
}
HWTEST_F(EnqueueUnmapMemObjTest, givenEnqueueUnmapMemObjectWhenNonAubWritableBufferObjectMappedToHostPtrForWritingThenItShouldBeResetToAubWritable) {
auto buffer = std::unique_ptr<Buffer>(BufferHelper<>::create());
ASSERT_NE(nullptr, buffer);
buffer->getGraphicsAllocation()->setTypeAubNonWritable();
auto mappedForWritingPtr = pCmdQ->enqueueMapBuffer(buffer.get(), CL_TRUE, CL_MAP_WRITE, 0, 8, 0, nullptr, nullptr, retVal);
ASSERT_NE(nullptr, mappedForWritingPtr);
retVal = pCmdQ->enqueueUnmapMemObject(
buffer.get(),
mappedForWritingPtr,
0,
nullptr,
nullptr);
ASSERT_EQ(CL_SUCCESS, retVal);
EXPECT_FALSE(buffer->getGraphicsAllocation()->isTypeAubNonWritable());
}