From d03c3eea931e749d448c835d9ca04bc0563072f8 Mon Sep 17 00:00:00 2001
From: Stephan Seitz <stephan.seitz@fau.de>
Date: Fri, 17 Jan 2020 14:17:05 +0100
Subject: [PATCH] Avoid re-initialization opencl context in test

---
 pystencils_tests/test_opencl.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pystencils_tests/test_opencl.py b/pystencils_tests/test_opencl.py
index 315142361..ac9aaad9f 100644
--- a/pystencils_tests/test_opencl.py
+++ b/pystencils_tests/test_opencl.py
@@ -10,6 +10,8 @@ from pystencils.opencl.opencljit import get_global_cl_queue, make_python_functio
 try:
     import pyopencl as cl
     HAS_OPENCL = True
+    import pystencils.opencl.autoinit
+
 except Exception:
     HAS_OPENCL = False
 
@@ -244,9 +246,6 @@ def test_kernel_creation():
 
     print(assignments)
 
-    pystencils.opencl.clear_global_ctx()
-
-    import pystencils.opencl.autoinit
     ast = pystencils.create_kernel(assignments, target='opencl')
 
     print(ast.backend)
-- 
GitLab