Compilation with conda build (#13083)
* Compilation with conda forge * Fixed compilation with gcc 12 * Fixed tests compilation * use macro instead of function * Fixed uninitialized variable in tests * Conda * Conda
This commit is contained in:
1 parent
e1545622d3
commit
1bb15b1d18
33 files changed
+146
-64
No files matched your search
@@ -69,94 +69,94 @@ endmacro()
|
||||
#
|
||||
# Provides SSE4.2 compilation flags depending on an OS and a compiler
|
||||
#
|
||||
function(ie_sse42_optimization_flags flags)
|
||||
macro(ie_sse42_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# No such option for MSVC 2019
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxSSE4.2 PARENT_SCOPE)
|
||||
set(${flags} /QxSSE4.2)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xSSE4.2 PARENT_SCOPE)
|
||||
set(${flags} -xSSE4.2)
|
||||
else()
|
||||
set(${flags} -msse4.2 PARENT_SCOPE)
|
||||
set(${flags} -msse4.2)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Provides AVX2 compilation flags depending on an OS and a compiler
|
||||
#
|
||||
function(ie_avx2_optimization_flags flags)
|
||||
macro(ie_avx2_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxCORE-AVX2 PARENT_SCOPE)
|
||||
set(${flags} /QxCORE-AVX2)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} /arch:AVX2 PARENT_SCOPE)
|
||||
set(${flags} /arch:AVX2)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xCORE-AVX2 PARENT_SCOPE)
|
||||
set(${flags} -xCORE-AVX2)
|
||||
else()
|
||||
set(${flags} -mavx2 -mfma PARENT_SCOPE)
|
||||
set(${flags} -mavx2 -mfma)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Provides common AVX512 compilation flags for AVX512F instruction set support
|
||||
# depending on an OS and a compiler
|
||||
#
|
||||
function(ie_avx512_optimization_flags flags)
|
||||
macro(ie_avx512_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxCOMMON-AVX512 PARENT_SCOPE)
|
||||
set(${flags} /QxCOMMON-AVX512)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} /arch:AVX512 PARENT_SCOPE)
|
||||
set(${flags} /arch:AVX512)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xCOMMON-AVX512 PARENT_SCOPE)
|
||||
set(${flags} -xCOMMON-AVX512)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
set(${flags} -mavx512f -mfma)
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Clang|AppleClang)$")
|
||||
set(${flags} -mavx512f -mfma PARENT_SCOPE)
|
||||
set(${flags} -mavx512f -mfma)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
function(ie_arm_neon_optimization_flags flags)
|
||||
macro(ie_arm_neon_optimization_flags flags)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# nothing
|
||||
elseif(ANDROID)
|
||||
if(ANDROID_ABI STREQUAL "arm64-v8a")
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
set(${flags} -mfpu=neon)
|
||||
elseif(ANDROID_ABI STREQUAL "armeabi-v7a-hard with NEON")
|
||||
set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon PARENT_SCOPE)
|
||||
set(${flags} -march=armv7-a -mfloat-abi=hard -mhard-float -D_NDK_MATH_NO_SOFTFP=1 -mfpu=neon)
|
||||
elseif((ANDROID_ABI STREQUAL "armeabi-v7a with NEON") OR
|
||||
(ANDROID_ABI STREQUAL "armeabi-v7a" AND
|
||||
DEFINED CMAKE_ANDROID_ARM_NEON AND CMAKE_ANDROID_ARM_NEON))
|
||||
set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon PARENT_SCOPE)
|
||||
set(${flags} -march=armv7-a -mfloat-abi=softfp -mfpu=neon)
|
||||
endif()
|
||||
else()
|
||||
if(AARCH64)
|
||||
set(${flags} -O2 -ftree-vectorize PARENT_SCOPE)
|
||||
set(${flags} -O2 -ftree-vectorize)
|
||||
elseif(ARM)
|
||||
set(${flags} -mfpu=neon PARENT_SCOPE)
|
||||
set(${flags} -mfpu=neon)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Disables all warnings for 3rd party targets
|
||||
|
||||
@@ -71,8 +71,10 @@ endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
|
||||
set(OV_COMPILER_IS_CLANG ON)
|
||||
else()
|
||||
set(OV_COMPILER_IS_CLANG OFF)
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER MATCHES ".*conda.*")
|
||||
set(OV_COMPILER_IS_CONDA ON)
|
||||
endif()
|
||||
|
||||
get_property(OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
@@ -109,9 +109,10 @@ endif()
|
||||
####################################
|
||||
|
||||
if(NOT TARGET gflags)
|
||||
if(NOT APPLE)
|
||||
# on Apple only dynamic libraries are available
|
||||
# also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU
|
||||
if(NOT APPLE AND NOT DEFINED ENV{CONDA_PREFIX})
|
||||
# - conda-forge contains only dynamic libraries
|
||||
# - on Apple only dynamic libraries are available
|
||||
# also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU
|
||||
find_package(gflags QUIET COMPONENTS nothreads_static)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -11,23 +11,26 @@ file(GLOB LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
|
||||
# Provides compilation flags for AVX512F, AVX512BW, AVX512DQ
|
||||
# instructions support depending on an OS and a compiler
|
||||
#
|
||||
function(ie_avx512_core_optimization_flags flags)
|
||||
macro(ie_avx512_core_optimization_flags flags)
|
||||
if(WIN32)
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} /QxCORE-AVX512 PARENT_SCOPE)
|
||||
set(${flags} /QxCORE-AVX512)
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(${flags} /arch:AVX512 PARENT_SCOPE)
|
||||
set(${flags} /arch:AVX512)
|
||||
else()
|
||||
message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(${flags} -xCORE-AVX512 PARENT_SCOPE)
|
||||
set(${flags} -xCORE-AVX512)
|
||||
else()
|
||||
set(${flags} -mavx512f -mavx512bw -mavx512dq -mfma PARENT_SCOPE)
|
||||
set(${flags} -mavx512f -mavx512bw -mavx512dq -mfma)
|
||||
if(OV_COMPILER_IS_CONDA)
|
||||
list(APPEND ${flags} -Wno-error=maybe-uninitialized -Wno-maybe-uninitialized)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
endmacro()
|
||||
|
||||
if(ENABLE_SSE42)
|
||||
file(GLOB SSE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/cpu_x86_sse42/*.cpp)
|
||||
|
||||
@@ -56,6 +56,10 @@ function(ie_add_onednn)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)
|
||||
ie_add_compiler_flags(-Wno-undef)
|
||||
ie_add_compiler_flags(-Wno-missing-declarations)
|
||||
if(OV_COMPILER_IS_CONDA)
|
||||
ie_add_compiler_flags(-Wno-error=array-bounds)
|
||||
ie_add_compiler_flags(-Wno-error=stringop-overflow=)
|
||||
endif()
|
||||
elseif(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable=10121")
|
||||
endif()
|
||||
|
||||
@@ -21,28 +21,29 @@ endforeach()
|
||||
set(libGNA_LIBRARIES_BASE_PATH ${GNA_PATH} CACHE STRING "" FORCE)
|
||||
|
||||
if(libGNA_FIND_REQUIRED_KERNEL)
|
||||
find_library(GNA_KERNEL_LIBRARY
|
||||
${GNA_KERNEL_LIB_NAME}
|
||||
HINTS
|
||||
${libGNA_LIBRARIES_BASE_PATH})
|
||||
find_library(GNA_KERNEL_LIBRARY ${GNA_KERNEL_LIB_NAME}
|
||||
HINTS ${libGNA_LIBRARIES_BASE_PATH}
|
||||
NO_CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
if(NOT GNA_KERNEL_LIBRARY MATCHES NOTFOUND)
|
||||
if(GNA_KERNEL_LIBRARY)
|
||||
add_library(libGNA::KERNEL SHARED IMPORTED)
|
||||
set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_LOCATION ${GNA_KERNEL_LIBRARY})
|
||||
set(libGNA_KERNEL_FOUND TRUE)
|
||||
else()
|
||||
message(SEND_ERROR "GNA KERNEL library was not found in ${libGNA_LIBRARIES_BASE_PATH}")
|
||||
message(SEND_ERROR "GNA KERNEL library (${GNA_KERNEL_LIB_NAME}) was not found in ${libGNA_LIBRARIES_BASE_PATH}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(libGNA_FIND_REQUIRED_API)
|
||||
find_path(libGNA_INCLUDE_DIRS gna2-api.h PATHS "${GNA_EXT_DIR}/include")
|
||||
if(NOT libGNA_INCLUDE_DIRS MATCHES NOTFOUND)
|
||||
find_path(libGNA_INCLUDE_DIRS gna2-api.h
|
||||
PATHS "${GNA_EXT_DIR}/include"
|
||||
NO_CMAKE_FIND_ROOT_PATH)
|
||||
if(libGNA_INCLUDE_DIRS)
|
||||
add_library(libGNA::API INTERFACE IMPORTED)
|
||||
set_target_properties(libGNA::API PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${libGNA_INCLUDE_DIRS})
|
||||
set(libGNA_API_FOUND TRUE)
|
||||
else()
|
||||
message(SEND_ERROR "GNA API headers was not found in ${GNA_EXT_DIR}/include")
|
||||
message(SEND_ERROR "GNA API headers (gna2-api.h) was not found in ${GNA_EXT_DIR}/include")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ std::vector<layout> border_inst::calc_output_layouts(border_node const& /*node*/
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> border_inst::calc_output_layouts<ov::PartialShape>(border_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string border_inst::to_string(border_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -91,6 +91,8 @@ std::vector<layout> broadcast_inst::calc_output_layouts(broadcast_node const& /*
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> broadcast_inst::calc_output_layouts<ov::PartialShape>(broadcast_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string broadcast_inst::to_string(broadcast_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -71,6 +71,8 @@ std::vector<layout> concatenation_inst::calc_output_layouts(const concatenation_
|
||||
return { layout {output_shape, output_dt, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> concatenation_inst::calc_output_layouts<ov::PartialShape>(concatenation_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string concatenation_inst::to_string(concatenation_node const& node) {
|
||||
auto node_info = node.desc_to_json();
|
||||
auto desc = node.get_primitive();
|
||||
|
||||
@@ -247,6 +247,8 @@ std::vector<layout> eltwise_inst::calc_output_layouts(eltwise_node const& /*node
|
||||
return { output_layout };
|
||||
}
|
||||
|
||||
template std::vector<layout> eltwise_inst::calc_output_layouts<ov::PartialShape>(eltwise_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
static inline std::string stringify_vector(const std::vector<float>& v) {
|
||||
std::stringstream s;
|
||||
|
||||
|
||||
@@ -149,6 +149,9 @@ std::vector<layout> fully_connected_inst::calc_output_layouts(fully_connected_no
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> fully_connected_inst::calc_output_layouts<ov::PartialShape>(fully_connected_node const& node,
|
||||
const kernel_impl_params& impl_param);
|
||||
|
||||
std::string fully_connected_inst::to_string(fully_connected_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -96,6 +96,8 @@ std::vector<layout> gather_inst::calc_output_layouts(gather_node const& /*node*/
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> gather_inst::calc_output_layouts<ov::PartialShape>(gather_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string gather_inst::to_string(gather_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -58,6 +58,9 @@ std::vector<layout> gather_elements_inst::calc_output_layouts(gather_elements_no
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> gather_elements_inst::calc_output_layouts<ov::PartialShape>(gather_elements_node const& node,
|
||||
const kernel_impl_params& impl_param);
|
||||
|
||||
std::string gather_elements_inst::to_string(gather_elements_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -80,6 +80,8 @@ std::vector<layout> gemm_inst::calc_output_layouts(gemm_node const& /*node*/, co
|
||||
return { layout{output_shapes[0], output_type, input0_layout.format, prim->output_padding} };
|
||||
}
|
||||
|
||||
template std::vector<layout> gemm_inst::calc_output_layouts<ov::PartialShape>(gemm_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string gemm_inst::to_string(gemm_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -45,6 +45,8 @@ std::vector<layout> mvn_inst::calc_output_layouts(mvn_node const& /*node*/, cons
|
||||
return { layout{output_shape, output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> mvn_inst::calc_output_layouts<ov::PartialShape>(mvn_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string mvn_inst::to_string(mvn_node const& node) {
|
||||
auto node_info = node.desc_to_json();
|
||||
auto desc = node.get_primitive();
|
||||
|
||||
@@ -79,6 +79,8 @@ std::vector<layout> one_hot_inst::calc_output_layouts(const one_hot_node& /*node
|
||||
return {{output_shapes[0], dt, format::get_default_format(output_shapes[0].size())}};
|
||||
}
|
||||
|
||||
template std::vector<layout> one_hot_inst::calc_output_layouts<ov::PartialShape>(one_hot_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string one_hot_inst::to_string(one_hot_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -81,6 +81,8 @@ std::vector<layout> permute_inst::calc_output_layouts(permute_node const& /*node
|
||||
return { layout{output_shape, output_type, input_layout.format, desc->output_padding} };
|
||||
}
|
||||
|
||||
template std::vector<layout> permute_inst::calc_output_layouts<ov::PartialShape>(permute_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string permute_inst::to_string(permute_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -48,6 +48,8 @@ std::vector<layout> quantize_inst::calc_output_layouts(quantize_node const&, ker
|
||||
return { layout{input_layout.get<ShapeType>(), out_dt, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> quantize_inst::calc_output_layouts<ov::PartialShape>(quantize_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string quantize_inst::to_string(quantize_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -210,6 +210,8 @@ std::vector<layout> reduce_inst::calc_output_layouts(reduce_node const& /*node*/
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> reduce_inst::calc_output_layouts<ov::PartialShape>(reduce_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string reduce_inst::to_string(reduce_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -95,6 +95,8 @@ std::vector<layout> resample_inst::calc_output_layouts(resample_node const& /*no
|
||||
return { layout{output_shapes[0], input_layout.data_type, format::adjust_to_rank(input_layout.format, output_shapes[0].size())} };
|
||||
}
|
||||
|
||||
template std::vector<layout> resample_inst::calc_output_layouts<ov::PartialShape>(resample_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string resample_inst::to_string(resample_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -117,6 +117,8 @@ std::vector<layout> reshape_inst::calc_output_layouts(reshape_node const& /*node
|
||||
return { layout{output_shapes[0], input_layout.data_type, format::adjust_to_rank(input_layout.format, output_shapes[0].size())} };
|
||||
}
|
||||
|
||||
template std::vector<layout> reshape_inst::calc_output_layouts<ov::PartialShape>(reshape_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string reshape_inst::to_string(reshape_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -47,6 +47,8 @@ std::vector<layout> scatter_update_inst::calc_output_layouts(scatter_update_node
|
||||
return { layout{output_shape, output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> scatter_update_inst::calc_output_layouts<ov::PartialShape>(scatter_update_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string scatter_update_inst::to_string(scatter_update_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -48,6 +48,8 @@ std::vector<layout> shape_of_inst::calc_output_layouts(shape_of_node const& /*no
|
||||
return { layout{output_shape, output_dt, format::bfyx} };
|
||||
}
|
||||
|
||||
template std::vector<layout> shape_of_inst::calc_output_layouts<ov::PartialShape>(shape_of_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string shape_of_inst::to_string(shape_of_node const& node) {
|
||||
auto node_info = node.desc_to_json();
|
||||
auto desc = node.get_primitive();
|
||||
|
||||
@@ -82,6 +82,8 @@ std::vector<layout> strided_slice_inst::calc_output_layouts(strided_slice_node c
|
||||
return { layout{output_shapes[0], input0_layout.data_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> strided_slice_inst::calc_output_layouts<ov::PartialShape>(strided_slice_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string strided_slice_inst::to_string(strided_slice_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -75,6 +75,8 @@ std::vector<layout> tile_inst::calc_output_layouts(tile_node const& /*node*/, co
|
||||
return { layout{output_shapes[0], output_type, output_format} };
|
||||
}
|
||||
|
||||
template std::vector<layout> tile_inst::calc_output_layouts<ov::PartialShape>(tile_node const& node, const kernel_impl_params& impl_param);
|
||||
|
||||
std::string tile_inst::to_string(tile_node const& node) {
|
||||
auto desc = node.get_primitive();
|
||||
auto node_info = node.desc_to_json();
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
//
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
#include "jitter.h"
|
||||
#include "tensor_type.h"
|
||||
#include <string>
|
||||
@@ -11,7 +13,6 @@
|
||||
#include <quantize/quantize_kernel_params.h>
|
||||
#include <eltwise/eltwise_kernel_base.h>
|
||||
#include <activation/activation_kernel_base.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
namespace {
|
||||
class JitTerm {
|
||||
|
||||
@@ -22,6 +22,9 @@ if(ENABLE_ONEDNN_FOR_GPU)
|
||||
set(ONEDNN_PREFIX_DIR "${CMAKE_CURRENT_BINARY_DIR}/onednn_gpu_root")
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
ie_add_compiler_flags(-Wno-undef -Wno-suggest-override)
|
||||
if(OV_COMPILER_IS_CONDA)
|
||||
ie_add_compiler_flags(-Wno-error=array-bounds -Wno-error=stringop-overflow= -Wno-error=unused-result)
|
||||
endif()
|
||||
endif()
|
||||
ExternalProject_Add(onednn_gpu_build
|
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/onednn_gpu"
|
||||
|
||||
+8
-8
@@ -199,7 +199,7 @@ TEST_P(OVClassGetPropertyTest_GPU, GetMetricRangeForStreamsAndPrintNoThrow) {
|
||||
TEST_P(OVClassGetPropertyTest_GPU, GetMetricOptimalBatchSizeAndPrintNoThrow) {
|
||||
ov::Core ie;
|
||||
|
||||
unsigned int property;
|
||||
unsigned int property = 0;
|
||||
ASSERT_NO_THROW(property = ie.get_property(target_device, ov::optimal_batch_size));
|
||||
|
||||
std::cout << "OPTIMAL_BATCH_SIZE: " << property << std::endl;
|
||||
@@ -260,7 +260,7 @@ TEST_P(OVClassGetPropertyTest_GPU, GetMetricCapabilitiesAndPrintNoThrow) {
|
||||
TEST_P(OVClassGetPropertyTest_GPU, GetMetricDeviceTotalMemSizeAndPrintNoThrow) {
|
||||
ov::Core ie;
|
||||
|
||||
uint64_t property;
|
||||
uint64_t property = 0;
|
||||
ASSERT_NO_THROW(property = ie.get_property(target_device, ov::intel_gpu::device_total_mem_size));
|
||||
|
||||
std::cout << "GPU_DEVICE_TOTAL_MEM_SIZE: " << property << std::endl;
|
||||
@@ -355,7 +355,7 @@ TEST_P(OVClassGetPropertyTest_GPU, GetAndSetInferencePrecisionNoThrow) {
|
||||
TEST_P(OVClassGetPropertyTest_GPU, GetAndSetModelPriorityNoThrow) {
|
||||
ov::Core ie;
|
||||
|
||||
ov::hint::Priority defaultValue;
|
||||
ov::hint::Priority defaultValue{};
|
||||
ASSERT_NO_THROW(defaultValue = ie.get_property(target_device, ov::hint::model_priority));
|
||||
|
||||
std::cout << "Default PERF_COUNT: " << defaultValue << std::endl;
|
||||
@@ -376,7 +376,7 @@ TEST_P(OVClassGetPropertyTest_GPU, GetAndSetModelPriorityNoThrow) {
|
||||
TEST_P(OVClassGetPropertyTest_GPU, GetAndSetQueuePriorityNoThrow) {
|
||||
ov::Core ie;
|
||||
|
||||
ov::hint::Priority defaultValue;
|
||||
ov::hint::Priority defaultValue{};
|
||||
ASSERT_NO_THROW(defaultValue = ie.get_property(target_device, ov::intel_gpu::hint::queue_priority));
|
||||
|
||||
std::cout << "Default GPU_QUEUE_PRIORITY: " << defaultValue << std::endl;
|
||||
@@ -394,7 +394,7 @@ TEST_P(OVClassGetPropertyTest_GPU, GetAndSetQueuePriorityNoThrow) {
|
||||
TEST_P(OVClassGetPropertyTest_GPU, GetAndSetThrottleLevelNoThrow) {
|
||||
ov::Core ie;
|
||||
|
||||
ov::intel_gpu::hint::ThrottleLevel defaultValue;
|
||||
ov::intel_gpu::hint::ThrottleLevel defaultValue{};
|
||||
ASSERT_NO_THROW(defaultValue = ie.get_property(target_device, ov::intel_gpu::hint::queue_throttle));
|
||||
|
||||
std::cout << "Default GPU_QUEUE_THROTTLE: " << defaultValue << std::endl;
|
||||
@@ -443,7 +443,7 @@ using OVClassGetMetricTest_GPU_OPTIMAL_BATCH_SIZE = OVClassBaseTestP;
|
||||
TEST_P(OVClassGetMetricTest_GPU_OPTIMAL_BATCH_SIZE, GetMetricAndPrintNoThrow) {
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
ov::Core ie;
|
||||
unsigned int p;
|
||||
unsigned int p = 0;
|
||||
|
||||
ov::AnyMap _options = {ov::hint::model(simpleNetwork)};
|
||||
ASSERT_NO_THROW(p = ie.get_property(target_device, ov::optimal_batch_size.name(), _options));
|
||||
@@ -462,7 +462,7 @@ using OVClassGetMetricTest_GPU_MAX_BATCH_SIZE_DEFAULT = OVClassBaseTestP;
|
||||
TEST_P(OVClassGetMetricTest_GPU_MAX_BATCH_SIZE_DEFAULT, GetMetricAndPrintNoThrow) {
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
ov::Core ie;
|
||||
unsigned int p;
|
||||
unsigned int p = 0;
|
||||
|
||||
ov::AnyMap _options = {ov::hint::model(simpleNetwork)};
|
||||
ASSERT_NO_THROW(p = ie.get_property(target_device, ov::max_batch_size.name(), _options));
|
||||
@@ -481,7 +481,7 @@ using OVClassGetMetricTest_GPU_MAX_BATCH_SIZE_STREAM_DEVICE_MEM = OVClassBaseTes
|
||||
TEST_P(OVClassGetMetricTest_GPU_MAX_BATCH_SIZE_STREAM_DEVICE_MEM, GetMetricAndPrintNoThrow) {
|
||||
SKIP_IF_CURRENT_TEST_IS_DISABLED()
|
||||
ov::Core ie;
|
||||
unsigned int p;
|
||||
unsigned int p = 0;
|
||||
auto exec_net1 = ie.compile_model(simpleNetwork, target_device);
|
||||
|
||||
uint32_t n_streams = 2;
|
||||
|
||||
+3
@@ -14,6 +14,9 @@ class ReduceMeanOperation {
|
||||
public:
|
||||
std::vector<int64_t> constantValues;
|
||||
bool keepDims;
|
||||
|
||||
ReduceMeanOperation();
|
||||
ReduceMeanOperation(const std::vector<int64_t>& constantValues, const bool keepDims);
|
||||
};
|
||||
|
||||
class ReduceMeanTransformationParam {
|
||||
|
||||
+9
-2
@@ -12,12 +12,19 @@
|
||||
|
||||
namespace LayerTestsDefinitions {
|
||||
|
||||
ReduceMeanOperation::ReduceMeanOperation() : constantValues(), keepDims() { }
|
||||
|
||||
ReduceMeanOperation::ReduceMeanOperation(const std::vector<int64_t>& constantValues, const bool keepDims) {
|
||||
this->constantValues = constantValues;
|
||||
this->keepDims = keepDims;
|
||||
}
|
||||
|
||||
std::string ReduceMeanTransformation::getTestCaseName(const testing::TestParamInfo<ReduceMeanTransformationParams>& obj) {
|
||||
ngraph::element::Type netPrecision;
|
||||
ngraph::PartialShape inputShape;
|
||||
std::string targetDevice;
|
||||
ngraph::pass::low_precision::LayerTransformation::Params params;
|
||||
ReduceMeanTransformationParam param;;
|
||||
ReduceMeanTransformationParam param;
|
||||
std::tie(netPrecision, inputShape, targetDevice, params, param) = obj.param;
|
||||
|
||||
std::ostringstream result;
|
||||
@@ -39,7 +46,7 @@ void ReduceMeanTransformation::SetUp() {
|
||||
ngraph::element::Type netPrecision;
|
||||
ngraph::PartialShape inputShape;
|
||||
ngraph::pass::low_precision::LayerTransformation::Params params;
|
||||
ReduceMeanTransformationParam param;;
|
||||
ReduceMeanTransformationParam param;
|
||||
std::tie(netPrecision, inputShape, targetDevice, params, param) = GetParam();
|
||||
|
||||
function = ngraph::builder::subgraph::ReduceFunction::get<ngraph::opset1::ReduceMean>(
|
||||
|
||||
@@ -223,7 +223,7 @@ void compare(const ov::Tensor& expected,
|
||||
struct Error {
|
||||
double max = 0.;
|
||||
double mean = 0.;
|
||||
size_t max_coordinate;
|
||||
size_t max_coordinate = 0;
|
||||
size_t count = 0;
|
||||
} abs_error, rel_error;
|
||||
auto less = [] (double a, double b) {
|
||||
|
||||
Vendored
+4
-2
@@ -171,8 +171,10 @@ ov_install_static_lib(fluid ${OV_CPACK_COMP_CORE})
|
||||
# Gflags
|
||||
#
|
||||
|
||||
if(NOT APPLE)
|
||||
# on Apple only dynamic libraries are available
|
||||
if(NOT APPLE AND NOT DEFINED ENV{CONDA_PREFIX})
|
||||
# - conda-forge contains only dynamic libraries
|
||||
# - on Apple only dynamic libraries are available
|
||||
# also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU
|
||||
find_package(gflags QUIET COMPONENTS nothreads_static)
|
||||
endif()
|
||||
|
||||
|
||||
Vendored
+20
-5
@@ -221,11 +221,26 @@ namespace cnpy {
|
||||
|
||||
//write everything
|
||||
if (fp) {
|
||||
fwrite(&local_header[0], sizeof(char), local_header.size(), fp);
|
||||
fwrite(&npy_header[0], sizeof(char), npy_header.size(), fp);
|
||||
fwrite(data, sizeof(T), nels, fp);
|
||||
fwrite(&global_header[0], sizeof(char), global_header.size(), fp);
|
||||
fwrite(&footer[0], sizeof(char), footer.size(), fp);
|
||||
if (fwrite(&local_header[0], sizeof(char), local_header.size(), fp) != local_header.size()) {
|
||||
fclose(fp);
|
||||
throw std::runtime_error("npz_save: failed fwrite");
|
||||
}
|
||||
if (fwrite(&npy_header[0], sizeof(char), npy_header.size(), fp) != npy_header.size()) {
|
||||
fclose(fp);
|
||||
throw std::runtime_error("npz_save: failed fwrite");
|
||||
}
|
||||
if (fwrite(data, sizeof(T), nels, fp) != nels) {
|
||||
fclose(fp);
|
||||
throw std::runtime_error("npz_save: failed fwrite");
|
||||
}
|
||||
if (fwrite(&global_header[0], sizeof(char), global_header.size(), fp) != global_header.size()) {
|
||||
fclose(fp);
|
||||
throw std::runtime_error("npz_save: failed fwrite");
|
||||
}
|
||||
if (fwrite(&footer[0], sizeof(char), footer.size(), fp) != footer.size()) {
|
||||
fclose(fp);
|
||||
throw std::runtime_error("npz_save: failed fwrite");
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user