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

Yannis Mentekidis notifications at github.com
Fri Jul 1 11:22:41 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()

I added HAS_OPENMP for two reasons:

- debugging without using a different compiler. This way I can know that a test passes both with openMP on and off.
- so a user can maually "forbid" mlpack from using any openMP code, even if openMP is found on their system. I don't know why anybody would want this.

The flag is on by default, so it shouldn't bother users that don't want to mess with it.

It can definately be changed, I just had so much trouble making the build pass in AppVeyor that I went all out.

---
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#r69315758
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160701/4f235433/attachment-0001.html>


More information about the mlpack-git mailing list