<commit_before>PyVideoCore
===========

*This is work in progress project.*

**PyVideoCore** is a Python library for GPGPU on Raspberry Pi boards. The
Raspberry Pi SoC integrates **Broadcom VideoCore IV** graphics core. It
has 12 quad processor units (QPU) which is a dual-issue 16 way (4 way
pipelined and 4 way true) SIMD processor. Read the following guide
thoroughly to study its architecture.

-  `VideoCore(R) IV 3D Architecture Reference Guide
   (PDF) <https://www.broadcom.com/docs/support/videocore/VideoCoreIV-AG100-R.pdf>`__
   [#errata]_

As far as I know, modern GPGPU programming environments such as OpenCL
do not exist for  VideoCore. Assembly programming is the only option at
this moment and several QPU assemblers written by pioneers
(`hermanhermitage <https://github.com/hermanhermitage/videocoreiv-qpu/blob/master/qpu-tutorial/qpuasm.md>`__,
`petewarden <https://github.com/jetpacapp/qpu-asm>`__,
`elorimer <https://github.com/elorimer/rpi-playground/tree/master/QPU/assembler>`__
and so on) are available.

PyVideoCore's QPU assembler is different from theirs in terms of that
its assembly language is implemented as an **Internal DSL** of Python
language. This makes GPGPU programming on Raspberry Pi relatively easier
in the sense that

-  You can put host programs and GPU side programs in a single Python
   script.
-  You can execute the program without ahead-of-time compilation.
-  You can utilize Python functionality, libraries and tools to organize
   GPU programs.


Requirements
------------

-  Python 2.7
-  NumPy
-  nose (if you want to run tests)

Installation
------------

::

    $ git clone https://github.com/nineties/py-videocore.git
    $ cd py-videocore
    $ sudo python setup.py install

You might need to update firmware.

::

    $ sudo rpi-update

Be Careful
----------

-  Raspberry Pi 2 is not tested.
-  You need to run programs as a super user so that this library can access
   ``/dev/mem``.
-  Accessing wrong location of ``/dev/mem``, due to a bug of this library or
   your program, may make your system unstable or coudl break your machine. 

Getting Started
---------------

::

    $ sudo python examples/hello_world.py

Running Tests
-------------

::

    sudo nosetests -v

Documentation
-------------

TBD

License
-------

Code and documentation are released under `MIT
license <https://github.com/nineties/py-videocore/blob/master/LICENSE>`__


----

.. [#errata] `Undocumented behavior and errata List
             <https://github.com/nineties/py-videocore/blob/master/ERRATA.rst>`__<commit_msg>typo.<commit_after>PyVideoCore
===========

*This is work in progress project.*

**PyVideoCore** is a Python library for GPGPU on Raspberry Pi boards. The
Raspberry Pi SoC integrates **Broadcom VideoCore IV** graphics core. It
has 12 quad processor units (QPU) which is a dual-issue 16 way (4 way
pipelined and 4 way true) SIMD processor. Read the following guide
thoroughly to study its architecture.

-  `VideoCore(R) IV 3D Architecture Reference Guide
   (PDF) <https://www.broadcom.com/docs/support/videocore/VideoCoreIV-AG100-R.pdf>`__
   [#errata]_

As far as I know, modern GPGPU programming environments such as OpenCL
do not exist for  VideoCore. Assembly programming is the only option at
this moment and several QPU assemblers written by pioneers
(`hermanhermitage <https://github.com/hermanhermitage/videocoreiv-qpu/blob/master/qpu-tutorial/qpuasm.md>`__,
`petewarden <https://github.com/jetpacapp/qpu-asm>`__,
`elorimer <https://github.com/elorimer/rpi-playground/tree/master/QPU/assembler>`__
and so on) are available.

PyVideoCore's QPU assembler is different from theirs in terms of that
its assembly language is implemented as an **Internal DSL** of Python
language. This makes GPGPU programming on Raspberry Pi relatively easier
in the sense that

-  You can put host programs and GPU side programs in a single Python
   script.
-  You can execute the program without ahead-of-time compilation.
-  You can utilize Python functionality, libraries and tools to organize
   GPU programs.


Requirements
------------

-  Python 2.7
-  NumPy
-  nose (if you want to run tests)

Installation
------------

::

    $ git clone https://github.com/nineties/py-videocore.git
    $ cd py-videocore
    $ sudo python setup.py install

You might need to update firmware.

::

    $ sudo rpi-update

Be Careful
----------

-  Raspberry Pi 2 is not tested.
-  You need to run programs as a super user so that this library can access
   ``/dev/mem``.
-  Accessing wrong location of ``/dev/mem``, due to a bug of this library or
   your program, may make your system unstable or could break your machine. 

Getting Started
---------------

::

    $ sudo python examples/hello_world.py

Running Tests
-------------

::

    sudo nosetests -v

Documentation
-------------

TBD

License
-------

Code and documentation are released under `MIT
license <https://github.com/nineties/py-videocore/blob/master/LICENSE>`__


----

.. [#errata] `Undocumented behavior and errata List
             <https://github.com/nineties/py-videocore/blob/master/ERRATA.rst>`__
{'fraction_non_alphanumeric': 0.11616556032799688, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 3.2199341021416803, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '440013', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1524, 'n_words': 577}