Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX 10.10 (and more) use Accelerate Framework instead of veclib #3272

Merged
merged 1 commit into from
Aug 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ elseif(APPLE)
find_package(vecLib REQUIRED)
include_directories(SYSTEM ${vecLib_INCLUDE_DIR})
list(APPEND Caffe_LINKER_LIBS ${vecLib_LINKER_LIBS})

if(VECLIB_FOUND)
if(NOT vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
add_definitions(-DUSE_ACCELERATE)
endif()
endif()
endif()

# ---[ Python
Expand Down
5 changes: 5 additions & 0 deletions include/caffe/util/mkl_alternate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@

#else // If use MKL, simply include the MKL header

#ifdef USE_ACCELERATE
#include <Accelerate/Accelerate.h>
#else
extern "C" {
#include <cblas.h>
}
#endif // USE_ACCELERATE

#include <math.h>

// Functions that caffe uses but are not present if MKL is not linked.
Expand Down