From adb9bf2e6abb9313881e977d65e34d8aa6aeac97 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 9 Aug 2016 11:38:35 -0500
Subject: [PATCH] Work around numpypy issue #52, part 2

---
 test/test_wrapper.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/test/test_wrapper.py b/test/test_wrapper.py
index a76aef79..af4b72b7 100644
--- a/test/test_wrapper.py
+++ b/test/test_wrapper.py
@@ -933,6 +933,9 @@ def test_spirv(ctx_factory):
 
 
 def test_coarse_grain_svm(ctx_factory):
+    import sys
+    is_pypy = '__pypy__' in sys.builtin_module_names
+
     ctx = ctx_factory()
     queue = cl.CommandQueue(ctx)
 
@@ -945,10 +948,11 @@ def test_coarse_grain_svm(ctx_factory):
             and dev.type & cl.device_type.CPU):
         pytest.xfail("AMD CPU doesn't do coarse-grain SVM")
 
-
     n = 3000
     svm_ary = cl.SVM(cl.csvm_empty(ctx, (n,), np.float32, alignment=64))
-    assert isinstance(svm_ary.mem.base, cl.SVMAllocation)
+    if not is_pypy:
+        # https://bitbucket.org/pypy/numpy/issues/52
+        assert isinstance(svm_ary.mem.base, cl.SVMAllocation)
 
     if dev.platform.name != "Portable Computing Language":
         # pocl 0.13 has a bug misinterpreting the size parameter
-- 
GitLab