Skip to content

Commit 3a7955c

Browse files
authored
Merge pull request #3320 from martin-frbg/issue3318
Empirical workaround for numpy SVD NaN problem from issue 3318
2 parents 38d5b4b + 47ba85f commit 3a7955c

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

cmake/cc.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ if (NOT DYNAMIC_ARCH)
124124
if (HAVE_AVX)
125125
set (CCOMMON_OPT "${CCOMMON_OPT} -mavx")
126126
endif ()
127-
if (HAVE_FMA3)
128-
set (CCOMMON_OPT "${CCOMMON_OPT} -mfma")
129-
endif ()
127+
# if (HAVE_FMA3)
128+
#set (CCOMMON_OPT "${CCOMMON_OPT} -mfma")
129+
#endif ()
130130
if (HAVE_SSE)
131131
set (CCOMMON_OPT "${CCOMMON_OPT} -msse")
132132
endif ()

cmake/system.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ if (DEFINED TARGET)
186186
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
187187
endif()
188188
endif()
189-
if (DEFINED HAVE_FMA3)
190-
if (NOT NO_AVX2)
191-
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mfma")
192-
endif()
193-
endif()
189+
# if (DEFINED HAVE_FMA3)
190+
# if (NOT NO_AVX2)
191+
# set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mfma")
192+
# endif()
193+
# endif()
194194
if (DEFINED HAVE_SSE)
195195
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse")
196196
endif()

cmake/utils.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,15 @@ function(GenerateNamedObjects sources_in)
311311
configure_file(${new_source_file}.tmp ${new_source_file} COPYONLY)
312312
file(REMOVE ${new_source_file}.tmp)
313313
list(APPEND SRC_LIST_OUT ${new_source_file})
314-
314+
message (STATUS ${new_source_file})
315+
if (DEFINED HAVE_FMA3)
316+
if ( ${new_source_file} MATCHES "(s|d?)rot_k.*c")
317+
set_source_files_properties(${new_source_file} PROPERTIES COMPILE_OPTIONS "-mfma")
318+
endif ()
319+
if ( ${new_source_file} MATCHES "dgemv_t_k.*c")
320+
set_source_files_properties(${new_source_file} PROPERTIES COMPILE_OPTIONS "-mfma")
321+
endif ()
322+
endif ()
315323
endforeach ()
316324
endforeach ()
317325

kernel/Makefile.L2

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
FMAFLAG=
2+
ifndef OLDGCC
3+
ifdef HAVE_FMA3
4+
FMAFLAG = -mfma
5+
endif
6+
endif
7+
18
### GEMV ###
29

310
ifndef SGEMVNKERNEL
@@ -263,7 +270,7 @@ $(KDIR)dgemv_n$(TSUFFIX).$(SUFFIX) $(KDIR)dgemv_n$(TSUFFIX).$(PSUFFIX) : $(KER
263270
$(CC) -c $(CFLAGS) -DDOUBLE -UCOMPLEX -UTRANS $< -o $@
264271

265272
$(KDIR)dgemv_t$(TSUFFIX).$(SUFFIX) $(KDIR)dgemv_t$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(DGEMVTKERNEL) $(TOPDIR)/common.h $(GEMVDEP)
266-
$(CC) -c $(CFLAGS) -DDOUBLE -UCOMPLEX -DTRANS $< -o $@
273+
$(CC) -c $(CFLAGS) $(FMAFLAG) -DDOUBLE -UCOMPLEX -DTRANS $< -o $@
267274
endif
268275

269276
$(KDIR)qgemv_n$(TSUFFIX).$(SUFFIX) $(KDIR)qgemv_n$(TSUFFIX).$(PSUFFIX) : $(KERNELDIR)/$(QGEMVNKERNEL)

0 commit comments

Comments
 (0)