{"id":13542046,"url":"https://github.com/arrayfire/arrayfire-python","last_synced_at":"2025-04-02T09:33:14.826Z","repository":{"id":51000724,"uuid":"37599258","full_name":"arrayfire/arrayfire-python","owner":"arrayfire","description":"Python bindings for ArrayFire: A general purpose GPU library.","archived":false,"fork":false,"pushed_at":"2023-04-25T23:44:22.000Z","size":1671,"stargazers_count":416,"open_issues_count":58,"forks_count":65,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-03T07:33:05.858Z","etag":null,"topics":["arrayfire","cuda","gpgpu","gpu","hpc","opencl","python","python-bindings"],"latest_commit_sha":null,"homepage":"https://arrayfire.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arrayfire.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-06-17T14:17:18.000Z","updated_at":"2024-10-26T00:51:55.000Z","dependencies_parsed_at":"2024-01-08T15:53:37.196Z","dependency_job_id":null,"html_url":"https://github.com/arrayfire/arrayfire-python","commit_stats":null,"previous_names":["arrayfire/arrayfire_python"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrayfire%2Farrayfire-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrayfire%2Farrayfire-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrayfire%2Farrayfire-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arrayfire%2Farrayfire-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arrayfire","download_url":"https://codeload.github.com/arrayfire/arrayfire-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246789100,"owners_count":20834229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arrayfire","cuda","gpgpu","gpu","hpc","opencl","python","python-bindings"],"created_at":"2024-08-01T10:01:00.706Z","updated_at":"2025-04-02T09:33:14.361Z","avatar_url":"https://github.com/arrayfire.png","language":"Python","readme":"# ArrayFire Python Bindings\n\n[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance library for parallel computing with an easy-to-use API. It enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU devices. This project provides Python bindings for the ArrayFire library.\n\n## Documentation\n\nDocumentation for this project can be found [over here](http://arrayfire.org/arrayfire-python/).\n\n## Example\n\n```python\n# Monte Carlo estimation of pi\ndef calc_pi_device(samples):\n    # Simple, array based API\n    # Generate uniformly distributed random numers\n    x = af.randu(samples)\n    y = af.randu(samples)\n    # Supports Just In Time Compilation\n    # The following line generates a single kernel\n    within_unit_circle = (x * x + y * y) \u003c 1\n    # Intuitive function names\n    return 4 * af.count(within_unit_circle) / samples\n```\n\n\nChoosing a particular backend can be done using `af.set_backend(name)`  where name is either \"_cuda_\", \"_opencl_\", or \"_cpu_\". The default device is chosen in the same order of preference.\n\n## Getting started\nArrayFire can be installed from a variety of sources. [Pre-built wheels](https://repo.arrayfire.com/python/wheels/3.8.0/) are available for a number of systems and toolkits. These will include a distribution of the ArrayFire libraries. Currently, only the python wrapper is available on PyPI. Wrapper-only installations will require a separate installation of the ArrayFire C/C++ libraries. \nYou can get the ArrayFire C/C++ library from the following sources:\n\n- [Download and install binaries](https://arrayfire.com/download)\n- [Build and install from source](https://github.com/arrayfire/arrayfire)\n\n\n**Install the last stable version of python wrapper:**  \n```\npip install arrayfire\n```\n\n**Install a pre-built wheel for a specific CUDA toolkit version:**\n```\npip install arrayfire==3.8.0+cu112 -f https://repo.arrayfire.com/python/wheels/3.8.0/\n# Replace the +cu112 local version with the desired toolkit\n```\n\n**Install the development source distribution:**\n\n```\npip install git+git://github.com/arrayfire/arrayfire-python.git@master\n```\n\n**Installing offline:**\n\n```\ncd path/to/arrayfire-python\npython setup.py install\n```\nRather than installing and building ArrayFire elsewhere in the system, you can also build directly through python by first setting the `AF_BUILD_LOCAL_LIBS=1` environment variable. Additional setup will be required to build ArrayFire, including satisfying dependencies and further CMake configuration. Details on how to pass additional arguments to the build systems can be found in the [scikit-build documentation.](https://scikit-build.readthedocs.io/en/latest/)\n\n**Post Installation:**\n\nIf you are not using one of the pre-built wheels, you may need to ensure arrayfire-python can find the installed arrayfire libraries. Please follow [these instructions](https://github.com/arrayfire/arrayfire-python/wiki) to ensure that arrayfire-python can find the arrayfire libraries.\n\nTo run arrayfire tests, you can run the following command from command line.\n\n```\npython -m arrayfire.tests\n```\n\n## Communication\n\n* [Slack Chat](https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ)\n* [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users)\n\n## Acknowledgements\n\nThe ArrayFire library is written by developers at [ArrayFire](http://arrayfire.com) LLC\nwith [contributions from several individuals](https://github.com/arrayfire/arrayfire_python/graphs/contributors).\n\nThe developers at ArrayFire LLC have received partial financial support\nfrom several grants and institutions. Those that wish to receive public\nacknowledgement are listed below:\n\n\u003c!--\nThe following section contains acknowledgements for grant funding. In most\ncircumstances, the specific phrasing of the text is mandated by the grant\nprovider. Thus these acknowledgements must remain intact without modification.\n--\u003e\n\n### Grants\n\nThis material is based upon work supported by the DARPA SBIR Program Office\nunder Contract Numbers W31P4Q-14-C-0012 and W31P4Q-15-C-0008.\nAny opinions, findings and conclusions or recommendations expressed in this\nmaterial are those of the author(s) and do not necessarily reflect the views of\nthe DARPA SBIR Program Office.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayfire%2Farrayfire-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farrayfire%2Farrayfire-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farrayfire%2Farrayfire-python/lists"}