ermig1979 / Simd

C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.
http://ermig1979.github.io/Simd
MIT License
2.04k stars 407 forks source link

inlcuding simd in CMakeLists #167

Closed fredy1221 closed 3 years ago

fredy1221 commented 3 years ago

Hello, Is there a way to integrate simd in my CMakeLists.txt file ? I'm running on nvidia jetson xavier agx

ermig1979 commented 3 years ago

Hello.

There is an example of integration Simd in third party project:

https://github.com/ermig1979/Synet/blob/master/prj/cmake/CMakeLists.txt

I hope that it will help you.

fredy1221 commented 3 years ago

Thanks for your reply, I tried adding the part:


option(SIMD "Use Simd Library" ON)
option(SIMD_AVX512 "Use AVX-512F and AVX512BW" OFF)
option(SIMD_AVX512VNNI "Use AVX-512VNNI" OFF)

if(SIMD)
    set(SIMD_TEST OFF CACHE BOOL "" FORCE)
    set(SIMD_SHARED ON CACHE BOOL "" FORCE)
    set(SIMD_GET_VERSION OFF CACHE BOOL "" FORCE)
    set(SIMD_TOOLCHAIN ${CMAKE_CXX_COMPILER})
    set(SIMD_INFO ${SYNET_INFO} CACHE BOOL "" FORCE)
    set(SIMD_LIB "Simd")    

    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
    add_definitions(-DSYNET_SIMD_LIBRARY_ENABLE)
    add_subdirectory(/home/oreyeon/tkDNN/include/Simd/prj/cmake /home/oreyeon/tkDNN/include/Simd)
else()
    set(SIMD_LIB "")
endif()

and added target_link_libraries(bayerconv tkDNN ${SIMD_LIB}) but when I make the file is still get:

fatal error: Simd: No such file or directory
 #include <Simd>

Simd folder is placed in the directory include which also has tkDNNm, cpp files are in another directory.

I also tried: message(STATUS "Simd lib: ${SIMD_LIB}") in the CMakeList file and got Simd lib: Simd in the command prompt.

ermig1979 commented 3 years ago

You forgot add:

    include_directories($/home/oreyeon/tkDNN/include/Simd/src)
fredy1221 commented 3 years ago

it's still not working

ermig1979 commented 3 years ago
fatal error: Simd: No such file or directory
 #include <Simd>

There is no file with name 'Simd' . You have to include SimdLib.h or SimdLib.hpp.

fredy1221 commented 3 years ago

it worked thank you!