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

    do_local_fills(R)

    legion.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())
Esempio n. 2
0
def main():
    R = legion.Region([4, 4], {'x': legion.float64})
    P = legion.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'
Esempio n. 3
0
def main():
    R = legion.Region([4], {'x': legion.float64})
    P = legion.Partition.equal(R, [4])
    legion.fill(R, 'x', 0)

    hello2(P[0], 0)

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

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

    # FIXME: This is needed in nopaint to avoid a race with region deletion
    legion.execution_fence()
Esempio n. 4
0
def main():
    R = legion.Region(
        [10], {
            'b': legion.bool_,
            'c64': legion.complex64,
            'c128': legion.complex128,
            'f32': legion.float32,
            'f64': legion.float64,
            'i8': legion.int8,
            'i16': legion.int16,
            'i32': legion.int32,
            'i64': legion.int64,
            'u8': legion.uint8,
            'u16': legion.uint16,
            'u32': legion.uint32,
            'u64': legion.uint64,
        })
    R.b.fill(False)
    R.c64.fill(1 + 2j)
    R.c128.fill(3 + 4j)
    R.f32.fill(3.45)
    R.f64.fill(6.78)
    R.i8.fill(-1)
    R.i16.fill(-123)
    R.i32.fill(-123456)
    R.i64.fill(-123456789)
    R.u8.fill(1)
    R.u16.fill(123)
    R.u32.fill(123456)
    R.u64.fill(123456789)

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

    legion.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())
Esempio n. 5
0
def main():
    R = legion.Region([0, 0], {'x': legion.float64})
    legion.fill(R, 'x', 3.14)

    hello(R)