|
1 | 1 | <a href="http://arrayfire.com/"><img src="http://arrayfire.com/logos/arrayfire_logo_whitebkgnd.png" width="300"></a>
|
2 | 2 |
|
3 |
| -ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its **array** based function set makes parallel programming simple. |
| 3 | +ArrayFire is a high performance software library for parallel computing with an |
| 4 | +easy-to-use API. Its **array** based function set makes parallel programming |
| 5 | +simple. |
4 | 6 |
|
5 |
| -ArrayFire's multiple backends (**CUDA**, **OpenCL** and native **CPU**) make it platform independent and highly portable. |
| 7 | +ArrayFire's multiple backends (**CUDA**, **OpenCL** and native **CPU**) make it |
| 8 | +platform independent and highly portable. ArrayFire provides visualization |
| 9 | +capabilities using our OpenGL-based, |
| 10 | +[high performance visualization library](https://github.com/arrayfire/forge). |
6 | 11 |
|
7 |
| -A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs. |
| 12 | +A few lines of code in ArrayFire can replace dozens of lines of parallel |
| 13 | +computing code, saving you valuable time and lowering development costs. |
8 | 14 |
|
9 |
| -### Build ArrayFire from source |
10 |
| -To build ArrayFire from source, please follow the instructions on our [wiki](https://github.com/arrayfire/arrayfire/wiki). |
11 |
| - |
12 |
| -### Download ArrayFire Installers |
13 |
| -ArrayFire binary installers can be downloaded at the [ArrayFire Downloads](http://go.arrayfire.com/l/37882/2015-03-31/mmhqy) page. |
14 |
| - |
15 |
| -### Support and Contact Info [](https://gitter.im/arrayfire/arrayfire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
16 |
| - |
17 |
| -* Google Groups: https://groups.google.com/forum/#!forum/arrayfire-users |
18 |
| -* ArrayFire Services: [Consulting](http://arrayfire.com/consulting/) | [Support](http://arrayfire.com/support/) | [Training](http://arrayfire.com/training/) |
19 |
| -* ArrayFire Blogs: http://arrayfire.com/blog/ |
20 |
| -* Email: <mailto:[email protected]> |
21 |
| - |
22 |
| -### Build Status |
23 |
| -| | Linux x86 | Linux armv7l | Linux aarch64 | Windows | OSX | |
24 |
| -|:-------:|:---------:|:------------:|:-------------:|:-------:|:---:| |
| 15 | +| | Linux x86_64 | Linux armv7l | Linux aarch64 | Windows | OSX | |
| 16 | +|:-------:|:------------:|:------------:|:-------------:|:-------:|:---:| |
25 | 17 | | Build | [](http://ci.arrayfire.org/job/arrayfire-linux/job/build/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-tegrak1/job/build/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-tegrax1/job/build/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-windows/job/build/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-osx/job/build/branch/devel/) |
|
26 | 18 | | Test | [](http://ci.arrayfire.org/job/arrayfire-linux/job/test/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-tegrak1/job/test/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-tegrax1/job/test/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-windows/job/test/branch/devel/) | [](http://ci.arrayfire.org/job/arrayfire-osx/job/test/branch/devel/) |
|
27 | 19 |
|
28 |
| -Test coverage: [](https://coveralls.io/r/arrayfire/arrayfire?branch=HEAD) |
| 20 | +### Installation |
29 | 21 |
|
30 |
| -### Example |
| 22 | +You can install the ArrayFire library from one of the following ways: |
31 | 23 |
|
32 |
| -``` C++ |
| 24 | +#### Official installers |
33 | 25 |
|
34 |
| -#include <arrayfire.h> |
35 |
| -#include <cstdio> |
| 26 | +Execute one of our [official binary installers](https://arrayfire.com/download) |
| 27 | +for Linux, OSX, and Windows platforms. |
36 | 28 |
|
37 |
| -using namespace af; |
| 29 | +#### Build from source |
38 | 30 |
|
39 |
| -int main(int argc, char *argv[]) |
40 |
| -{ |
41 |
| - try { |
| 31 | +Build from source by following instructions on our |
| 32 | +[wiki](https://github.com/arrayfire/arrayfire/wiki). |
42 | 33 |
|
43 |
| - // Select a device and display arrayfire info |
44 |
| - int device = argc > 1 ? atoi(argv[1]) : 0; |
45 |
| - af::setDevice(device); |
46 |
| - af::info(); |
| 34 | +### Examples |
47 | 35 |
|
48 |
| - printf("Create a 5-by-3 matrix of random floats on the GPU\n"); |
49 |
| - array A = randu(5,3, f32); |
50 |
| - af_print(A); |
| 36 | +The following examples are simplified versions of |
| 37 | +[`helloworld.cpp`](https://github.com/arrayfire/arrayfire/tree/devel/examples/helloworld/helloworld.cpp) |
| 38 | +and |
| 39 | +[`conway_pretty.cpp`](https://github.com/arrayfire/arrayfire/tree/devel/examples/graphics/conway_pretty.cpp), |
| 40 | +respectively. For more code examples, visit the |
| 41 | +[`examples/`](https://github.com/arrayfire/arrayfire/tree/devel/examples) |
| 42 | +directory. |
51 | 43 |
|
52 |
| - printf("Element-wise arithmetic\n"); |
53 |
| - array B = sin(A) + 1.5; |
54 |
| - af_print(B); |
| 44 | +#### Hello, world! |
55 | 45 |
|
56 |
| - printf("Negate the first three elements of second column\n"); |
57 |
| - B(seq(0, 2), 1) = B(seq(0, 2), 1) * -1; |
58 |
| - af_print(B); |
| 46 | +```cpp |
| 47 | +array A = randu(5, 3, f32); // Create 5x3 matrix of random floats on the GPU |
| 48 | +array B = sin(A) + 1.5; // Element-wise arithmetic |
| 49 | +array C = fft(B); // Fourier transform the result |
59 | 50 |
|
60 |
| - printf("Fourier transform the result\n"); |
61 |
| - array C = fft(B); |
62 |
| - af_print(C); |
| 51 | +float d[] = { 1, 2, 3, 4, 5, 6 }; |
| 52 | +array D(2, 3, d, afHost); // Create 2x3 matrix from host data |
| 53 | +D.col(0) = D.col(end); // Copy last column onto first |
63 | 54 |
|
64 |
| - printf("Grab last row\n"); |
65 |
| - array c = C.row(end); |
66 |
| - af_print(c); |
| 55 | +array vals, inds; |
| 56 | +sort(vals, inds, A); // Sort A and print sorted array and corresponding indices |
| 57 | +af_print(vals); |
| 58 | +af_print(inds); |
| 59 | +``` |
67 | 60 |
|
68 |
| - printf("Create 2-by-3 matrix from host data\n"); |
69 |
| - float d[] = { 1, 2, 3, 4, 5, 6 }; |
70 |
| - array D(2, 3, d, af::afHost); |
71 |
| - af_print(D); |
| 61 | +#### Conway's Game of Life |
72 | 62 |
|
73 |
| - printf("Copy last column onto first\n"); |
74 |
| - D.col(0) = D.col(end); |
75 |
| - af_print(D); |
| 63 | +Visit the |
| 64 | +[Wikipedia page](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life) for a |
| 65 | +description of Conway's Game of Life. |
76 | 66 |
|
77 |
| - // Sort A |
78 |
| - printf("Sort A and print sorted array and corresponding indices\n"); |
79 |
| - array vals, inds; |
80 |
| - sort(vals, inds, A); |
81 |
| - af_print(vals); |
82 |
| - af_print(inds); |
| 67 | +```cpp |
| 68 | +static const float h_kernel[] = {1, 1, 1, 1, 0, 1, 1, 1, 1}; |
| 69 | +static const array kernel(3, 3, h_kernel, afHost); |
83 | 70 |
|
84 |
| - } catch (af::exception& e) { |
85 |
| - fprintf(stderr, "%s\n", e.what()); |
86 |
| - throw; |
87 |
| - } |
| 71 | +array state = (randu(128, 128, f32) > 0.5).as(f32); // Generate starting state |
| 72 | +Window myWindow(256, 256); |
| 73 | +while(!myWindow.close()) { |
| 74 | + array nHood = convolve(state, kernel); // Obtain neighbors |
| 75 | + array C0 = (nHood == 2); // Generate conditions for life |
| 76 | + array C1 = (nHood == 3); |
| 77 | + state = state * C0 + C1; // Update state |
| 78 | + myWindow.image(state); // Display |
88 | 79 | }
|
89 | 80 |
|
90 | 81 | ```
|
91 | 82 |
|
| 83 | +<p align="center"> |
| 84 | +<img src="https://github.com/arrayfire/assets/blob/master/gifs/conway.gif" alt="Conway's Game of Life" height="256" width="256"> |
| 85 | +</p> |
| 86 | + |
92 | 87 | ### Documentation
|
93 | 88 |
|
94 |
| -You can find our complete documentation over [here](http://www.arrayfire.com/docs/index.htm). |
| 89 | +You can find our complete documentation [here](http://www.arrayfire.com/docs/index.htm). |
95 | 90 |
|
96 | 91 | Quick links:
|
97 | 92 |
|
98 |
| -- [Download Binaries](http://www.arrayfire.com/download/) |
99 |
| -- [List of functions](http://www.arrayfire.com/docs/group__arrayfire__func.htm) |
100 |
| -- [Tutorials](http://www.arrayfire.com/docs/gettingstarted.htm) |
101 |
| -- [Examples](http://www.arrayfire.com/docs/examples.htm) |
| 93 | +* [List of functions](http://www.arrayfire.org/docs/group__arrayfire__func.htm) |
| 94 | +* [Tutorials](http://www.arrayfire.org/docs/usergroup0.htm) |
| 95 | +* [Examples](http://www.arrayfire.org/docs/examples.htm) |
| 96 | +* [Blog](http://arrayfire.com/blog/) |
102 | 97 |
|
103 |
| -### Contribute |
| 98 | +### Language wrappers |
104 | 99 |
|
105 |
| -Contributions of any kind are welcome! Please refer to |
106 |
| -[this document](https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md) |
107 |
| - to learn more about how you can get involved with ArrayFire. |
| 100 | +We currently support the following language wrappers for ArrayFire: |
108 | 101 |
|
109 |
| -## Citations and Acknowledgements |
| 102 | +* [`arrayfire-python`](https://github.com/arrayfire/arrayfire-python) |
| 103 | +* [`arrayfire-rust`](https://github.com/arrayfire/arrayfire-rust) |
110 | 104 |
|
111 |
| -If you redistribute ArrayFire, please follow the terms established in |
112 |
| -[the license](LICENSE). |
113 |
| -If you wish to cite ArrayFire in an academic publication, please use the |
114 |
| -following reference: |
| 105 | +Wrappers for other languages are a work in progress: |
115 | 106 |
|
116 |
| -Formatted: |
117 |
| -``` |
118 |
| -Yalamanchili, P., Arshad, U., Mohammed, Z., Garigipati, P., Entschev, P., |
119 |
| -Kloppenborg, B., Malcolm, J. and Melonakos, J. (2015). |
120 |
| -ArrayFire - A high performance software library for parallel computing with an |
121 |
| -easy-to-use API. Atlanta: AccelerEyes. Retrieved from https://github.com/arrayfire/arrayfire |
122 |
| -``` |
| 107 | +[`arrayfire-dotnet`](https://github.com/arrayfire/arrayfire-dotnet), [`arrayfire-fortran`](https://github.com/arrayfire/arrayfire-fortran), [`arrayfire-go`](https://github.com/arrayfire/arrayfire-go), [`arrayfire-java`](https://github.com/arrayfire/arrayfire-java), [`arrayfire-lua`](https://github.com/arrayfire/arrayfire-lua), [`arrayfire-nodejs`](https://github.com/arrayfire/arrayfire-js), [`arrayfire-r`](https://github.com/arrayfire/arrayfire-r) |
123 | 108 |
|
124 |
| -BibTeX: |
125 |
| -```bibtex |
126 |
| -@misc{Yalamanchili2015, |
127 |
| -abstract = {ArrayFire is a high performance software library for parallel computing with an easy-to-use API. Its array based function set makes parallel programming simple. ArrayFire's multiple backends (CUDA, OpenCL and native CPU) make it platform independent and highly portable. A few lines of code in ArrayFire can replace dozens of lines of parallel computing code, saving you valuable time and lowering development costs.}, |
128 |
| -address = {Atlanta}, |
129 |
| -author = {Yalamanchili, Pavan and Arshad, Umar and Mohammed, Zakiuddin and Garigipati, Pradeep and Entschev, Peter and Kloppenborg, Brian and Malcolm, James and Melonakos, John}, |
130 |
| -publisher = {AccelerEyes}, |
131 |
| -title = {{ArrayFire - A high performance software library for parallel computing with an easy-to-use API}}, |
132 |
| -url = {https://github.com/arrayfire/arrayfire}, |
133 |
| -year = {2015} |
134 |
| -} |
135 |
| -``` |
| 109 | +### Contributing |
| 110 | + |
| 111 | +Contributions of any kind are welcome! Please refer to |
| 112 | +[CONTRIBUTING.md](https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md) |
| 113 | +to learn more about how you can get involved with ArrayFire. |
| 114 | + |
| 115 | +### Citations and Acknowledgements |
| 116 | + |
| 117 | +If you redistribute ArrayFire, please follow the terms established in |
| 118 | +[the license](LICENSE). If you wish to cite ArrayFire in an academic |
| 119 | +publication, please use the following [citation document](.github/CITATION.md). |
136 | 120 |
|
137 | 121 | ArrayFire development is funded by ArrayFire LLC and several third parties,
|
138 |
| -please see the list of [acknowledgements](https://github.com/arrayfire/arrayfire/blob/master/ACKNOWLEDGEMENTS.md) for further details. |
| 122 | +please see the list of [acknowledgements](ACKNOWLEDGEMENTS.md) for further |
| 123 | +details. |
139 | 124 |
|
| 125 | +### Support and Contact Info [](https://gitter.im/arrayfire/arrayfire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 126 | + |
| 127 | +* [Google Groups](https://groups.google.com/forum/#!forum/arrayfire-users) |
| 128 | +* ArrayFire Services: [Consulting](http://arrayfire.com/consulting/) | [Support](http://arrayfire.com/support/) | [Training](http://arrayfire.com/training/) |
0 commit comments