From: =?utf-8?q?Picca_Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca@debian.org>
Date: Mon, 30 Aug 2021 11:19:10 +0200
Subject: add also the CPU devices for tests

---
 gpyfft/test/util.py | 2 ++
 1 file changed, 2 insertions(+)

Index: gpyfft/gpyfft/test/util.py
===================================================================
--- gpyfft.orig/gpyfft/test/util.py
+++ gpyfft/gpyfft/test/util.py
@@ -7,9 +7,15 @@ def get_contexts():
     ALL_DEVICES = []
     for platform in cl.get_platforms():
         ALL_DEVICES += platform.get_devices(device_type = cl.device_type.GPU)
+    for platform in cl.get_platforms():
+        ALL_DEVICES += platform.get_devices(device_type = cl.device_type.CPU)
     contexts = [ cl.Context([device]) for device in ALL_DEVICES ]
     return contexts
 
 def has_double(ctx):
     dev = ctx.devices[0]
     return 'cl_khr_fp64' in dev.extensions
+
+def is_cpu(ctx):
+    dev = ctx.devices[0]
+    return dev.type == cl.device_type.CPU
Index: gpyfft/gpyfft/test/test_gpyfft.py
===================================================================
--- gpyfft.orig/gpyfft/test/test_gpyfft.py
+++ gpyfft/gpyfft/test/test_gpyfft.py
@@ -5,7 +5,7 @@ import numpy as np
 import pyopencl as cl
 import pyopencl.array as cla
 from gpyfft import FFT
-from gpyfft.test.util import get_contexts, has_double
+from gpyfft.test.util import get_contexts, has_double, is_cpu
 
 
 """
@@ -75,6 +75,8 @@ class test_fft(unittest.TestCase):
 
     @parameterized.expand(contexts)
     def test_1d_real_to_complex(self, ctx):
+        if is_cpu(ctx):
+            return
         queue = cl.CommandQueue(ctx)
         
         N = 32
@@ -94,6 +96,8 @@ class test_fft(unittest.TestCase):
 
     @parameterized.expand(contexts)
     def test_2d_real_to_complex(self, ctx):
+        if is_cpu(ctx):
+            return
         queue = cl.CommandQueue(ctx)
         
         M = 64
@@ -122,7 +126,7 @@ class test_fft(unittest.TestCase):
 
     @parameterized.expand(contexts)
     def test_2d_real_to_complex_double(self, ctx):
-        if not has_double(ctx): #TODO: find better way to skip test
+        if not has_double(ctx) or is_cpu(ctx): #TODO: find better way to skip test
             return
         queue = cl.CommandQueue(ctx)
         
