P1 (6/n): exchange-window, raw-exchange, Jet and pinned-remap GPU tests migrated
test_exchange_window, test_raw_exchange_gpu (one fine(block) helper for the repeated circle+jet construction), test_refinement_jets, test_multiple_pinned_remap_gpu and test_pinned_body_remap_gpu pass refinements/level_* lists. Dense fine levels stay level_blocks=[None, None|block] as before. Assertions unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0b1b3d938f
commit
af0566db98
@@ -41,8 +41,9 @@ def mocked(objects, jets, fine_block):
|
||||
patch.object(compiler, "load_module", return_value=module), \
|
||||
patch.object(cuda, "mem_alloc", side_effect=lambda size: Mock()), \
|
||||
patch.object(cuda, "memcpy_htod", htod):
|
||||
backend = FixedPatchStepper(config("periodic"), BOUNDS, context=context,
|
||||
fine_objects=objects, fine_block=fine_block, jets=jets)
|
||||
backend = FixedPatchStepper(config("periodic"), context=context, refinements=[BOUNDS],
|
||||
level_blocks=[None, fine_block], level_objects=[(), tuple(objects)],
|
||||
level_jets=[(), tuple(jets)])
|
||||
return backend, htod
|
||||
|
||||
|
||||
@@ -149,8 +150,9 @@ class JetStepperCPU(unittest.TestCase):
|
||||
def test_jet_overlapping_legacy_aperture_rejected_before_cuda(self):
|
||||
with patch.object(cuda, "Stream", side_effect=AssertionError("CUDA touched")):
|
||||
with self.assertRaisesRegex(ValueError, "SurfaceActuation"):
|
||||
FixedPatchStepper(config("periodic"), BOUNDS, context=Mock(),
|
||||
fine_objects=[circle(actuation(SPEED))], jets=[jet()])
|
||||
FixedPatchStepper(config("periodic"), context=Mock(), refinements=[BOUNDS],
|
||||
level_objects=[(), (circle(actuation(SPEED)),)],
|
||||
level_jets=[(), (jet(),)])
|
||||
|
||||
|
||||
def run(mode, fine_block, *, objects, jets, switch=None):
|
||||
@@ -158,8 +160,9 @@ def run(mode, fine_block, *, objects, jets, switch=None):
|
||||
cfg = config(mode)
|
||||
patch_ = FixedPatch2D.from_config(cfg, BOUNDS)
|
||||
with CudaContext(0) as context, FixedPatchStepper(
|
||||
cfg, BOUNDS, context=context, coarse_boundary=mode, fine_objects=objects,
|
||||
fine_block=fine_block, jets=jets) as backend:
|
||||
cfg, context=context, coarse_boundary=mode, refinements=[BOUNDS],
|
||||
level_blocks=[None, fine_block], level_objects=[(), tuple(objects)],
|
||||
level_jets=[(), tuple(jets)]) as backend:
|
||||
backend.initialize(state(NY, NX, 1), state(*patch_.fine_shape, 2))
|
||||
if switch is None:
|
||||
backend.step(STEPS)
|
||||
|
||||
Reference in New Issue
Block a user