Skip to content

Commit

Permalink
[OpenBLAS] cherry pick one patch to fix zdot crash
Browse files Browse the repository at this point in the history
  • Loading branch information
inkydragon committed Sep 27, 2021
1 parent 828adad commit 8935164
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
7 changes: 6 additions & 1 deletion deps/blas.mk
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied: $(BUILDDIR)/
patch -p1 -f < $(SRCDIR)/patches/openblas-ofast-power.patch
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied
$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-julia40963-zdot.patch-applied: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-ofast-power.patch-applied
cd $(BUILDDIR)/$(OPENBLAS_SRC_DIR) && \
patch -p1 -f < $(SRCDIR)/patches/openblas-julia40963-zdot.patch
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/openblas-julia40963-zdot.patch-applied
echo 1 > $@

$(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-compiled: $(BUILDDIR)/$(OPENBLAS_SRC_DIR)/build-configured
Expand Down
26 changes: 26 additions & 0 deletions deps/patches/openblas-julia40963-zdot.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From b2053239fc36f9ca8c29286d8fc553d0200907b0 Mon Sep 17 00:00:00 2001
From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
Date: Sun, 23 Aug 2020 15:08:16 +0200
Subject: [PATCH] Fix mssing dummy parameter (imag part of alpha) of
zdot_thread_function

---
kernel/x86_64/zdot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/x86_64/zdot.c b/kernel/x86_64/zdot.c
index 90fd86da..1bc785ac 100644
--- a/kernel/x86_64/zdot.c
+++ b/kernel/x86_64/zdot.c
@@ -168,7 +168,7 @@ static void zdot_compute (BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLO

#if defined(SMP)
static int zdot_thread_function(BLASLONG n, BLASLONG dummy0,
-BLASLONG dummy1, FLOAT dummy2, FLOAT *x, BLASLONG inc_x, FLOAT *y,
+BLASLONG dummy1, FLOAT dummy2r, FLOAT dummy2i, FLOAT *x, BLASLONG inc_x, FLOAT *y,
BLASLONG inc_y, FLOAT *result, BLASLONG dummy3)
{
zdot_compute(n, x, inc_x, y, inc_y, (void *)result);
--
2.33.0

0 comments on commit 8935164

Please sign in to comment.