Files
compute-runtime/opencl/test/unit_test/api/cl_api_tests.cpp
Mateusz Jablonski f7dcafc295 Pass ClDeviceVector to Program's ctor
Related-To: NEO-5001
Change-Id: Ie0e4395fd3ed9a5df81c7075ef039092a0687b9c
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-10-19 18:47:11 +02:00

46 lines
1.3 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "cl_api_tests.h"
#include "shared/test/unit_test/mocks/mock_device.h"
#include "opencl/test/unit_test/mocks/mock_cl_device.h"
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
#include "opencl/test/unit_test/mocks/mock_context.h"
namespace NEO {
void api_fixture_using_aligned_memory_manager::SetUp() {
retVal = CL_SUCCESS;
retSize = 0;
device = new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockAlignedMallocManagerDevice>(defaultHwInfo.get())};
cl_device_id deviceId = device;
context = Context::create<MockContext>(nullptr, ClDeviceVector(&deviceId, 1), nullptr, nullptr, retVal);
EXPECT_EQ(CL_SUCCESS, retVal);
Context *ctxPtr = reinterpret_cast<Context *>(context);
commandQueue = new MockCommandQueue(context, device, 0);
program = new MockProgram(ctxPtr, false, toClDeviceVector(*device));
Program *prgPtr = reinterpret_cast<Program *>(program);
kernel = new MockKernel(prgPtr, program->mockKernelInfo, *device);
ASSERT_NE(nullptr, kernel);
}
void api_fixture_using_aligned_memory_manager::TearDown() {
delete kernel;
delete commandQueue;
context->release();
program->release();
delete device;
}
} // namespace NEO