def METHOD_NAME(device_type: dace.dtypes.DeviceType):
    '''
    Runs contour-integral for the given device
    :return: the SDFG
    '''
    # Initialize data (npbench S size)
    NR, NM, slab_per_bc, num_int_pts = (50, 150, 2, 32)
    Ham, int_pts, Y = initialize(NR, NM, slab_per_bc, num_int_pts)
    if device_type in {dace.dtypes.DeviceType.CPU, dace.dtypes.DeviceType.GPU}:
        # Parse the SDFG and apply autopot
        sdfg = dace_contour_integral.to_sdfg()
        sdfg = auto_optimize(sdfg, device_type)
        val0, val1 = sdfg(Ham=Ham, int_pts=int_pts, Y=Y, NR=NR, NM=NM, slab_per_bc=slab_per_bc)
    elif device_type == dace.dtypes.DeviceType.FPGA:
        # Parse SDFG and apply FPGA friendly optimization
        sdfg = dace_contour_integral.to_sdfg(simplify=True)
        applied = sdfg.apply_transformations([FPGATransformSDFG])
        assert applied == 1
        from dace.libraries.standard import Reduce
        Reduce.default_implementation = "FPGAPartialReduction"
        sdfg.expand_library_nodes()
        sdfg.apply_transformations_repeated([InlineSDFG], print_report=True)
        sdfg.specialize(dict(NR=NR, NM=NM, slab_per_bc=slab_per_bc))
        val0, val1 = sdfg(Ham=Ham, int_pts=int_pts, Y=Y)
    # Compute ground truth and Validate result
    ref0, ref1 = numpy_contour_integral(NR, NM, slab_per_bc, Ham, int_pts, Y)
    assert (np.allclose(val0, ref0) or relerror(val0, ref0) < 1e-10)
    assert (np.allclose(val1, ref1) or relerror(val1, ref1) < 1e-10)
    return sdfg