Hello Mat

 找回密码
 立即注册
查看: 1214|回复: 0

Halide

[复制链接]

1323

主题

1551

帖子

0

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22647
发表于 2024-3-3 13:22:34 | 显示全部楼层 |阅读模式
Halide
【1】Cmake编译1
  1. cmake_minimum_required(VERSION 3.29)
  2. project(ContrastAdjust)

  3. #find_package(Halide REQUIRED)
  4. set(HELIDE_SUPPORT_PATH D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/Halide-17.0.1-x86-64-windows/)
  5. set(GENERATED_CONTRAST_ADJUST contrast_adjust)
  6. set(GENERATED_MINMAX min_max)

  7. set(CMAKE_BUILD_TYPE Release)
  8. add_compile_options(-std=c++17 -fno-rtti)

  9. #### Generator
  10. add_executable(contrastAdjustGenerator
  11.     ContrastAdjustGenerator.cpp
  12.     ${HELIDE_SUPPORT_PATH}/share/Halide/tools/GenGen.cpp
  13. )

  14. target_include_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/Halide-17.0.1-x86-64-windows/include/)
  15. target_link_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/Halide-17.0.1-x86-64-windows/lib/)
  16. target_link_libraries(contrastAdjustGenerator Halide)
  17. target_include_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/libjpeg-turbo64/include/)
  18. target_link_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/libjpeg-turbo64/lib/)
  19. target_link_libraries(contrastAdjustGenerator jpeg)
  20. target_link_libraries(contrastAdjustGenerator jpeg-static)
  21. target_link_libraries(contrastAdjustGenerator turbojpeg)
  22. target_link_libraries(contrastAdjustGenerator turbojpeg-static)
  23. target_include_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/libpng/include/)
  24. target_link_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/libpng/lib/)
  25. target_link_libraries(contrastAdjustGenerator libpng16)
  26. target_link_libraries(contrastAdjustGenerator libpng16_static)
  27. target_include_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/zlib/include/)
  28. target_link_directories(contrastAdjustGenerator PRIVATE D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/zlib/lib/)
  29. target_link_libraries(contrastAdjustGenerator zlib)
  30. target_link_libraries(contrastAdjustGenerator zlibstatic)

  31. #### Run generators with Adams2019 auto-scheduler
  32. add_custom_command(TARGET contrastAdjustGenerator POST_BUILD
  33.     COMMAND ./contrastAdjustGenerator -g ${GENERATED_MINMAX} -e c_header,static_library,stmt_html,schedule
  34.     BYPRODUCTS ${GENERATED_MINMAX}.h ${GENERATED_MINMAX}.a ${GENERATED_MINMAX}.stmt.html ${GENERATED_MINMAX}.schedule.h
  35.     COMMENT "Generating min max library")

  36. add_custom_command(TARGET contrastAdjustGenerator POST_BUILD
  37.     COMMAND ./contrastAdjustGenerator -g ${GENERATED_CONTRAST_ADJUST} -e c_header,static_library,stmt_html,schedule
  38.     BYPRODUCTS ${GENERATED_CONTRAST_ADJUST}.h ${GENERATED_CONTRAST_ADJUST}.a ${GENERATED_CONTRAST_ADJUST}.stmt.html ${GENERATED_CONTRAST_ADJUST}.schedule.h
  39.     COMMENT "Generating contrast adjust library")


  40. #### Test app
  41. add_executable(contrastAdjustTest
  42.     ContrastAdjust.cpp
  43. )

  44. target_include_directories(contrastAdjustTest PRIVATE ${CMAKE_BINARY_DIR} D:/2-LearningCode/997_Witiai_Halide/WitiaicvHal/Halide-17.0.1-x86-64-windows/include/ ${HELIDE_SUPPORT_PATH}/share/Halide/tools)
  45. target_link_libraries(contrastAdjustTest ${CMAKE_BINARY_DIR}/${GENERATED_MINMAX}.a ${CMAKE_BINARY_DIR}/${GENERATED_CONTRAST_ADJUST}.a)
  46. add_dependencies(contrastAdjustTest contrastAdjustGenerator)
复制代码
视频:Step1_Cmake编译Halide_Generator文件  https://www.bilibili.com/video/BV1cT42117fu/


算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-11-22 23:14 , Processed in 0.176734 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表