Skip to content

Commit

Permalink
Modernize CodeGenerationState docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Dec 19, 2024
1 parent 5005f91 commit 074b191
Showing 1 changed file with 22 additions and 53 deletions.
75 changes: 22 additions & 53 deletions loopy/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@


__doc__ = """
.. currentmodule:: loopy.codegen
.. autoclass:: PreambleInfo
.. autoclass:: VectorizationInfo
Expand Down Expand Up @@ -139,65 +137,34 @@ class SeenFunction:
@dataclass(frozen=True)
class CodeGenerationState:
"""
.. attribute:: kernel
.. attribute:: target
.. attribute:: implemented_domain
The entire implemented domain (as an :class:`islpy.Set`)
i.e. all constraints that have been enforced so far.
.. attribute:: implemented_predicates
A :class:`frozenset` of predicates for which checks have been
implemented.
.. attribute:: seen_dtypes
set of dtypes that were encountered
.. attribute:: seen_functions
set of :class:`SeenFunction` instances
.. autoattribute:: kernel
.. autoattribute:: target
.. autoattribute:: implemented_domain
.. autoattribute:: implemented_predicates
.. autoattribute:: seen_dtypes
.. autoattribute:: seen_functions
.. attribute:: seen_atomic_dtypes
.. attribute:: var_subst_map
.. attribute:: allow_complex
.. attribute:: vectorization_info
*None* (to mean vectorization has not yet been applied), or an instance of
:class:`VectorizationInfo`.
.. attribute:: is_generating_device_code
.. autoattribute:: var_subst_map
.. attribute:: gen_program_name
None (indicating that host code is being generated)
or the name of the device program currently being
generated.
.. attribute:: schedule_index_end
.. attribute:: callables_table
A mapping from callable names to instances of
:class:`loopy.kernel.function_interface.InKernelCallable`.
.. attribute:: is_entrypoint
A :class:`bool` to indicate if the code is being generated for an
entrypoint kernel
.. attribute:: codegen_cache_manager
An instance of :class:`loopy.codegen.tools.CodegenOperationCacheManager`.
.. autoattribute:: allow_complex
.. autoattribute:: vectorization_info
.. autoattribute:: is_generating_device_code
.. autoattribute:: gen_program_name
.. autoattribute:: schedule_index_end
.. autoattribute:: callables_table
.. autoattribute:: is_entrypoint
.. autoattribute:: codegen_cache_manager
"""

kernel: LoopKernel
target: TargetBase
implemented_domain: isl.Set
"""
The entire implemented domain (as an :class:`islpy.Set`)
i.e. all constraints that have been enforced so far.
"""
implemented_predicates: frozenset[str | Expression]

# /!\ mutable
Expand All @@ -211,9 +178,11 @@ class CodeGenerationState:
is_entrypoint: bool
var_name_generator: UniqueNameGenerator
is_generating_device_code: bool

gen_program_name: str

schedule_index_end: int
codegen_cachemanager: CodegenOperationCacheManager
codegen_cache_manager: CodegenOperationCacheManager
vectorization_info: VectorizationInfo | None = None

def __post_init__(self):
Expand Down

0 comments on commit 074b191

Please sign in to comment.