Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
3814a508
Commit
3814a508
authored
Aug 13, 2019
by
Stephan Seitz
Browse files
Skip opencljit test if pyopencl is not installed
parent
6767b4a0
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils_tests/test_opencl.py
View file @
3814a508
import
numpy
as
np
import
py
opencl
as
cl
import
py
test
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]"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment