Other functionality

ArrayContext-generating fixture for pytest

arraycontext.pytest_generate_tests_for_pyopencl_array_context(metafunc)

Parametrize tests for pytest to use a PyOpenCLArrayContext.

Performs device enumeration analogously to pyopencl.tools.pytest_generate_tests_for_pyopencl().

Using the line:

from arraycontext import pytest_generate_tests_for_pyopencl
     as pytest_generate_tests

in your pytest test scripts allows you to use the argument actx_factory, in your test functions, and they will automatically be run once for each OpenCL device/platform in the system, as appropriate, with an argument-less function that returns an ArrayContext when called.

It also allows you to specify the PYOPENCL_TEST environment variable for device selection.

Program creation for loopy

arraycontext.make_loopy_program(domains, statements, kernel_data=None, name='mm_actx_kernel')

Return a loopy.LoopKernel suitable for use with ArrayContext.call_loopy().