https://github.com/halide/Halide
Raw File
Tip revision: 72c91b18a594318c2323bc9668d05e9f85748cb1 authored by Andrew Adams on 14 January 2020, 01:09:30 UTC
Switch to 16 entries per line
Tip revision: 72c91b1
bit_test.py

import array
import bit
import sys


def test():
    bool_constant = True
    input_u1 = array.array('B', [0, 1, 0, 1])
    output_u1 = array.array('B', [0, 1, 0, 1])

    try:
        bit.bit(
            input_u1, bool_constant, output_u1
        )
    except NotImplementedError:
        pass  # OK - that's what we expected.
    else:
        print("Expected Exception not raised.", file=sys.stderr)
        exit(1)


if __name__ == "__main__":
    if "darwin" in sys.platform:
        # Don't run this test on Mac OS X.  It causes sporadic errors of the form
        # "dyld: termination function 0x108fa45b0 not in mapped image bit.so".
        # TODO: investigate why this is the case.
        pass
    else:
        test()
back to top