Skip to content

Empirical workaround for numpy SVD NaN problem from issue 3318 #3320

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

Merged
merged 3 commits into from
Jul 22, 2021
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: 3 additions & 3 deletions cmake/cc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ if (NOT DYNAMIC_ARCH)
if (HAVE_AVX)
set (CCOMMON_OPT "${CCOMMON_OPT} -mavx")
endif ()
if (HAVE_FMA3)
set (CCOMMON_OPT "${CCOMMON_OPT} -mfma")
endif ()
# if (HAVE_FMA3)
#set (CCOMMON_OPT "${CCOMMON_OPT} -mfma")
#endif ()
if (HAVE_SSE)
set (CCOMMON_OPT "${CCOMMON_OPT} -msse")
endif ()
Expand Down
10 changes: 5 additions & 5 deletions cmake/system.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ if (DEFINED TARGET)
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mavx2")
endif()
endif()
if (DEFINED HAVE_FMA3)
if (NOT NO_AVX2)
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mfma")
endif()
endif()
# if (DEFINED HAVE_FMA3)
# if (NOT NO_AVX2)
# set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -mfma")
# endif()
# endif()
if (DEFINED HAVE_SSE)
set (KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS} -msse")
endif()
Expand Down
10 changes: 9 additions & 1 deletion cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,15 @@ function(GenerateNamedObjects sources_in)
configure_file(${new_source_file}.tmp ${new_source_file} COPYONLY)
file(REMOVE ${new_source_file}.tmp)
list(APPEND SRC_LIST_OUT ${new_source_file})

message (STATUS ${new_source_file})
if (DEFINED HAVE_FMA3)
if ( ${new_source_file} MATCHES "(s|d?)rot_k.*c")
set_source_files_properties(${new_source_file} PROPERTIES COMPILE_OPTIONS "-mfma")
endif ()
if ( ${new_source_file} MATCHES "dgemv_t_k.*c")
set_source_files_properties(${new_source_file} PROPERTIES COMPILE_OPTIONS "-mfma")
endif ()
endif ()
endforeach ()
endforeach ()

Expand Down
9 changes: 8 additions & 1 deletion kernel/Makefile.L2
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
FMAFLAG=
ifndef OLDGCC
ifdef HAVE_FMA3
FMAFLAG = -mfma
endif
endif

### GEMV ###

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

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

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