diff --git a/.ci/azure/windows.yml b/.ci/azure/windows.yml index d1a40bae9..8014a19d0 100644 --- a/.ci/azure/windows.yml +++ b/.ci/azure/windows.yml @@ -123,6 +123,7 @@ jobs: -DENABLE_CPPLINT=OFF ^ -DENABLE_SAMPLES=OFF ^ -DENABLE_PYTHON=ON ^ + -DENABLE_JS=OFF ^ -DCMAKE_C_COMPILER:PATH="$(MSVC_COMPILER_PATH)" ^ -DCMAKE_CXX_COMPILER:PATH="$(MSVC_COMPILER_PATH)" ^ $(OPENVINO_REPO_DIR) diff --git a/modules/nvidia_plugin/src/ops/clamp_cudnn.cpp b/modules/nvidia_plugin/src/ops/clamp_cudnn.cpp index 7188bce83..d848202e0 100644 --- a/modules/nvidia_plugin/src/ops/clamp_cudnn.cpp +++ b/modules/nvidia_plugin/src/ops/clamp_cudnn.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "converters.hpp" @@ -128,13 +127,36 @@ WorkbufferRequest ClampCuDnnOp::GetWorkBufferRequest() const { return {{el_size, el_size}, {}}; } +namespace { +template +T double_to_int(double x, double float_to_int_converter(double)) { + if (!std::is_integral()) { + OPENVINO_THROW("Function double_to_int template parameter must be an integral type."); + } + + x = float_to_int_converter(x); + + double min_t = static_cast(std::numeric_limits::min()); + if (x < min_t) { + return std::numeric_limits::min(); + } + + double max_t = static_cast(std::numeric_limits::max()); + if (x > max_t) { + return std::numeric_limits::max(); + } + + return static_cast(x); +} +} + template void ClampCuDnnOp::initBuffers(const Buffers& buffers) const { T max{}; T min{}; if constexpr (std::is_integral()) { - max = ngraph::double_to_int(max_, std::floor); - min = ngraph::double_to_int(min_, std::ceil); + max = double_to_int(max_, std::floor); + min = double_to_int(min_, std::ceil); } else { max = static_cast(max_); min = static_cast(min_);