Other functionalityΒΆ
Metadata (βtagsβ) for Arrays and Array AxesΒΆ
ArrayContext
-generating fixture for pytest
ΒΆ
- class arraycontext.PytestPyOpenCLArrayContextFactory(device)[source]ΒΆ
- __init__(device)[source]ΒΆ
- Parameters:
device β a
pyopencl.Device
.
- __call__() ArrayContext [source]ΒΆ
Call self as a function.
- arraycontext.pytest_generate_tests_for_array_contexts(factories: Sequence[str | type[PytestArrayContextFactory]], *, factory_arg_name: str = 'actx_factory') Callable[[Any], None] [source]ΒΆ
Parametrize tests for pytest to use an
ArrayContext
.Using this function in
pytest
test scripts allows you to use the argument factory_arg_name, which is a callable that returns aArrayContext
. All test functions will automatically be run once for each implemented array context. To select specific array context implementations explicitly define, for example,pytest_generate_tests = pytest_generate_tests_for_array_context([ "pyopencl", ])
to use the
pyopencl
-based array context.The environment variable
ARRAYCONTEXT_TEST
can also be used to overwrite any chosen implementations through factories. This is a comma-separated list of known array contexts.Current supported implementations include:
"pyopencl"
, which creates aPyOpenCLArrayContext
."pytato-pyopencl"
, which creates aPytatoPyOpenCLArrayContext
.
- Parameters:
factories β a list of identifiers or
PytestPyOpenCLArrayContextFactory
classes (not instances) for which to generate test fixtures.
Program creation for loopy
ΒΆ
- arraycontext.make_loopy_program(domains: str | Sequence[str | isl.BasicSet], statements: str | Sequence[InstructionBase | SubstitutionRule | str], kernel_data: Sequence[ValueArg | ArrayArg | TemporaryVariable | EllipsisType | str] | None = None, name: str = 'mm_actx_kernel', tags: ToTagSetConvertible = None)[source]ΒΆ
Return a
loopy.LoopKernel
suitable for use withArrayContext.call_loopy()
.
ReferencesΒΆ
- class arraycontext.InstructionBaseΒΆ
- class arraycontext.SubstitutionRuleΒΆ
- class arraycontext.ValueArgΒΆ
See
loopy.ValueArg
.
- class arraycontext.ArrayArgΒΆ
See
loopy.ArrayArg
.
- class arraycontext.TemporaryVariableΒΆ
- class arraycontext.EllipsisTypeΒΆ
See
types.EllipsisType
.
ReferencesΒΆ
- class cl_array.AllocatorΒΆ
- class np.ndarrayΒΆ
See
numpy.ndarray
.
- class dummy_refs.ToTagSetConvertibleΒΆ
See
pytools.tag
.
- class dummy_refs.ArrayOrNamesΒΆ
A type alias in
pytato
allowingpytato.Array
andpytato.AbstractResultWithNamedArrays
.
- class dummy_refs.IntegerΒΆ
A type alias allowing integers.
- class dummy_refs.ScalarLikeΒΆ
- class dummy_refs.ArrayOrContainerOrScalarΒΆ