|
| 1 | +[![ci][19]][16] [![docs][18]][3] [![book][22]][21] [![slack][17]][4] [![google-groups][20]][5] |
| 2 | + |
1 | 3 | # Arrayfire Rust Bindings
|
2 | 4 |
|
3 |
| -[ArrayFire](https://github.com/arrayfire/arrayfire) is a high performance |
4 |
| -library for parallel computing with an easy-to-use API. It enables users |
5 |
| -to write scientific computing code that is portable across CUDA, OpenCL |
6 |
| -and CPU devices. This project provides Rust bindings for the ArrayFire |
7 |
| -library. Given below table shows the rust bindings compatability with |
8 |
| -ArrayFire. If you find any bugs, please report them |
9 |
| -[here](https://github.com/arrayfire/arrayfire-rust/issues). |
| 5 | +[ArrayFire][1] is a high performance library for parallel computing with an easy-to-use API. It |
| 6 | +enables users to write scientific computing code that is portable across CUDA, OpenCL and CPU |
| 7 | +devices. This project provides Rust bindings for the ArrayFire library. Given below table shows |
| 8 | +the rust bindings compatability with ArrayFire. If you find any bugs, please report them [here][2]. |
10 | 9 |
|
11 | 10 | | arrayfire-rust | ArrayFire |
|
12 | 11 | |:--------------:|:---------:|
|
13 | 12 | | M.m.p1 | M.m.p2 |
|
14 | 13 |
|
15 |
| -Only, Major(M) & Minor(m) version numbers need to match. *p1* and *p2* |
16 |
| -are patch/fix updates for `arrayfire-rust` & `ArrayFire` respectively, |
17 |
| -and they don't need to match. |
18 |
| - |
19 |
| -## Documentation |
20 |
| - |
21 |
| -You can find the most recent updated documentation |
22 |
| -[here](http://arrayfire.github.io/arrayfire-rust/arrayfire/index.html). |
23 |
| - |
24 |
| -## Communication |
25 |
| - |
26 |
| -* [Slack Chat](https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ) |
27 |
| -* [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users) |
| 14 | +Only, Major(M) & Minor(m) version numbers need to match. *p1* and *p2* are patch/fix updates for |
| 15 | +`arrayfire-rust` & `ArrayFire` respectively, and they don't need to match. |
28 | 16 |
|
29 | 17 | ## Supported platforms
|
30 | 18 |
|
31 | 19 | Linux, Windows and OSX. Rust 1.15.1 or higher is required.
|
32 | 20 |
|
33 |
| -## Use from Crates.io [](https://crates.io/crates/arrayfire) [](https://docs.rs/arrayfire) |
| 21 | +## Use from Crates.io [![][6]][7] [![][8]][9] |
34 | 22 |
|
35 |
| -To use the rust bindings for ArrayFire from crates.io, the following |
36 |
| -requirements are to be met first. |
| 23 | +To use the rust bindings for ArrayFire from crates.io, the following requirements are to be met first. |
37 | 24 |
|
38 |
| -1. [Download and install ArrayFire binaries](https://arrayfire.com/download) |
39 |
| - based on your operating system. |
40 |
| -2. Set the evironment variable `AF_PATH` to point to ArrayFire installation |
41 |
| - root folder. |
| 25 | +1. [Download and install ArrayFire binaries][10] based on your operating system. |
| 26 | +2. Set the evironment variable `AF_PATH` to point to ArrayFire installation root folder. |
42 | 27 | 3. Make sure to add the path to lib files to your path environment variables.
|
43 | 28 | - On Linux: do `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$AF_PATH/lib64`
|
44 | 29 | - On OSX: do `export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$AF_PATH/lib64`
|
45 | 30 | - On Windows: Add `%AF_PATH%\lib` to your PATH environment variable.
|
46 |
| -4. Add `arrayfire = "3.7"` to the dependencies section of your project's |
47 |
| - Cargo.toml file. Make sure to change the version to latest available. |
| 31 | +4. Add `arrayfire = "3.7"` to the dependencies section of your project's Cargo.toml file. Make sure |
| 32 | + to change the version to latest available. |
48 | 33 |
|
49 |
| -Once step (4) is over, you should be able to use ArrayFire in your Rust |
50 |
| -project. If you find any bugs, please report them |
51 |
| -[here](https://github.com/arrayfire/arrayfire-rust/issues). |
| 34 | +Once step (4) is over, you should be able to use ArrayFire in your Rust project. If you find any |
| 35 | +bugs, please report them [here][2]. |
52 | 36 |
|
53 | 37 | ## Build from Source
|
54 | 38 |
|
55 |
| -Edit [build.conf](build.conf) to modify the build flags. The structure is a |
56 |
| -simple JSON blob. Currently Rust does not allow key:value pairs to be passed |
57 |
| -from the CLI. To use an existing ArrayFire installation modify the first three |
58 |
| -JSON values. You can install ArrayFire using one of the following two ways. |
| 39 | +Edit [build.conf](build.conf) to modify the build flags. The structure is a simple JSON blob. |
| 40 | +Currently Rust does not allow key:value pairs to be passed from the CLI. To use an existing |
| 41 | +ArrayFire installation modify the first three JSON values. You can install ArrayFire using |
| 42 | +one of the following two ways. |
59 | 43 |
|
60 |
| -- [Download and install binaries](https://arrayfire.com/download) |
61 |
| -- [Build and install from source](https://github.com/arrayfire/arrayfire) |
| 44 | +- [Download and install binaries][10] |
| 45 | +- [Build and install from source][1] |
62 | 46 |
|
63 |
| -To build arrayfire submodule available in the rust wrapper, you have to do |
64 |
| -the following. |
| 47 | +To build arrayfire submodule available in the rust wrapper, you have to do the following. |
65 | 48 |
|
66 | 49 | ```bash
|
67 | 50 | git submodule update --init --recursive
|
68 |
| -cargo build |
| 51 | +cargo build // use --all to build all crates in the workspace |
69 | 52 | ```
|
70 |
| -This is recommended way to build Rust wrapper since the submodule points to |
71 |
| -the most compatible version of ArrayFire the Rust wrapper has been tested with. |
72 |
| -You can find the ArrayFire dependencies below. |
| 53 | +This is recommended way to build Rust wrapper since the submodule points to the most compatible |
| 54 | +version of ArrayFire the Rust wrapper has been tested with. You can find the ArrayFire dependencies below. |
73 | 55 |
|
74 |
| -- [Linux](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Linux) |
75 |
| -- [OSX](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-OSX) |
76 |
| -- [Windows](https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Windows) |
| 56 | +- [Linux][11] |
| 57 | +- [OSX][12] |
| 58 | +- [Windows][13] |
77 | 59 |
|
78 | 60 | ## Example
|
79 | 61 |
|
@@ -102,24 +84,37 @@ Create a 5-by-3 matrix of random floats on the GPU
|
102 | 84 |
|
103 | 85 | ## Acknowledgements
|
104 | 86 |
|
105 |
| -The ArrayFire library is written by developers at |
106 |
| -[ArrayFire](http://arrayfire.com) LLC with |
107 |
| -[contributions from several individuals](https://github.com/arrayfire/arrayfire_rust/graphs/contributors). |
108 |
| - |
109 |
| -The developers at ArrayFire LLC have received partial financial support |
110 |
| -from several grants and institutions. Those that wish to receive public |
111 |
| -acknowledgement are listed below: |
112 |
| - |
113 |
| -<!-- |
114 |
| -The following section contains acknowledgements for grant funding. In most |
115 |
| -circumstances, the specific phrasing of the text is mandated by the grant |
116 |
| -provider. Thus these acknowledgements must remain intact without modification. |
117 |
| ---> |
| 87 | +The ArrayFire library is written by developers at [ArrayFire][14] LLC with [contributions][15] |
| 88 | +from several individuals. The developers at ArrayFire LLC have received partial financial support |
| 89 | +from several grants and institutions. Those that wish to receive public acknowledgement are listed |
| 90 | +below: |
118 | 91 |
|
119 | 92 | ### Grants
|
120 | 93 |
|
121 |
| -This material is based upon work supported by the DARPA SBIR Program Office |
122 |
| -under Contract Numbers W31P4Q-14-C-0012 and W31P4Q-15-C-0008. |
123 |
| -Any opinions, findings and conclusions or recommendations expressed in this |
124 |
| -material are those of the author(s) and do not necessarily reflect the views of |
| 94 | +This material is based upon work supported by the DARPA SBIR Program Office under Contract Numbers |
| 95 | +W31P4Q-14-C-0012 and W31P4Q-15-C-0008. Any opinions, findings and conclusions or recommendations |
| 96 | +expressed in this material are those of the author(s) and do not necessarily reflect the views of |
125 | 97 | the DARPA SBIR Program Office.
|
| 98 | + |
| 99 | +[1]: https://github.com/arrayfire/arrayfire |
| 100 | +[2]: https://github.com/arrayfire/arrayfire-rust/issues |
| 101 | +[3]: http://arrayfire.github.io/arrayfire-rust/arrayfire/index.html |
| 102 | +[4]: https://join.slack.com/t/arrayfire-org/shared_invite/MjI4MjIzMDMzMTczLTE1MDI5ODg4NzYtN2QwNGE3ODA5OQ |
| 103 | +[5]: https://groups.google.com/forum/#!forum/arrayfire-users |
| 104 | +[6]: http://meritbadge.herokuapp.com/arrayfire |
| 105 | +[7]: https://crates.io/crates/arrayfire |
| 106 | +[8]: https://docs.rs/arrayfire/badge.svg |
| 107 | +[9]: https://docs.rs/arrayfire |
| 108 | +[10]: https://arrayfire.com/download |
| 109 | +[11]: https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Linux |
| 110 | +[12]: https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-OSX |
| 111 | +[13]: https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Windows |
| 112 | +[14]: https://arrayfire.com/ |
| 113 | +[15]: https://github.com/arrayfire/arrayfire_rust/graphs/contributors |
| 114 | +[16]: https://github.com/arrayfire/arrayfire-rust/actions?workflow=CI |
| 115 | +[17]: https://img.shields.io/badge/arrayfire-community-e69138?logo=slack |
| 116 | +[18]: https://img.shields.io/badge/arrayfire-Docs-blue?logo=readthedocs |
| 117 | +[19]: https://github.com/arrayfire/arrayfire-rust/workflows/ci/badge.svg?event=push |
| 118 | +[20]: https://img.shields.io/badge/arrayfire-google--groups-orange |
| 119 | +[21]: http://arrayfire.org/arrayfire-rust/book/index.html |
| 120 | +[22]: https://img.shields.io/badge/arrayfire-mdbook-073763?logo=readthedocs |
0 commit comments