Files
compute-runtime/unit_tests/perf_tests/api/api_tests.cpp
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00

47 lines
1.1 KiB
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "cl_api_tests.h"
#include "runtime/compiler_interface/compiler_interface.h"
#include "runtime/helpers/options.h"
#include "runtime/platform/platform.h"
#include "runtime/kernel/kernel.h"
namespace OCLRT {
api_fixture::api_fixture()
: retVal(CL_SUCCESS),
retSize(0), pContext(nullptr), pKernel(nullptr), pProgram(nullptr) {
}
void api_fixture::SetUp() {
setReferenceTime();
PlatformFixture::SetUp(numPlatformDevices, platformDevices);
DeviceFixture::SetUp();
ASSERT_NE(nullptr, pDevice);
auto pDevice = pPlatform->getDevice(0);
ASSERT_NE(nullptr, pDevice);
cl_device_id clDevice = pDevice;
pContext = Context::create(nullptr, DeviceVector(&clDevice, 1), nullptr, nullptr, retVal);
CommandQueueHwFixture::SetUp(pDevice, pContext);
}
void api_fixture::TearDown() {
delete pKernel;
delete pContext;
delete pProgram;
CommandQueueHwFixture::TearDown();
DeviceFixture::TearDown();
PlatformFixture::TearDown();
}
} // namespace OCLRT