mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
Add ClDevice
Decouple cl_device_id from Device class. Related-To: NEO-3938 Change-Id: I68543a753aea562f3b47ba0d23a059ff3cffa906 Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -25,11 +25,11 @@ void ApiFixture::SetUp() {
|
||||
|
||||
EXPECT_LT(0u, testedRootDeviceIndex);
|
||||
rootDeviceEnvironmentBackup.swap(pPlatform->peekExecutionEnvironment()->rootDeviceEnvironments[0]);
|
||||
auto pDevice = pPlatform->getDevice(testedRootDeviceIndex);
|
||||
auto pDevice = pPlatform->getClDevice(testedRootDeviceIndex);
|
||||
ASSERT_NE(nullptr, pDevice);
|
||||
|
||||
testedClDevice = pDevice;
|
||||
pContext = Context::create<MockContext>(nullptr, DeviceVector(&testedClDevice, 1), nullptr, nullptr, retVal);
|
||||
pContext = Context::create<MockContext>(nullptr, ClDeviceVector(&testedClDevice, 1), nullptr, nullptr, retVal);
|
||||
EXPECT_EQ(retVal, CL_SUCCESS);
|
||||
|
||||
pCommandQueue = new CommandQueue(pContext, pDevice, nullptr);
|
||||
@@ -53,20 +53,19 @@ void api_fixture_using_aligned_memory_manager::SetUp() {
|
||||
retVal = CL_SUCCESS;
|
||||
retSize = 0;
|
||||
|
||||
device = MockDevice::createWithNewExecutionEnvironment<MockAlignedMallocManagerDevice>(*platformDevices);
|
||||
Device *devPtr = reinterpret_cast<Device *>(device);
|
||||
cl_device_id clDevice = devPtr;
|
||||
device = new MockClDevice{MockDevice::createWithNewExecutionEnvironment<MockAlignedMallocManagerDevice>(*platformDevices)};
|
||||
cl_device_id deviceId = device;
|
||||
|
||||
context = Context::create<MockContext>(nullptr, DeviceVector(&clDevice, 1), nullptr, nullptr, retVal);
|
||||
context = Context::create<MockContext>(nullptr, ClDeviceVector(&deviceId, 1), nullptr, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
Context *ctxPtr = reinterpret_cast<Context *>(context);
|
||||
|
||||
commandQueue = new CommandQueue(context, devPtr, 0);
|
||||
commandQueue = new CommandQueue(context, device, 0);
|
||||
|
||||
program = new MockProgram(*device->getExecutionEnvironment(), ctxPtr, false);
|
||||
Program *prgPtr = reinterpret_cast<Program *>(program);
|
||||
|
||||
kernel = new MockKernel(prgPtr, program->mockKernelInfo, *devPtr);
|
||||
kernel = new MockKernel(prgPtr, program->mockKernelInfo, *device);
|
||||
ASSERT_NE(nullptr, kernel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user