Commit 3814a508 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Skip opencljit test if pyopencl is not installed

parent 6767b4a0
import numpy as np
import pyopencl as cl
import pytest
import sympy as sp
import pystencils
......@@ -7,6 +7,12 @@ from pystencils.backends.cuda_backend import CudaBackend
from pystencils.backends.opencl_backend import OpenClBackend
from pystencils.opencl.opencljit import make_python_function
try:
import pyopencl as cl
HAS_OPENCL = True
except Exception:
HAS_OPENCL = False
def test_print_opencl():
z, y, x = pystencils.fields("z, y, x: [2d]")
......@@ -32,6 +38,7 @@ def test_print_opencl():
assert "get_local_id(0)" in str(opencl_code)
@pytest.mark.skipif(not HAS_OPENCL, reason="Test requires pyopencl")
def test_opencl_jit():
z, y, x = pystencils.fields("z, y, x: [20,30]")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment