Skip to content

Commit 880e891

Browse files
Move getDevices to a separate file
Change-Id: Ia5ea548ce233d332a040fd3a50592da294d3d612 Signed-off-by: Filip Hazubski <[email protected]>
1 parent a2c05a2 commit 880e891

File tree

6 files changed

+50
-9
lines changed

6 files changed

+50
-9
lines changed

runtime/dll/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ set(RUNTIME_SRCS_DLL_BASE
1717
${CMAKE_CURRENT_SOURCE_DIR}/create_tbx_sockets.cpp
1818
${CMAKE_CURRENT_SOURCE_DIR}/options.cpp
1919
${CMAKE_CURRENT_SOURCE_DIR}/source_level_debugger.cpp
20+
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/get_devices.cpp
2021

2122
${IGDRCL_SOURCE_DIR}/runtime/api/api.cpp
2223
${IGDRCL_SOURCE_DIR}/runtime/gmm_helper/resource_info.cpp

runtime/dll/create_command_stream.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,12 @@
1010
#include "runtime/command_stream/create_command_stream_impl.h"
1111
#include "runtime/command_stream/device_command_stream.h"
1212
#include "runtime/command_stream/tbx_command_stream_receiver.h"
13-
#include "runtime/helpers/debug_helpers.h"
1413
#include "runtime/helpers/hw_info.h"
15-
#include "runtime/helpers/options.h"
16-
#include "runtime/os_interface/device_factory.h"
1714

1815
namespace OCLRT {
1916

2017
CommandStreamReceiver *createCommandStream(const HardwareInfo *pHwInfo, ExecutionEnvironment &executionEnvironment) {
2118
return createCommandStreamImpl(pHwInfo, executionEnvironment);
2219
}
2320

24-
bool getDevices(HardwareInfo **hwInfo, size_t &numDevicesReturned, ExecutionEnvironment &executionEnviornment) {
25-
return getDevicesImpl(hwInfo, numDevicesReturned, executionEnviornment);
26-
}
27-
2821
} // namespace OCLRT

runtime/dll/get_devices.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "runtime/command_stream/create_command_stream_impl.h"
9+
#include "runtime/execution_environment/execution_environment.h"
10+
#include "runtime/helpers/hw_info.h"
11+
#include "runtime/os_interface/device_factory.h"
12+
13+
namespace OCLRT {
14+
15+
bool getDevices(HardwareInfo **hwInfo, size_t &numDevicesReturned, ExecutionEnvironment &executionEnviornment) {
16+
return getDevicesImpl(hwInfo, numDevicesReturned, executionEnviornment);
17+
}
18+
19+
} // namespace OCLRT

unit_tests/tbx/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ add_executable(igdrcl_tbx_tests
99
${CMAKE_CURRENT_SOURCE_DIR}/tbx_tests_configuration.cpp
1010
${IGDRCL_SOURCE_DIR}/runtime/aub/aub_stream_interface.cpp
1111
${IGDRCL_SOURCE_DIR}/runtime/dll/create_command_stream.cpp
12+
${IGDRCL_SOURCE_DIR}/runtime/dll${BRANCH_DIR_SUFFIX}/get_devices.cpp
1213
${IGDRCL_SOURCE_DIR}/unit_tests/libult/os_interface.cpp
1314
${IGDRCL_SOURCE_DIR}/unit_tests/options.cpp
1415
$<TARGET_OBJECTS:igdrcl_libult>

unit_tests/windows/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@ project(igdrcl_windows_dll_tests)
99

1010
set(NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS
1111
$<TARGET_OBJECTS:igdrcl_libult>
12-
$<TARGET_OBJECTS:igdrcl_libult_cs>
1312
$<TARGET_OBJECTS:igdrcl_libult_env>
1413
)
1514

1615
add_executable(igdrcl_windows_dll_tests
1716
${NEO_IGDRCL_WINDOWS_DLL_TESTS_TARGET_OBJECTS}
1817
${IGDRCL_SOURCE_DIR}/runtime/aub/aub_stream_interface.cpp
18+
${IGDRCL_SOURCE_DIR}/runtime/dll/create_command_stream.cpp
19+
${IGDRCL_SOURCE_DIR}/runtime/dll${BRANCH_DIR_SUFFIX}/get_devices.cpp
1920
${IGDRCL_SOURCE_DIR}/runtime/dll/windows/os_interface.cpp
2021
${IGDRCL_SOURCE_DIR}/runtime/os_interface/windows/wddm/wddm_create.cpp
2122
${IGDRCL_SOURCE_DIR}/unit_tests/ult_configuration.cpp
22-
${CMAKE_CURRENT_SOURCE_DIR}/wddm_create_tests.cpp
23+
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/get_devices_tests.cpp
2324
${CMAKE_CURRENT_SOURCE_DIR}/os_interface_tests.cpp
25+
${CMAKE_CURRENT_SOURCE_DIR}/wddm_create_tests.cpp
2426
)
2527

2628
target_link_libraries(igdrcl_windows_dll_tests ${NEO_MOCKABLE_LIB_NAME} igdrcl_mocks gmock-gtest ${IGDRCL_EXTRA_LIBS})
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (C) 2019 Intel Corporation
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*
6+
*/
7+
8+
#include "runtime/execution_environment/execution_environment.h"
9+
#include "runtime/helpers/hw_info.h"
10+
#include "test.h"
11+
12+
namespace OCLRT {
13+
bool getDevices(HardwareInfo **hwInfo, size_t &numDevicesReturned, ExecutionEnvironment &executionEnvironment);
14+
} // namespace OCLRT
15+
16+
using GetDevicesTests = ::testing::Test;
17+
18+
HWTEST_F(GetDevicesTests, WhenGetDevicesIsCalledThenSuccessIsReturned) {
19+
OCLRT::HardwareInfo *hwInfo;
20+
size_t numDevicesReturned = 0;
21+
OCLRT::ExecutionEnvironment executionEnviornment;
22+
23+
auto returnValue = OCLRT::getDevices(&hwInfo, numDevicesReturned, executionEnviornment);
24+
EXPECT_EQ(true, returnValue);
25+
}

0 commit comments

Comments
 (0)