Skip to content

Commit 969b78e

Browse files
committed
Fixed compilation of GPU unit tests
1 parent d5258ac commit 969b78e

File tree

3 files changed

+6
-26
lines changed

3 files changed

+6
-26
lines changed

src/core/reference/include/openvino/reference/scatter_elements_update.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void scatter_elem_update_no_reduction(const size_t data_elem_size,
5959
} // namespace
6060

6161
template <typename T>
62-
T reduction_neutral_value(const Reduction reduction_type) {
62+
inline T reduction_neutral_value(const Reduction reduction_type) {
6363
switch (reduction_type) {
6464
case Reduction::MAX:
6565
return std::numeric_limits<T>::lowest();
@@ -76,7 +76,7 @@ T reduction_neutral_value(const Reduction reduction_type) {
7676
}
7777

7878
template <typename T>
79-
std::function<T(const T, const T)> reduction_functor_for(const Reduction reduction_type) {
79+
inline std::function<T(const T, const T)> reduction_functor_for(const Reduction reduction_type) {
8080
switch (reduction_type) {
8181
case Reduction::MAX:
8282
return [](const T a, const T b) {
@@ -97,7 +97,7 @@ std::function<T(const T, const T)> reduction_functor_for(const Reduction reducti
9797
}
9898

9999
template <>
100-
std::function<char(const char, const char)> reduction_functor_for<char>(const Reduction reduction_type) {
100+
inline std::function<char(const char, const char)> reduction_functor_for<char>(const Reduction reduction_type) {
101101
switch (reduction_type) {
102102
case Reduction::MAX:
103103
return [](const char a, const char b) {

src/plugins/intel_gpu/tests/unit/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE CI_BUILD_NUMBER="")
5656
ov_set_threading_interface_for(${TARGET_NAME})
5757

5858
# Workaround to avoid warnings during LTO build
59-
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
59+
if(CMAKE_COMPILER_IS_GNUCXX)
6060
set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS_RELEASE "-Wno-error=maybe-uninitialized -Wno-maybe-uninitialized")
6161
endif()
6262

@@ -75,7 +75,6 @@ target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
7575
${CMAKE_CURRENT_SOURCE_DIR}/test_utils/
7676
$<TARGET_PROPERTY:openvino_intel_gpu_kernels,INTERFACE_INCLUDE_DIRECTORIES>
7777
$<TARGET_PROPERTY:openvino_intel_gpu_runtime,INTERFACE_INCLUDE_DIRECTORIES>
78-
${CMAKE_HOME_DIRECTORY}/src/core/reference/include/
7978
${TEST_COMMON_INCLUDE_DIR})
8079

8180
if(WIN32)

src/plugins/intel_gpu/tests/unit/test_cases/scatter_elements_update_gpu_test.cpp

+2-21
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "test_utils.h"
66

7+
#include "openvino/reference/scatter_elements_update.hpp"
8+
79
#include <intel_gpu/primitives/input_layout.hpp>
810
#include <intel_gpu/primitives/scatter_elements_update.hpp>
911
#include <intel_gpu/runtime/memory.hpp>
@@ -15,27 +17,6 @@
1517
using namespace cldnn;
1618
using namespace ::tests;
1719

18-
#ifdef OPENVINO_STATIC_LIBRARY
19-
namespace ov {
20-
namespace reference {
21-
using Reduction = ov::op::v12::ScatterElementsUpdate::Reduction;
22-
23-
template<typename DataType, typename IndicesType>
24-
void scatter_elem_update(const DataType *input_data,
25-
const IndicesType *indices,
26-
const DataType *updates,
27-
const int64_t axis,
28-
DataType *out_buf,
29-
const Shape &data_shape,
30-
const Shape &indices_shape,
31-
const Reduction reduction_type = Reduction::NONE,
32-
const bool use_init_val = true);
33-
}
34-
}
35-
#else
36-
#include "openvino/reference/scatter_elements_update.hpp"
37-
#endif
38-
3920
template <typename T>
4021
void test_d2411_axisF(bool is_caching_test) {
4122
// Dictionary : 2x4x1x1

0 commit comments

Comments
 (0)