Idein / py-videocore

Python library for GPGPU on Raspberry Pi
MIT License
795 stars 89 forks source link

Add raw_program function #51

Closed long-long-float closed 5 years ago

long-long-float commented 5 years ago

raw_program emits entire binary code. This is a example code.

@qpu
def sigmoid(asm):
    with open('sigmoid.bin', 'rb') as f:
        from ctypes import pointer, create_string_buffer
        data = f.read()
        raw_program(create_string_buffer(data, len(data)), len(data))