Пример #1
0
def main():
    R = pygion.Region(
        [10], {
            'b': pygion.bool_,
            'c64': pygion.complex64,
            'c128': pygion.complex128,
            'f32': pygion.float32,
            'f64': pygion.float64,
            'i8': pygion.int8,
            'i16': pygion.int16,
            'i32': pygion.int32,
            'i64': pygion.int64,
            'u8': pygion.uint8,
            'u16': pygion.uint16,
            'u32': pygion.uint32,
            'u64': pygion.uint64,
        })

    do_local_fills(R)

    pygion.fill(R, 'c64', 5 + 6j)

    print('value of R.c64[0] after remote fill %s' % R.c64[1])

    x = complex_plus_one(3 + 4j)
    print(x.get())
Пример #2
0
def main():
    R = pygion.Region([4, 4], {'x': pygion.float64})
    pygion.fill(R, 'x', 0)
    P = pygion.Partition.equal(R, [2, 2])
    hello_subregion(P[0, 0])  # this should work
    try:
        hello_subregion(P)  # this should fail
    except TypeError:
        print('Test passed')
    else:
        assert False, 'Test failed'
Пример #3
0
def main():
    R = pygion.Region([4], {'x': pygion.float64})
    P = pygion.Partition.equal(R, [4])
    pygion.fill(R, 'x', 0)

    hello2(P[0], 0)

    for i in pygion.IndexLaunch([4]):
        hello2(P[i], i)

    pygion.index_launch([4], hello2, P[ID], ID)

    # FIXME: This is needed in nopaint to avoid a race with region deletion
    pygion.execution_fence()
Пример #4
0
def main():
    R = pygion.Region([0, 0], {'x': pygion.float64})
    pygion.fill(R, 'x', 3.14)

    hello(R)