def METHOD_NAME(device_type: dace.dtypes.DeviceType):
    """
    Runs FDTD-2D for the given device
    :return: the SDFG
    """
    # Initialize data (polybench mini size)
    TMAX, NX, NY = sizes["mini"]
    ex, ey, hz, _fict_ = init_data(TMAX, NX, NY)
    gt_ex, gt_ey, gt_hz = np.copy(ex), np.copy(ey), np.copy(hz)
    if device_type in {dace.dtypes.DeviceType.CPU, dace.dtypes.DeviceType.GPU}:
        # Parse the SDFG and apply autopot
        sdfg = kernel.to_sdfg()
        sdfg = auto_optimize(sdfg, device_type)
        sdfg(ex=ex, ey=ey, hz=hz, _fict_=_fict_, TMAX=TMAX, NX=NX, NY=NY)
    elif device_type == dace.dtypes.DeviceType.FPGA:
        # Parse SDFG and apply FPGA friendly optimization
        sdfg = kernel.to_sdfg(simplify=True)
        sdfg.apply_transformations_repeated([MapFusion])
        applied = sdfg.apply_transformations([FPGATransformSDFG])
        assert applied == 1
        sm_applied = sdfg.apply_transformations_repeated([InlineSDFG, StreamingMemory],
                                                         [{}, {
                                                             'storage': dace.StorageType.FPGA_Local
                                                         }],
                                                         print_report=True)
        assert sm_applied > 0
        sdfg.apply_transformations_repeated([InlineSDFG])
        # In this case, we want to generate the top-level state as an host-based state,
        # not an FPGA kernel. We need to explicitly indicate that
        sdfg.states()[0].location["is_FPGA_kernel"] = False
        sdfg(ex=ex, ey=ey, hz=hz, _fict_=_fict_, TMAX=TMAX, NX=NX, NY=NY)
    # Compute ground truth and validate result
    ground_truth(TMAX, NX, NY, gt_ex, gt_ey, gt_hz, _fict_=_fict_)
    diff_ex = np.linalg.norm(gt_ex - ex) / np.linalg.norm(gt_ex)
    diff_ey = np.linalg.norm(gt_ex - ex) / np.linalg.norm(gt_ex)
    diff_hz = np.linalg.norm(gt_ex - ex) / np.linalg.norm(gt_ex)
    tol = 1e-6
    assert diff_ex < tol
    assert diff_ey < tol
    assert diff_hz < tol
    return sdfg