{"id":16162448,"url":"https://github.com/sunsided/rust-arrayfire-experiments","last_synced_at":"2025-04-07T03:48:05.296Z","repository":{"id":141992984,"uuid":"292852959","full_name":"sunsided/rust-arrayfire-experiments","owner":"sunsided","description":"Toying around with ArrayFire in Rust","archived":false,"fork":false,"pushed_at":"2022-02-03T17:34:54.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T08:27:28.551Z","etag":null,"topics":["arrayfire","conways-game-of-life","cuda","gpgpu","gpu-acceleration","gpu-computing","opencl","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sunsided.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-04T13:17:59.000Z","updated_at":"2022-07-19T20:02:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"e41de60b-2cd7-4646-89a0-7ca1cb42c766","html_url":"https://github.com/sunsided/rust-arrayfire-experiments","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Frust-arrayfire-experiments","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Frust-arrayfire-experiments/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Frust-arrayfire-experiments/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunsided%2Frust-arrayfire-experiments/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunsided","download_url":"https://codeload.github.com/sunsided/rust-arrayfire-experiments/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247589835,"owners_count":20963022,"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","conways-game-of-life","cuda","gpgpu","gpu-acceleration","gpu-computing","opencl","rust"],"created_at":"2024-10-10T02:30:09.615Z","updated_at":"2025-04-07T03:48:05.278Z","avatar_url":"https://github.com/sunsided.png","language":"Rust","readme":"# GPGPU Experiments in Rust with ArrayFire\n\nToying around with / getting to know [arrayfire-rust](https://github.com/arrayfire/arrayfire-rust).\nDon't expect anything crazy here. 🙌\n\n## Example applications\n\n- [conway.rs](src/conway.rs): GPU-enabled [Conway's Game of Life](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) through\n  kernel convolutions, taken from the `arrayfire-rust` examples and spiced up for readability and understandability.\n  Uses ArrayFire's graphics module to provide a window. See [The Game of Life vs. Convolutions](https://medium.com/@sunside/the-game-of-life-vs-convolutions-bc495c962de8) for a post on it.\n  ```bash\n  cargo run\n  cargo run --bin conway\n  ```\n\n- [trivial.rs](src/trivial.rs): The simple example from the `arrayfire-rust` [README](https://github.com/arrayfire/arrayfire-rust/blob/master/README.md):\n  ```bash\n  cargo run --bin trivial\n  ```\n  \n- [white_noise.rs](src/white_noise.rs): Just white noise in a window. \n  ```bash\n  cargo run --bin white-noise\n  ```\n  \n- [half_precision.rs](src/half_precision.rs): FP16 example using [half::f16](https://docs.rs/half/1.6.0/half/).\n  Doesn't work on my GTX 980 Ti (Compute 5.2) with CUDA 10 / driver 450, so the CPU back-end is used instead.\n  ```bash\n  cargo run --bin half-precision\n  ```\n\n- [adaptive_threshold.rs](src/adaptive_threshold.rs): Implements three adaptive thresholding\n  techniques (mean, median and min-max average) as described in [Image editing using ArrayFire: Part 3](https://arrayfire.com/image-editing-using-arrayfire-part-3-2/).\n  Note that the path to the image is hard-coded, so it needs to be run from the repository root.\n  ```bash\n  cargo run --bin adaptive-threshold\n  ```\n  \n- [histogram.rs](src/histogram.rs): Implements RGB histogram calculation as described in [Image editing using ArrayFire: Part 3](https://arrayfire.com/image-editing-using-arrayfire-part-3-2/).\n   Makes use of `slice()` and/or `index()` to obtain individual channels from an `Array\u003cT\u003e`.\n   Note that the path to the image is hard-coded, so it needs to be run from the repository root.\n   ```bash\n   cargo run --bin histogram\n   ```\n\n\n## Installing ArrayFire\n\nFrom the [arrayfire-rust](https://github.com/arrayfire/arrayfire-rust) instructions:\n\n\u003e To use the rust bindings for ArrayFire from crates.io, the following requirements are to be met first.\n\u003e\n\u003e  1. [Download and install ArrayFire binaries](https://arrayfire.com/download) based on your operating system.\n\u003e  2. Set the evironment variable `AF_PATH` to point to ArrayFire installation root folder.\n\u003e  3. Make sure to add the path to lib files to your path environment variables.\n\u003e      - On Linux: do `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AF_PATH/lib64`\n\u003e      - On OSX: do `export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$AF_PATH/lib64`\n\u003e      - On Windows: Add `%AF_PATH%\\lib` to your PATH environment variable.\n\u003e  4. Add `arrayfire = \"3.7\"` to the dependencies section of your project's Cargo.toml file. Make sure\n\u003e     to change the version to latest available.\n\u003e  \n\u003e  Once step (4) is over, you should be able to use ArrayFire in your Rust project.\n\n## Further reading\n\n- [The State of GPGPU in Rust](https://bheisler.github.io/post/state-of-gpgpu-in-rust/) (as of August 2018)\n- [ArrayFire Examples (Part 4 of 8) - Image Processing](https://arrayfire.com/arrayfire-examples-part-4-of-8-image-processing/)\n- [ArrayFire Examples (Part 5 of 8) - Machine Learning](https://arrayfire.com/arrayfire-examples-part-5-of-8-machine-learning/)\n- [ArrayFire Examples (Part 7 of 8) - Partial Differential Equations](https://arrayfire.com/arrayfire-examples-part-7-of-8-pde/)\n- [arrayfire/arrayfire: Machine Learning examples](https://github.com/arrayfire/arrayfire/tree/master/examples/machine_learning)\n\n## License\n\n- [ArrayFire](https://arrayfire.com/the-arrayfire-library/) and [arrayfire-rust](https://github.com/arrayfire/arrayfire-rust)\n  are licensed under a [BSD 3-Clause License](https://tldrlegal.com/license/bsd-3-clause-license-(revised)).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Frust-arrayfire-experiments","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunsided%2Frust-arrayfire-experiments","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunsided%2Frust-arrayfire-experiments/lists"}