mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-20 13:11:34 +08:00

Change-Id: If965c79d70392db26597aea4c2f3b7ae2820fe96 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
34 lines
732 B
C++
34 lines
732 B
C++
/*
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "context_fixture.h"
|
|
|
|
#include "unit_tests/mocks/mock_context.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace NEO {
|
|
|
|
ContextFixture::ContextFixture()
|
|
: pContext(nullptr) {
|
|
}
|
|
|
|
void ContextFixture::SetUp(cl_uint numDevices, cl_device_id *pDeviceList) {
|
|
auto retVal = CL_SUCCESS;
|
|
pContext = Context::create<MockContext>(nullptr, DeviceVector(pDeviceList, numDevices),
|
|
nullptr, nullptr, retVal);
|
|
ASSERT_NE(nullptr, pContext);
|
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
|
}
|
|
|
|
void ContextFixture::TearDown() {
|
|
if (pContext != nullptr) {
|
|
pContext->release();
|
|
}
|
|
}
|
|
} // namespace NEO
|