mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00
[11/n] Unified Shared Memory
-wire in support for clEnqueueMemcpyINTEL Related-To: NEO-3148 Change-Id: I3aa758d288fe5b0fd38d25e28d69ae0017ff8730 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
8ac710d3e2
commit
e6930c4769
@ -156,9 +156,46 @@ TEST(clUnifiedSharedMemoryTests, whenclEnqueueMemsetINTELisCalledThenOutOfHostMe
|
||||
EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal);
|
||||
}
|
||||
|
||||
TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemcpyINTELisCalledThenOutOfHostMemoryErrorIsReturned) {
|
||||
TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemcpyINTELisCalledWithWrongQueueThenInvalidQueueErrorIsReturned) {
|
||||
auto retVal = clEnqueueMemcpyINTEL(0, 0, nullptr, nullptr, 0, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal);
|
||||
EXPECT_EQ(CL_INVALID_COMMAND_QUEUE, retVal);
|
||||
}
|
||||
TEST(clUnifiedSharedMemoryTests, givenTwoUnifiedMemoryAllocationsWhenTheyAreCopiedThenProperParamtersArePassed) {
|
||||
|
||||
auto mockContext = std::make_unique<MockContext>();
|
||||
cl_int retVal = CL_SUCCESS;
|
||||
|
||||
auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
|
||||
auto unfiedMemorySharedAllocation = clSharedMemAllocINTEL(mockContext.get(), mockContext->getDevice(0u), nullptr, 400, 0, &retVal);
|
||||
|
||||
struct MockedCommandQueue : public CommandQueue {
|
||||
cl_int enqueueSVMMemcpy(cl_bool blockingCopy,
|
||||
void *dstPtr,
|
||||
const void *srcPtr,
|
||||
size_t size,
|
||||
cl_uint numEventsInWaitList,
|
||||
const cl_event *eventWaitList,
|
||||
cl_event *event) override {
|
||||
EXPECT_EQ(0u, blockingCopy);
|
||||
EXPECT_EQ(expectedDstPtr, dstPtr);
|
||||
EXPECT_EQ(expectedSrcPtr, srcPtr);
|
||||
EXPECT_EQ(400u, size);
|
||||
EXPECT_EQ(0u, numEventsInWaitList);
|
||||
EXPECT_EQ(nullptr, eventWaitList);
|
||||
EXPECT_EQ(nullptr, event);
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
void *expectedDstPtr = nullptr;
|
||||
const void *expectedSrcPtr = nullptr;
|
||||
};
|
||||
MockedCommandQueue queue;
|
||||
queue.expectedDstPtr = unfiedMemoryDeviceAllocation;
|
||||
queue.expectedSrcPtr = unfiedMemorySharedAllocation;
|
||||
|
||||
retVal = clEnqueueMemcpyINTEL(&queue, 0, unfiedMemoryDeviceAllocation, unfiedMemorySharedAllocation, 400u, 0, nullptr, nullptr);
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
clMemFreeINTEL(mockContext.get(), unfiedMemoryDeviceAllocation);
|
||||
clMemFreeINTEL(mockContext.get(), unfiedMemorySharedAllocation);
|
||||
}
|
||||
|
||||
TEST(clUnifiedSharedMemoryTests, whenClEnqueueMigrateMemINTELisCalledThenOutOfHostMemoryErrorIsReturned) {
|
||||
|
Reference in New Issue
Block a user