From 425ca5e284b79b8869df99a7c5ff6ffc47a89dd4 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 20 Nov 2015 17:31:55 -0600
Subject: [PATCH] Work around vdot not being implemented in pypy

---
 test/test_algorithm.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/test/test_algorithm.py b/test/test_algorithm.py
index 1d6de377..02e6adcd 100644
--- a/test/test_algorithm.py
+++ b/test/test_algorithm.py
@@ -346,7 +346,17 @@ def test_dot(ctx_factory):
 
             assert abs(dot_ab_gpu - dot_ab) / abs(dot_ab) < 1e-4
 
-            vdot_ab = np.vdot(a, b)
+            try:
+                vdot_ab = np.vdot(a, b)
+            except NotImplementedError:
+                import sys
+                is_pypy = '__pypy__' in sys.builtin_module_names
+                if is_pypy:
+                    print("PYPY: VDOT UNIMPLEMENTED")
+                    continue
+                else:
+                    raise
+
             vdot_ab_gpu = cl_array.vdot(a_gpu, b_gpu).get()
 
             assert abs(vdot_ab_gpu - vdot_ab) / abs(vdot_ab) < 1e-4
-- 
GitLab