autoinit.py 501 Bytes
Newer Older
Stephan Seitz's avatar
Stephan Seitz committed
1
2
3
4
5
6
"""
Automatically initializes OpenCL context using any device.

Use `pystencils.opencl.{init_globally_with_context,init_globally}` if you want to use a specific device.
"""

7
8
from pystencils.opencl.opencljit import (
    clear_global_ctx, init_globally, init_globally_with_context, make_python_function)
Stephan Seitz's avatar
Stephan Seitz committed
9

10
11
12
13
14
15
16
__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))