[mlpack-git] [mlpack/mlpack] LSHSearch Parallelization (#700)

Ryan Curtin notifications at github.com
Fri Jul 1 11:12:23 EDT 2016


> +# This way we can skip calls to functions defined in omp.h with code like:
> +# if(HAS_OPENMP) {omp related stuff}
> +if (HAS_OPENMP)
> +  add_definitions(-DHAS_OPENMP)
> +  find_package(OpenMP)
> +  if (OPENMP_FOUND)
> +    set(HAS_OPENMP "1")
> +    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
> +    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
> +  else ()
> +    set(HAS_OPENMP "0")
> +    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
> +  endif ()
> +else ()
> +    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas")
> +endif()

Hm, so, with what you have changed here, a user must specify `HAS_OPENMP` for OpenMP to be used.  With the previous code, CMake would determine whether or not OpenMP support was available, and if so, OpenMP would be enabled.  I think maybe it is better to use automatic detection here instead of asking the user to specify `-D HAS_OPENMP`; what do you think?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/700/files/3af80c339a7a846bb3bdf305131c87eaa939fc01#r69314164
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160701/e3dc36e8/attachment.html>


More information about the mlpack-git mailing list