|
| 1 | +/* |
| 2 | + * Copyright (C) 2019 Intel Corporation |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: MIT |
| 5 | + * |
| 6 | + */ |
| 7 | + |
| 8 | +#include "runtime/api/api.h" |
| 9 | + |
| 10 | +using namespace NEO; |
| 11 | + |
| 12 | +TEST(clUnifiedSharedMemoryTests, whenClHostMemAllocINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 13 | + cl_int retVal = CL_SUCCESS; |
| 14 | + clHostMemAllocINTEL(0, nullptr, 0, 0, &retVal); |
| 15 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 16 | +} |
| 17 | + |
| 18 | +TEST(clUnifiedSharedMemoryTests, whenClDeviceMemAllocINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 19 | + cl_int retVal = CL_SUCCESS; |
| 20 | + clDeviceMemAllocINTEL(0, 0, nullptr, 0, 0, &retVal); |
| 21 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 22 | +} |
| 23 | + |
| 24 | +TEST(clUnifiedSharedMemoryTests, whenClSharedMemAllocINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 25 | + cl_int retVal = CL_SUCCESS; |
| 26 | + clSharedMemAllocINTEL(0, 0, nullptr, 0, 0, &retVal); |
| 27 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 28 | +} |
| 29 | + |
| 30 | +TEST(clUnifiedSharedMemoryTests, whenClMemFreeINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 31 | + auto retVal = clMemFreeINTEL(0, nullptr); |
| 32 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 33 | +} |
| 34 | + |
| 35 | +TEST(clUnifiedSharedMemoryTests, whenClGetMemAllocInfoINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 36 | + auto retVal = clGetMemAllocInfoINTEL(0, nullptr, 0, 0, nullptr, nullptr); |
| 37 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 38 | +} |
| 39 | + |
| 40 | +TEST(clUnifiedSharedMemoryTests, whenClSetKernelArgMemPointerINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 41 | + auto retVal = clSetKernelArgMemPointerINTEL(0, 0, nullptr); |
| 42 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 43 | +} |
| 44 | + |
| 45 | +TEST(clUnifiedSharedMemoryTests, whenclEnqueueMemsetINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 46 | + auto retVal = clEnqueueMemsetINTEL(0, nullptr, 0, 0, 0, nullptr, nullptr); |
| 47 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 48 | +} |
| 49 | + |
| 50 | +TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemcpyINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 51 | + auto retVal = clEnqueueMemcpyINTEL(0, 0, nullptr, nullptr, 0, 0, nullptr, nullptr); |
| 52 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 53 | +} |
| 54 | + |
| 55 | +TEST(clUnifiedSharedMemoryTests, whenClEnqueueMigrateMemINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 56 | + auto retVal = clEnqueueMigrateMemINTEL(0, nullptr, 0, 0, 0, nullptr, nullptr); |
| 57 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 58 | +} |
| 59 | + |
| 60 | +TEST(clUnifiedSharedMemoryTests, whenClEnqueueMemAdviseINTELisCalledThenOutOfHostMemoryErrorIsReturned) { |
| 61 | + auto retVal = clEnqueueMemAdviseINTEL(0, nullptr, 0, 0, 0, nullptr, nullptr); |
| 62 | + EXPECT_EQ(CL_OUT_OF_HOST_MEMORY, retVal); |
| 63 | +} |
0 commit comments