Skip to content
Snippets Groups Projects
Commit c045b3ad authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Protect pystencils.opencl.autoinit with try..except

parent ae004cfe
No related branches found
No related tags found
No related merge requests found
...@@ -32,8 +32,7 @@ def add_path_to_ignore(path): ...@@ -32,8 +32,7 @@ def add_path_to_ignore(path):
collect_ignore += [os.path.join(SCRIPT_FOLDER, path, f) for f in os.listdir(os.path.join(SCRIPT_FOLDER, path))] collect_ignore += [os.path.join(SCRIPT_FOLDER, path, f) for f in os.listdir(os.path.join(SCRIPT_FOLDER, path))]
collect_ignore = [os.path.join(SCRIPT_FOLDER, "doc", "conf.py"), collect_ignore = [os.path.join(SCRIPT_FOLDER, "doc", "conf.py")]
os.path.join(SCRIPT_FOLDER, "pystencils", "opencl", "opencl.autoinit")]
add_path_to_ignore('pystencils_tests/benchmark') add_path_to_ignore('pystencils_tests/benchmark')
add_path_to_ignore('_local_tmp') add_path_to_ignore('_local_tmp')
......
...@@ -4,8 +4,13 @@ Automatically initializes OpenCL context using any device. ...@@ -4,8 +4,13 @@ Automatically initializes OpenCL context using any device.
Use `pystencils.opencl.{init_globally_with_context,init_globally}` if you want to use a specific device. Use `pystencils.opencl.{init_globally_with_context,init_globally}` if you want to use a specific device.
""" """
from pystencils.opencl import * # noqa from pystencils.opencl.opencljit import (
from pystencils.opencl.opencljit import * # noqa clear_global_ctx, init_globally, init_globally_with_context, make_python_function)
from pystencils.opencl.opencljit import init_globally
init_globally() __all__ = ['init_globally', 'init_globally_with_context', 'clear_global_ctx', 'make_python_function']
try:
init_globally()
except Exception as e:
import warnings
warnings.warn(str(e))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment