diff --git a/cmake/ImportIonBB.cmake b/cmake/ImportIonBB.cmake index a2fa4990..5c4bfbb9 100644 --- a/cmake/ImportIonBB.cmake +++ b/cmake/ImportIonBB.cmake @@ -48,6 +48,6 @@ macro(ion_import_building_block) add_library(ion-bb SHARED ${CMAKE_BINARY_DIR}/ion-bb.cc) target_include_directories(ion-bb PUBLIC ${PROJECT_SOURCE_DIR}/include ${ION_BB_INCLUDE_DIRS}) - target_link_libraries(ion-bb PUBLIC Halide::Halide Halide::Runtime) + target_link_libraries(ion-bb PUBLIC ion-core ${ION_BB_LIBRARIES}) install(TARGETS ion-bb DESTINATION lib) endmacro() diff --git a/include/ion-bb-dnn/rt_dnndk.h b/include/ion-bb-dnn/rt_dnndk.h index 5a32a061..049dfe64 100644 --- a/include/ion-bb-dnn/rt_dnndk.h +++ b/include/ion-bb-dnn/rt_dnndk.h @@ -6,7 +6,6 @@ #include #include #include -#include #include #include #include diff --git a/include/ion-bb-dnn/rt_util.h b/include/ion-bb-dnn/rt_util.h index fa60ec1b..ad5d2889 100644 --- a/include/ion-bb-dnn/rt_util.h +++ b/include/ion-bb-dnn/rt_util.h @@ -2,12 +2,18 @@ #define ION_BB_DNN_UTIL_H #include -#include #include #include #include #include +#ifdef _WIN32 +#include +#else +#include +#endif + + #include namespace ion { diff --git a/include/ion-bb-image-io/bb.h b/include/ion-bb-image-io/bb.h index 875bb065..6bfc1190 100644 --- a/include/ion-bb-image-io/bb.h +++ b/include/ion-bb-image-io/bb.h @@ -2,7 +2,9 @@ #define ION_BB_IMAGE_IO_BB_H #include +#ifndef _WIN32 #include +#endif #include "sole.hpp" @@ -546,11 +548,12 @@ class ImageSaver : public ion::BuildingBlock { } // namespace image_io } // namespace bb } // namespace ion - +#ifndef _WIN32 ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::IMX219, image_io_imx219); ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::D435, image_io_d435); ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::Camera, image_io_camera); ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::GenericV4L2Bayer, image_io_generic_v4l2_bayer); +#endif ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::CameraSimulation, image_io_camera_simulation); ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::GUIDisplay, image_io_gui_display); ION_REGISTER_BUILDING_BLOCK(ion::bb::image_io::FBDisplay, image_io_fb_display); diff --git a/include/ion-bb-image-processing/bb.h b/include/ion-bb-image-processing/bb.h index b77733de..2f4105e2 100644 --- a/include/ion-bb-image-processing/bb.h +++ b/include/ion-bb-image-processing/bb.h @@ -99,7 +99,7 @@ class Luminance { static Halide::Expr calc(Method method, Halide::Expr r, Halide::Expr g, Halide::Expr b) { switch (method) { case Method::Max: - return Halide::max(r, g, b); + return (Halide::max)(r, g, b); case Method::Average: return (r + g + b) / 3; case Method::SimpleY: @@ -171,7 +171,7 @@ const std::map BoundaryConditions::enum Halide::Expr lut_interpolation_float(Halide::Func lut, Halide::Expr value, int32_t lut_size) { Halide::Expr index0, index1, diff, coef; index0 = Halide::cast(Halide::Int(32), Halide::floor(value * lut_size)); - index1 = Halide::min(index0 + 1, lut_size); + index1 = (Halide::min)(index0 + 1, lut_size); diff = lut(index1) - lut(index0); coef = value - index0; return lut(index0) + coef * diff; @@ -1010,8 +1010,8 @@ class LensDistortionCorrectionLUT : public BuildingBlock { Halide::Expr max_x, max_y, dx, dy, r2, r_coef; Halide::Expr map_x, map_y, x0, y0, x1, y1, x_coef, y_coef; - max_x = Halide::max(cx, Halide::cast(width) - cx); - max_y = Halide::max(cy, Halide::cast(height) - cy); + max_x = (Halide::max)(cx, Halide::cast(width) - cx); + max_y = (Halide::max)(cy, Halide::cast(height) - cy); dx = x - cx; dy = y - cy; r2 = (dx * dx + dy * dy) / (max_x * max_x + max_y * max_y); @@ -1305,8 +1305,8 @@ class ResizeAreaAverage : public BuildingBlock { base_y = Halide::cast(Halide::floor(start_y)); sum(x, y, Halide::_) += input_wrapper(base_x + r.x, base_y + r.y, Halide::_) * - (Halide::clamp(end_x - (base_x + r.x), 0.f, 1.f) - Halide::max(start_x - (base_x + r.x), 0.f)) * - (Halide::clamp(end_y - (base_y + r.y), 0.f, 1.f) - Halide::max(start_y - (base_y + r.y), 0.f)); + (Halide::clamp(end_x - (base_x + r.x), 0.f, 1.f) - (Halide::max)(start_x - (base_x + r.x), 0.f)) * + (Halide::clamp(end_y - (base_y + r.y), 0.f, 1.f) - (Halide::max)(start_y - (base_y + r.y), 0.f)); output(x, y, Halide::_) = sum(x, y, Halide::_) / (pix_size * pix_size); } @@ -1843,8 +1843,8 @@ class ColorSpaceConverterRGBToHSV : public ion::BuildingBlock= disp, INT32_MAX, outside_x, 0, outside_y, 0, likely(lcost(rd + 1, px, py)[0]) + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr newCost = select(inside, cast(cost_wrap(rd, bx, by) + pen - minCost), @@ -532,7 +532,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, tmp(r.x - 1, x, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, tmp(r.x + 1, x, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr newCost = cost(r.x, lx, ly) + pen - minCost; tmp(r.x, x, r.y) = Tuple( @@ -576,7 +576,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, lcost(r.x - 1, px, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, lcost(r.x + 1, px, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr ix = x - (mHeight - 1 - by); Expr iy = by; @@ -626,7 +626,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, lcost(r.x - 1, px, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, lcost(r.x + 1, px, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr ix = x - by; Expr iy = by; @@ -675,7 +675,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, lcost(r.x - 1, px, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, lcost(r.x + 1, px, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr newCost = select(inside, cast( @@ -714,7 +714,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, lcost(r.x - 1, px, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, lcost(r.x + 1, px, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr newCost = select(inside, cast( @@ -759,7 +759,7 @@ class SGM2 : public ion::BuildingBlock { Expr cost1 = select(r.x <= 0, INT_MAX, lcost(r.x - 1, px, py)[0] + PENALTY1); Expr cost2 = select((r.x + 1) >= mMaxDisp, INT_MAX, lcost(r.x + 1, px, py)[0] + PENALTY1); Expr cost3 = minCost + PENALTY2; - Expr pen = min(min(cost0, cost1), min(cost2, cost3)); + Expr pen = (Halide::min)((Halide::min)(cost0, cost1), (Halide::min)(cost2, cost3)); Expr newCost = select(inside, cast( diff --git a/test/metadata.cc b/test/metadata.cc index aa9e0447..ff8c10e3 100644 --- a/test/metadata.cc +++ b/test/metadata.cc @@ -7,7 +7,9 @@ #ifdef HALIDE_FOR_FPGA #include "ion-bb-fpga/bb.h" #endif +#ifndef _WIN32 #include "ion-bb-image-io/bb.h" +#endif #include "ion-bb-image-processing/bb.h" #include "ion-bb-internal/bb.h" #include "ion-bb-opencv/bb.h" diff --git a/test/test-rt.h b/test/test-rt.h index 06339961..7a744548 100644 --- a/test/test-rt.h +++ b/test/test-rt.h @@ -7,7 +7,11 @@ #include #include +#ifdef _WIN32 +#include +#else #include +#endif #ifdef _WIN32 #define DLLEXPORT __declspec(dllexport)