diff --git a/loopy/auto_test.py b/loopy/auto_test.py index 6837b99a026debf32b12aceef00ed3863c620639..ca70c8489238ee6f1fd95f52b02dbe451ddf13ef 100644 --- a/loopy/auto_test.py +++ b/loopy/auto_test.py @@ -534,7 +534,7 @@ def auto_test_vs_ref( from loopy.target.pyopencl import PyOpenCLTarget if test_knl.state not in [ KernelState.PREPROCESSED, - KernelState.SCHEDULED]: + KernelState.LINEARIZED]: if isinstance(test_knl.target, PyOpenCLTarget): test_knl = test_knl.copy(target=PyOpenCLTarget(ctx.devices[0])) diff --git a/loopy/codegen/__init__.py b/loopy/codegen/__init__.py index 11f874e1bd90bcfc1fe4595345c1b1efb2e6a35f..b4811dc9966921fa612aabef9a726d6b53fd4052 100644 --- a/loopy/codegen/__init__.py +++ b/loopy/codegen/__init__.py @@ -388,7 +388,7 @@ def generate_code_v2(kernel): from loopy.schedule import get_one_scheduled_kernel kernel = get_one_scheduled_kernel(kernel) - if kernel.state != KernelState.SCHEDULED: + if kernel.state != KernelState.LINEARIZED: raise LoopyError("cannot generate code for a kernel that has not been " "scheduled") diff --git a/loopy/kernel/__init__.py b/loopy/kernel/__init__.py index c3cd1738d7160c7feb6ef5d1042e3d41e19cdfdb..2d926aad4faa511aa2919630c9b0e96b7f253ad9 100644 --- a/loopy/kernel/__init__.py +++ b/loopy/kernel/__init__.py @@ -349,7 +349,7 @@ class LoopKernel(ImmutableRecordWithoutPickling): if state not in [ KernelState.INITIAL, KernelState.PREPROCESSED, - KernelState.SCHEDULED, + KernelState.LINEARIZED, ]: raise ValueError("invalid value for 'state'") diff --git a/loopy/kernel/tools.py b/loopy/kernel/tools.py index bb6ae44c9bf8daefef5f6564fccbec58ba72a708..9e54bc25d09d031e5907f68f8b8fb34dfadad94a 100644 --- a/loopy/kernel/tools.py +++ b/loopy/kernel/tools.py @@ -1726,8 +1726,8 @@ def get_subkernels(kernel): See also :class:`loopy.schedule.CallKernel`. """ from loopy.kernel import KernelState - if kernel.state != KernelState.SCHEDULED: - raise LoopyError("Kernel must be scheduled") + if kernel.state != KernelState.LINEARIZED: + raise LoopyError("Kernel must be linearized") from loopy.schedule import CallKernel @@ -1743,7 +1743,7 @@ def get_subkernel_to_insn_id_map(kernel): kernel must be scheduled. """ from loopy.kernel import KernelState - if kernel.state != KernelState.SCHEDULED: + if kernel.state != KernelState.LINEARIZED: raise LoopyError("Kernel must be scheduled") from loopy.schedule import ( diff --git a/loopy/schedule/__init__.py b/loopy/schedule/__init__.py index 0983c5e0d513d51a04a3f6cf3033904435ef1412..032cdc2760597f1fa6f701a8a88252312deac797 100644 --- a/loopy/schedule/__init__.py +++ b/loopy/schedule/__init__.py @@ -1841,7 +1841,7 @@ def generate_loop_schedules(kernel, debug_args={}): def generate_loop_schedules_inner(kernel, debug_args={}): from loopy.kernel import KernelState - if kernel.state not in (KernelState.PREPROCESSED, KernelState.SCHEDULED): + if kernel.state not in (KernelState.PREPROCESSED, KernelState.LINEARIZED): raise LoopyError("cannot schedule a kernel that has not been " "preprocessed") @@ -1852,7 +1852,7 @@ def generate_loop_schedules_inner(kernel, debug_args={}): debug = ScheduleDebugger(**debug_args) - preschedule = kernel.schedule if kernel.state == KernelState.SCHEDULED else () + preschedule = kernel.schedule if kernel.state == KernelState.LINEARIZED else () prescheduled_inames = set( insn.iname @@ -1904,7 +1904,7 @@ def generate_loop_schedules_inner(kernel, debug_args={}): unscheduled_insn_ids=set(insn.id for insn in kernel.instructions), scheduled_insn_ids=frozenset(), - within_subkernel=kernel.state != KernelState.SCHEDULED, + within_subkernel=kernel.state != KernelState.LINEARIZED, may_schedule_global_barriers=True, preschedule=preschedule, @@ -1973,11 +1973,11 @@ def generate_loop_schedules_inner(kernel, debug_args={}): new_kernel = kernel.copy( schedule=gen_sched, - state=KernelState.SCHEDULED) + state=KernelState.LINEARIZED) from loopy.schedule.device_mapping import \ map_schedule_onto_host_or_device - if kernel.state != KernelState.SCHEDULED: + if kernel.state != KernelState.LINEARIZED: # Device mapper only gets run once. new_kernel = map_schedule_onto_host_or_device(new_kernel) diff --git a/loopy/schedule/device_mapping.py b/loopy/schedule/device_mapping.py index 59afb07d2e9b7713dbe86c2c5aef7356decbbcff..d45c1ecbdc7ea091ce7d1a3899e82c14bb6fef2b 100644 --- a/loopy/schedule/device_mapping.py +++ b/loopy/schedule/device_mapping.py @@ -31,7 +31,7 @@ from loopy.schedule.tools import get_block_boundaries def map_schedule_onto_host_or_device(kernel): # FIXME: Should be idempotent. from loopy.kernel import KernelState - assert kernel.state == KernelState.SCHEDULED + assert kernel.state == KernelState.LINEARIZED from functools import partial device_prog_name_gen = partial(