Skip to content

Commit

Permalink
Let ruff auto-sort __all__
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jul 9, 2024
1 parent 6745d1a commit eb5fd71
Show file tree
Hide file tree
Showing 13 changed files with 219 additions and 193 deletions.
342 changes: 183 additions & 159 deletions loopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,165 +216,189 @@


__all__ = [
"TaggedVariable", "Reduction", "LinearSubscript", "TypeCast",

"auto",

"LoopKernel",
"KernelState",

"LegacyStringInstructionTag", "UseStreamingStoreTag",
"MemoryOrdering",
"MemoryScope",

"VarAtomicity",
"OrderedAtomic", "AtomicInit", "AtomicUpdate",
"InstructionBase",
"MultiAssignmentBase", "Assignment",
"CallInstruction", "CInstruction", "NoOpInstruction",
"BarrierInstruction",

"InKernelCallable", "ScalarCallable", "CallableKernel",

"TranslationUnit", "make_program", "for_each_kernel",

"KernelArgument",
"ValueArg", "ArrayArg", "GlobalArg", "ConstantArg", "ImageArg",
"AddressSpace",
"TemporaryVariable",
"SubstitutionRule",
"CallMangleInfo",

"make_kernel", "UniqueName", "make_function",

"register_reduction_parser",

"VERSION", "MOST_RECENT_LANGUAGE_VERSION",

# {{{ transforms

"prioritize_loops", "untag_inames",
"split_iname", "chunk_iname", "join_inames", "tag_inames",
"duplicate_inames",
"rename_iname", "rename_inames", "remove_unused_inames",
"split_reduction_inward", "split_reduction_outward",
"affine_map_inames", "find_unused_axis_tag",
"make_reduction_inames_unique",
"has_schedulable_iname_nesting", "get_iname_duplication_options",
"add_inames_to_insn", "add_inames_for_unused_hw_axes", "map_domain",
"remove_inames_from_insn", "remove_predicates_from_insn",

"add_prefetch", "change_arg_to_image",
"tag_array_axes", "tag_data_axes",
"set_array_axis_names", "set_array_dim_names",
"remove_unused_arguments",
"alias_temporaries", "set_argument_order",
"rename_argument", "set_temporary_scope", "set_temporary_address_space",
"allocate_temporaries_for_base_storage",

"find_instructions", "map_instructions",
"set_instruction_priority", "add_dependency",
"remove_instructions",
"replace_instruction_ids",
"tag_instructions",
"add_nosync",
"simplify_indices",

"extract_subst", "expand_subst", "assignment_to_subst",
"find_rules_matching", "find_one_rule_matching",

"precompute", "buffer_array",
"fuse_kernels",
"concatenate_arrays",

"fold_constants", "collect_common_factors_on_increment",

"split_array_axis", "split_array_dim", "split_arg_axis",
"find_padding_multiple", "add_padding",

"privatize_temporaries_with_inames",
"unprivatize_temporaries_with_inames",

"to_batched",

"assume", "fix_parameters",

"save_and_reload_temporaries",

"add_barrier",

"register_callable",
"merge",

"inline_callable_kernel", "rename_callable",

"pack_and_unpack_args_for_call",

# }}}

"get_dot_dependency_graph",
"show_dependency_graph",
"add_dtypes",
"add_and_infer_dtypes",
"get_global_barrier_order",
"find_most_recent_global_barrier",
"get_subkernels",
"get_subkernel_to_insn_id_map",
"t_unit_to_python",

"to_loopy_type",

"infer_unknown_types",

"preprocess_kernel", "realize_reduction", "preprocess_program",
"infer_arg_descr",

"generate_loop_schedules",
"get_one_scheduled_kernel", "get_one_linearized_kernel",
"linearize",

"GeneratedProgram", "CodeGenerationResult",
"PreambleInfo",
"generate_code", "generate_code_v2", "generate_body",

"ToCountMap", "ToCountPolynomialMap", "CountGranularity",
"Op", "MemAccess", "get_op_map",
"get_mem_access_map", "get_synchronization_map",
"gather_access_footprints", "gather_access_footprint_bytes",
"Sync",

"auto_test_vs_ref",

"Options",

"make_kernel",
"c_preprocess", "parse_transformed_fortran", "parse_fortran",

"LoopyError", "LoopyWarning",

"TargetBase",
"CFamilyTarget", "CTarget", "ExecutableCTarget", "generate_header",
"CWithGNULibcTarget", "ExecutableCWithGNULibcTarget",
"CudaTarget", "OpenCLTarget",
"PyOpenCLTarget", "ISPCTarget",
"ASTBuilderBase",

"Optional", "memoize_on_disk", "clear_in_mem_caches",

"ExecutorBase",

# {{{ from this file

"register_preamble_generators",
"register_symbol_manglers",

"set_caching_enabled",
"CacheMode",
"make_copy_kernel",
"make_einsum",

# }}}
]
"MOST_RECENT_LANGUAGE_VERSION",
"VERSION",
"ASTBuilderBase",
"AddressSpace",
"ArrayArg",
"Assignment",
"AtomicInit",
"AtomicUpdate",
"BarrierInstruction",
"CFamilyTarget",
"CInstruction",
"CTarget",
"CWithGNULibcTarget",
"CacheMode",
"CallInstruction",
"CallMangleInfo",
"CallableKernel",
"CodeGenerationResult",
"ConstantArg",
"CountGranularity",
"CudaTarget",
"ExecutableCTarget",
"ExecutableCWithGNULibcTarget",
"ExecutorBase",
"GeneratedProgram",
"GlobalArg",
"ISPCTarget",
"ImageArg",
"InKernelCallable",
"InstructionBase",
"KernelArgument",
"KernelState",
"LegacyStringInstructionTag",
"LinearSubscript",
"LoopKernel",
"LoopyError",
"LoopyWarning",
"MemAccess",
"MemoryOrdering",
"MemoryScope",
"MultiAssignmentBase",
"NoOpInstruction",
"Op",
"OpenCLTarget",
"Optional",
"Options",
"OrderedAtomic",
"PreambleInfo",
"PyOpenCLTarget",
"Reduction",
"ScalarCallable",
"SubstitutionRule",
"Sync",
"TaggedVariable",
"TargetBase",
"TemporaryVariable",
"ToCountMap",
"ToCountPolynomialMap",
"TranslationUnit",
"TypeCast",
"UniqueName",
"UseStreamingStoreTag",
"ValueArg",
"VarAtomicity",
"add_and_infer_dtypes",
"add_barrier",
"add_dependency",
"add_dtypes",
"add_inames_for_unused_hw_axes",
"add_inames_to_insn",
"add_nosync",
"add_padding",
"add_prefetch",
"affine_map_inames",
"alias_temporaries",
"allocate_temporaries_for_base_storage",
"assignment_to_subst",
"assume",
"auto",
"auto_test_vs_ref",
"buffer_array",
"c_preprocess",
"change_arg_to_image",
"chunk_iname",
"clear_in_mem_caches",
"collect_common_factors_on_increment",
"concatenate_arrays",
"duplicate_inames",
"expand_subst",
"extract_subst",
"find_instructions",
"find_most_recent_global_barrier",
"find_one_rule_matching",
"find_padding_multiple",
"find_rules_matching",
"find_unused_axis_tag",
"fix_parameters",
"fold_constants",
"for_each_kernel",
"fuse_kernels",
"gather_access_footprint_bytes",
"gather_access_footprints",
"generate_body",
"generate_code",
"generate_code_v2",
"generate_header",
"generate_loop_schedules",
"get_dot_dependency_graph",
"get_global_barrier_order",
"get_iname_duplication_options",
"get_mem_access_map",
"get_one_linearized_kernel",
"get_one_scheduled_kernel",
"get_op_map",
"get_subkernel_to_insn_id_map",
"get_subkernels",
"get_synchronization_map",
"has_schedulable_iname_nesting",
"infer_arg_descr",
"infer_unknown_types",
"inline_callable_kernel",
"join_inames",
"linearize",
"make_copy_kernel",
"make_einsum",
"make_function",
"make_kernel",
"make_kernel",
"make_program",
"make_reduction_inames_unique",
"map_domain",
"map_instructions",
"memoize_on_disk",
"merge",
"pack_and_unpack_args_for_call",
"parse_fortran",
"parse_transformed_fortran",
"precompute",
"preprocess_kernel",
"preprocess_program",
"prioritize_loops",
"privatize_temporaries_with_inames",
"realize_reduction",
"register_callable",
"register_preamble_generators",
"register_reduction_parser",
"register_symbol_manglers",
"remove_inames_from_insn",
"remove_instructions",
"remove_predicates_from_insn",
"remove_unused_arguments",
"remove_unused_inames",
"rename_argument",
"rename_callable",
"rename_iname",
"rename_inames",
"replace_instruction_ids",
"save_and_reload_temporaries",
"set_argument_order",
"set_array_axis_names",
"set_array_dim_names",
"set_caching_enabled",
"set_instruction_priority",
"set_temporary_address_space",
"set_temporary_scope",
"show_dependency_graph",
"simplify_indices",
"split_arg_axis",
"split_array_axis",
"split_array_dim",
"split_iname",
"split_reduction_inward",
"split_reduction_outward",
"t_unit_to_python",
"tag_array_axes",
"tag_data_axes",
"tag_inames",
"tag_instructions",
"to_batched",
"to_loopy_type",
"unprivatize_temporaries_with_inames",
"untag_inames",
]

# }}}

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ extend-select = [

# TODO
# "UP", # pyupgrade
# "RUF", # ruff
# "RUF", # ruff

"RUF022", # __all__ isn't sorted
]
extend-ignore = [
"C90", # McCabe complexity
Expand Down
6 changes: 3 additions & 3 deletions test/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@


__all__ = [
"pytest_generate_tests",
"cl" # "cl.create_some_context"
]
"cl", # "cl.create_some_context"
"pytest_generate_tests"
]


from loopy.version import LOOPY_USE_LANGUAGE_VERSION_2018_2 # noqa: F401
Expand Down
6 changes: 3 additions & 3 deletions test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@


__all__ = [
"pytest_generate_tests",
"cl" # 'cl.create_some_context'
]
"cl", # 'cl.create_some_context'
"pytest_generate_tests"
]


from loopy.version import LOOPY_USE_LANGUAGE_VERSION_2018_2 # noqa
Expand Down
6 changes: 3 additions & 3 deletions test/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@


__all__ = [
"pytest_generate_tests",
"cl" # 'cl.create_some_context'
]
"cl", # 'cl.create_some_context'
"pytest_generate_tests"
]


from loopy.version import LOOPY_USE_LANGUAGE_VERSION_2018_2 # noqa
Expand Down
Loading

0 comments on commit eb5fd71

Please sign in to comment.