Skip to content

Commit 03fa1ed

Browse files
authored
Merge pull request #5512 from luotao1/intel
remove unused INTEL_MKL_ROOT etc.
2 parents 43e399c + 34d02f9 commit 03fa1ed

File tree

5 files changed

+4
-91
lines changed

5 files changed

+4
-91
lines changed

cmake/cblas.cmake

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
# Find the CBlas and lapack libraries
22
#
3-
# It will search MKL, atlas, OpenBlas, reference-cblas in order.
3+
# It will search MKLML, atlas, OpenBlas, reference-cblas in order.
44
#
55
# If any cblas implementation found, the following variable will be set.
6-
# CBLAS_PROVIDER # one of MKL, ATLAS, OPENBLAS, REFERENCE
6+
# CBLAS_PROVIDER # one of MKLML, ATLAS, OPENBLAS, REFERENCE
77
# CBLAS_INC_DIR # the include directory for cblas.
88
# CBLAS_LIBS # a list of libraries should be linked by paddle.
99
# # Each library should be full path to object file.
10-
#
11-
# User should set one of MKL_ROOT, ATLAS_ROOT, OPENBLAS_ROOT, REFERENCE_CBLAS_ROOT
12-
# during cmake. If none of them set, it will try to find cblas implementation in
13-
# system paths.
14-
#
1510

1611
set(CBLAS_FOUND OFF)
1712

@@ -30,44 +25,6 @@ if(WITH_MKLML AND MKLML_INC_DIR AND MKLML_LIB)
3025
return()
3126
endif()
3227

33-
## Then find MKL.
34-
set(INTEL_MKL_ROOT "/opt/intel/mkl" CACHE PATH "Folder contains intel mkl libs")
35-
set(MKL_ROOT $ENV{MKL_ROOT} CACHE PATH "Folder contains env MKL")
36-
37-
set(MKL_INCLUDE_SEARCH_PATHS
38-
${MKL_ROOT}/include
39-
${INTEL_MKL_ROOT}/include)
40-
set(MKL_LIB_SEARCH_PATHS
41-
${MKL_ROOT}/lib
42-
${MKL_ROOT}/lib/intel64
43-
${INTEL_MKL_ROOT}/lib
44-
${INTEL_MKL_ROOT}/lib/intel64)
45-
46-
find_path(MKL_INC_DIR mkl.h PATHS
47-
${MKL_INCLUDE_SEARCH_PATHS})
48-
find_path(MKL_LAPACK_INC_DIR mkl_lapacke.h PATHS
49-
${MKL_INCLUDE_SEARCH_PATHS})
50-
find_library(MKL_CORE_LIB NAMES mkl_core PATHS
51-
${MKL_LIB_SEARCH_PATHS})
52-
find_library(MKL_SEQUENTIAL_LIB NAMES mkl_sequential PATHS
53-
${MKL_LIB_SEARCH_PATHS})
54-
find_library(MKL_INTEL_LP64 NAMES mkl_intel_lp64 PATHS
55-
${MKL_LIB_SEARCH_PATHS})
56-
57-
if(MKL_LAPACK_INC_DIR AND MKL_INC_DIR AND MKL_CORE_LIB AND MKL_SEQUENTIAL_LIB AND MKL_INTEL_LP64)
58-
set(CBLAS_FOUND ON)
59-
set(CBLAS_PROVIDER MKL)
60-
set(CBLAS_INC_DIR ${MKL_INC_DIR} ${MKL_LAPACK_INC_DIR})
61-
set(CBLAS_LIBRARIES ${MKL_INTEL_LP64} ${MKL_SEQUENTIAL_LIB} ${MKL_CORE_LIB})
62-
63-
add_definitions(-DPADDLE_USE_MKL)
64-
add_definitions(-DLAPACK_FOUND)
65-
66-
message(STATUS "Found MKL (include: ${MKL_INC_DIR}, library: ${CBLAS_LIBRARIES})")
67-
message(STATUS "Found lapack in MKL (include: ${MKL_LAPACK_INC_DIR})")
68-
return()
69-
endif()
70-
7128
## Then find atlas.
7229
set(ATLAS_ROOT $ENV{ATLAS_ROOT} CACHE PATH "Folder contains Atlas")
7330
set(ATLAS_INCLUDE_SEARCH_PATHS

cmake/external/openblas.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ INCLUDE_DIRECTORIES(${CBLAS_INC_DIR})
115115
# linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)
116116
SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/cblas_dummy.c)
117117
FILE(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
118-
IF(${CBLAS_PROVIDER} MATCHES MKL)
118+
IF(${CBLAS_PROVIDER} EQUAL MKLML)
119119
ADD_LIBRARY(cblas SHARED ${dummyfile})
120120
ELSE()
121121
ADD_LIBRARY(cblas STATIC ${dummyfile})

paddle/math/MathFunctions.cpp

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ double dotProduct<double>(const int n, const double* x, const double* y) {
206206
}
207207
#endif
208208

209-
#if defined(PADDLE_USE_MKL) || defined(PADDLE_USE_MKLML)
209+
#if defined(PADDLE_USE_MKLML)
210210

211211
template <>
212212
void vExp<float>(const int n, const float* a, float* r) {
@@ -295,38 +295,6 @@ template void vAdd(const int n, const double* a, const double* b, double* r);
295295

296296
#endif
297297

298-
#ifdef PADDLE_USE_MKL
299-
template <>
300-
void vInvSqrt<float>(const int n, const float* a, float* r) {
301-
vsInvSqrt(n, a, r);
302-
}
303-
304-
template <>
305-
void vInvSqrt<double>(const int n, const double* a, double* r) {
306-
vdInvSqrt(n, a, r);
307-
}
308-
309-
template <>
310-
void vLog1p<float>(const int n, const float* a, float* r) {
311-
vsLog1p(n, a, r);
312-
}
313-
314-
template <>
315-
void vLog1p<double>(const int n, const double* a, double* r) {
316-
vdLog1p(n, a, r);
317-
}
318-
319-
template <>
320-
void vTanh<float>(const int n, const float* a, float* r) {
321-
vsTanh(n, a, r);
322-
}
323-
324-
template <>
325-
void vTanh<double>(const int n, const double* a, double* r) {
326-
vdTanh(n, a, r);
327-
}
328-
#else
329-
330298
DEFINE_MATRIX_BINARY_OP(vInvSqrt, b = 1.0f / std::sqrt(a));
331299
template <class T>
332300
void vInvSqrt(const int n, const T* a, T* r) {
@@ -357,6 +325,4 @@ template void vLog1p(const int n, const double* a, double* r);
357325
template void vTanh(const int n, const float* a, float* r);
358326
template void vTanh(const int n, const double* a, double* r);
359327

360-
#endif
361-
362328
} // namespace paddle

paddle/math/MathFunctions.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ limitations under the License. */
2121
#include <mkl_vml_functions.h>
2222
#endif
2323

24-
#ifdef PADDLE_USE_MKL
25-
#include <mkl.h>
26-
#include <mkl_lapacke.h>
27-
#endif
28-
2924
#if defined(PADDLE_USE_ATLAS) || defined(PADDLE_USE_VECLIB)
3025
extern "C" {
3126
#include <cblas.h>

paddle/operators/math/math_function.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ limitations under the License. */
1919
#include <mkl_vml_functions.h>
2020
#endif
2121

22-
#ifdef PADDLE_USE_MKL
23-
#include <mkl.h>
24-
#include <mkl_lapacke.h>
25-
#endif
26-
2722
#ifdef PADDLE_USE_ATLAS
2823
extern "C" {
2924
#include <cblas.h>

0 commit comments

Comments
 (0)