Skip to content

Commit 1c0b03e

Browse files
authored
Merge branch 'develop' into develop
2 parents c589c3e + e396ec8 commit 1c0b03e

File tree

6 files changed

+129
-105
lines changed

6 files changed

+129
-105
lines changed

CMakeLists.txt

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ option(NO_AFFINITY "Disable support for CPU affinity masks to avoid binding proc
2929
else()
3030
set(NO_AFFINITY 1)
3131
endif()
32-
option(CPP_THREAD_SAFETY_TEST "Run a massively parallel DGEMM test to confirm thread safety of the library (requires OpenMP and about 1.3GB of RAM)" OFF)
33-
option(CPP_THREAD_SAFETY_GEMV "Run a massively parallel DGEMV test to confirm thread safety of the library (requires OpenMP)" OFF)
32+
option(BUILD_SINGLE "Single precision" OFF)
33+
option(BUILD_DOUBLE "Double precision" OFF)
34+
option(BUILD_COMPLEX "Single precision" OFF)
35+
option(BUILD_COMPLEX16 "Single precision" OFF)
3436

3537
# Add a prefix or suffix to all exported symbol names in the shared library.
3638
# Avoids conflicts with other BLAS libraries, especially when using
@@ -108,28 +110,33 @@ endif()
108110

109111
set(FLOAT_TYPES "")
110112
if (BUILD_SINGLE)
111-
message(STATUS "Building Single Precision")
112-
list(APPEND FLOAT_TYPES "SINGLE") # defines nothing
113+
message(STATUS "Building Songle Precision")
114+
list(APPEND FLOAT_TYPES "SINGLE")
115+
# set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
113116
endif ()
114117

115118
if (BUILD_DOUBLE)
116119
message(STATUS "Building Double Precision")
117-
list(APPEND FLOAT_TYPES "DOUBLE") # defines DOUBLE
120+
list(APPEND FLOAT_TYPES "DOUBLE")
121+
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE=1")
118122
endif ()
119123

120124
if (BUILD_COMPLEX)
121125
message(STATUS "Building Complex Precision")
122-
list(APPEND FLOAT_TYPES "COMPLEX") # defines COMPLEX
123-
endif ()
126+
list(APPEND FLOAT_TYPES "COMPLEX")
127+
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX=1")
128+
endif ()
124129

125130
if (BUILD_COMPLEX16)
126131
message(STATUS "Building Double Complex Precision")
127-
list(APPEND FLOAT_TYPES "ZCOMPLEX") # defines COMPLEX and DOUBLE
132+
list(APPEND FLOAT_TYPES "ZCOMPLEX")
133+
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16=1")
128134
endif ()
129135

130136
if (BUILD_HALF)
131137
message(STATUS "Building Half Precision")
132-
list(APPEND FLOAT_TYPES "HALF") # defines nothing
138+
list(APPEND FLOAT_TYPES "HALF")
139+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_HALF")
133140
endif ()
134141

135142
if (NOT DEFINED CORE OR "${CORE}" STREQUAL "UNKNOWN")
@@ -236,9 +243,6 @@ if (NOT MSVC AND NOT NOFORTRAN)
236243
add_subdirectory(ctest)
237244
endif()
238245
add_subdirectory(lapack-netlib/TESTING)
239-
if (CPP_THREAD_SAFETY_TEST OR CPP_THREAD_SAFETY_GEMV)
240-
add_subdirectory(cpp_thread_test)
241-
endif()
242246
endif()
243247

244248
set_target_properties(${OpenBLAS_LIBNAME} PROPERTIES

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ ifneq ($(NO_CBLAS), 1)
146146
ifeq ($(CPP_THREAD_SAFETY_TEST), 1)
147147
$(MAKE) -C cpp_thread_test all
148148
endif
149-
ifeq ($(CPP_THREAD_SAFETY_GEMV), 1)
150-
$(MAKE) -C cpp_thread_test dgemv_tester
151-
endif
152149
endif
153150
endif
154151

Makefile.rule

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -272,33 +272,17 @@ COMMON_PROF = -pg
272272
# work at all.
273273
#
274274
# CPP_THREAD_SAFETY_TEST = 1
275-
#
276-
# use this to run only the less memory-hungry GEMV test
277-
# CPP_THREAD_SAFETY_GEMV = 1
278275

279276

280277
# If you want to enable the experimental BFLOAT16 support
281278
# BUILD_HALF = 1
282-
283-
284-
# Set the thread number threshold beyond which the job array for the threaded level3 BLAS
285-
# will be allocated on the heap rather than the stack. (This array alone requires
286-
# NUM_THREADS*NUM_THREADS*128 bytes of memory so should not pose a problem at low cpu
287-
# counts, but obviously it is not the only item that ends up on the stack.
288-
# The default value of 32 ensures that the overall requirement is compatible
289-
# with the default 1MB stacksize imposed by having the Java VM loaded without use
290-
# of its -Xss parameter.
291-
# The value of 160 formerly used from about version 0.2.7 until 0.3.10 is easily compatible
292-
# with the common Linux stacksize of 8MB but will cause crashes with unwary use of the java
293-
# VM e.g. in Octave or with the java-based libhdfs in numpy or scipy code
294-
# BLAS3_MEM_ALLOC_THRESHOLD = 160
295-
296-
297-
298-
# the below is not yet configurable, use cmake if you need to build only select types
299-
BUILD_SINGLE = 1
300-
BUILD_DOUBLE = 1
301-
BUILD_COMPLEX = 1
302-
BUILD_COMPLEX16 = 1
279+
#
280+
# Select if you need to build only select types
281+
# BUILD_SINGLE = 1
282+
# BUILD_DOUBLE = 1
283+
# BUILD_COMPLEX = 1
284+
# BUILD_COMPLEX16 = 1
285+
#
286+
#
303287
# End of user configuration
304288
#

cmake/system.cmake

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ if (DEFINED TARGET)
7070
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
7171
endif()
7272
endif()
73-
if (DEFINED HAVE_SSE3)
74-
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse3")
75-
endif()
7673
endif()
7774

7875
if (DEFINED TARGET)
@@ -326,13 +323,7 @@ else ()
326323
set(CCOMMON_OPT "${CCOMMON_OPT} -DMAX_STACK_ALLOC=2048")
327324
endif ()
328325
endif ()
329-
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
330-
if (DEFINED BLAS3_MEM_ALLOC_THRESHOLD)
331-
if (NOT ${BLAS3_MEM_ALLOC_THRESHOLD} EQUAL 32)
332-
set(CCOMMON_OPT "${CCOMMON_OPT} -DBLAS3_MEM_ALLOC_THRESHOLD=${BLAS3_MEM_ALLOC_THRESHOLD}")
333-
endif()
334-
endif()
335-
endif()
326+
336327
if (DEFINED LIBNAMESUFFIX)
337328
set(LIBPREFIX "libopenblas_${LIBNAMESUFFIX}")
338329
else ()
@@ -410,16 +401,20 @@ if (NOT BUILD_SINGLE AND NOT BUILD_DOUBLE AND NOT BUILD_COMPLEX AND NOT BUILD_CO
410401
set (BUILD_COMPLEX16 ON)
411402
endif()
412403
if (BUILD_SINGLE)
413-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE")
404+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE=1")
405+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
414406
endif()
415407
if (BUILD_DOUBLE)
416-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE")
408+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE=1")
409+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_SINGLE=1")
417410
endif()
418411
if (BUILD_COMPLEX)
419-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX")
412+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX=1")
413+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX=1")
420414
endif()
421415
if (BUILD_COMPLEX16)
422-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
416+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16=1")
417+
set(CCOMMON_OPT "${CCOMMON_OPT} -DBUILD_COMPLEX16=1")
423418
endif()
424419
if(NOT MSVC)
425420
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")

cmake/system_check.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ endif()
121121

122122
include(CheckIncludeFile)
123123
CHECK_INCLUDE_FILE("stdatomic.h" HAVE_C11)
124-
if (HAVE_C11)
124+
if (HAVE_C11 EQUAL 1)
125125
set (CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_C11")
126126
endif()

0 commit comments

Comments
 (0)