(8429,18528,'2015-06-25 18:37:34','2015-06-25 18:37:34','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party ccontributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several<a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already<a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a>library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a>discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h4 id=\"how-can-you-help-\">How can you help?</h4>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and<a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some sweet, sweet karma by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a> <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a> <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and<a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:37:34','2015-06-25 18:37:34','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8430,18528,'2015-06-25 18:38:42','2015-06-25 18:38:42','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party ccontributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several<a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a>library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h4 id=\"how-can-you-help-\">How can you help?</h4>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:38:42','2015-06-25 18:38:42','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8431,18528,'2015-06-25 18:39:08','2015-06-25 18:39:08','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party ccontributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several<a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a>library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:39:08','2015-06-25 18:39:08','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8432,18528,'2015-06-25 18:41:49','2015-06-25 18:41:49','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party ccontributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several<a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:41:49','2015-06-25 18:41:49','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8433,18528,'2015-06-25 18:58:50','2015-06-25 18:58:50','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several<a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:58:50','2015-06-25 18:58:50','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8435,18528,'2015-06-25 18:59:48','2015-06-25 18:59:48','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux, but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our<a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the<a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 18:59:48','2015-06-25 18:59:48','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8436,18528,'2015-06-25 19:02:53','2015-06-25 19:02:53','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux that use the MKL library (and hence perform better than pure from-source builds), but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person does not feel comfortable writing code for the ArrayFire library core, they may also contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 19:02:53','2015-06-25 19:02:53','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8438,18528,'2015-06-25 19:07:59','2015-06-25 19:07:59','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We already <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux that use the MKL library (and hence perform better than pure from-source builds), but a few users have taken up the task of packaging ArrayFire for their favorite operating systems. In particular, <a href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a> created Debian packages for <a href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a>, <a href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a>, and <a href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) Around the same time <a href=\"https://github.com/hmalphettes\">Hugues Malphettes</a> created a Homebrew Formula for <a href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a>. Not to be left out of the packaging fun, our own <a href=\"https://github.com/pavanky\">Pavan Yalamanchili</a> recently assumed the role as maintainer for the <a href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 19:07:59','2015-06-25 19:07:59','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8439,18528,'2015-06-25 19:15:09','2015-06-25 19:15:09','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux that incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a><span style=\"line-height: 1.5;\">. Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\r\n\r\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have already received have been quite substantial. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire maybe used in other languages, and many code changes that have improved our build process and code reliability. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 19:15:09','2015-06-25 19:15:09','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8440,18528,'2015-06-25 19:19:48','2015-06-25 19:19:48','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux that incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a><span style=\"line-height: 1.5;\">. Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\r\n\r\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have received a substantial number of contributions. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire may be used in other languages, and contributing code changes that improve our build process. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-25 19:19:48','2015-06-25 19:19:48','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8443,4,'2015-06-29 16:09:23','2015-06-29 16:09:23','There are many open source libraries that implement parallel versions of the algorithms in the C++ standard template libraries. Inevitably we get asked questions about how ArrayFire compares to the other libraries out in the open.\r\n\r\nIn this post we are going to compare the performance of ArrayFire to that of BoostCompute, HSA-Bolt, Intel TBB and Thrust. The benchmarks include the following commonly used vector algorithms across 3 different architectures.\r\n<ul>\r\n	<li><a href=\"#reductions\">Reductions</a></li>\r\n	<li><a href=\"#scan\">Scan</a></li>\r\n	<li><a href=\"#transform\">Transform</a></li>\r\n</ul>\r\nThe following setup has been used for the benchmarking purposes. The code to reproduce the benchmarks is linked at the bottom of the post. The hardware used for the benchmarks is listed below:\r\n<ul>\r\n	<li>NVIDIA Tesla K20</li>\r\n	<li>AMD FirePro S10000</li>\r\n	<li>Intel Xeon E5-2560v2</li>\r\n</ul>\r\n<h3 id=\"background\">Background</h3>\r\n<strong>ArrayFire</strong>\r\n\r\nArrayFire provides high performance primitives across a <a href=\"http://www.sandbox.arrayfire.com/docs/group__func__categories.htm\">wide spectrum of domains</a>. Objects of the base class, <a href=\"http://www.sandbox.arrayfire.com/docs/classaf_1_1array.htm\">array</a>, can support up to 4 dimensions. It enables users to take advantage of parallelism at multiple levels by <a href=\"http://sandbox.arrayfire.com/how-to-write-vectorized-code/\">writing vectorized code</a>.\r\n\r\nArrayFire supports NVIDIA GPUs using CUDA and OpenCL, AMD GPUs using OpenCL and Intel / AMD CPUs in serial and parallel (using OpenCL) modes. For this post, ArrayFire 3.0 has been used. You can download ArrayFire from the following locations.\r\n<ul>\r\n	<li><a href=\"http://sandbox.arrayfire.com/download/\">Installers</a></li>\r\n	<li><a href=\"https://github.com/arrayfire/arrayfire\">Build from source</a></li>\r\n</ul>\r\n<strong>BoostCompute</strong>\r\n\r\nBoost Compute is C++ template library for parallel computing based on OpenCL. Boost Compute provides accelerated versions of the algorithms present in the standard template library. It also provides an alternative C++ wrapper over common OpenCL C routines.\r\n\r\nBoost Compute supports NVIDIA GPUs, AMD GPUs and Intel / AMD CPUs using OpenCL. You can download BoostCompute from the following locations.\r\n<ul>\r\n	<li><a href=\"https://github.com/boostorg/compute\">Header only library</a></li>\r\n</ul>\r\nArrayFire uses BoostCompute for sorting, set operations and finding regions in an image in our OpenCL backend.\r\n\r\n<strong>Hsa-Bolt</strong>\r\n\r\nBolt is a C++ template library optimized for heterogenous computing. It supports routines built on top of OpenCL, C++ AMP, and TBB. It provides high performance implementations of common algorithms from the Standard Template Library.\r\n\r\nYou can download the source to Hsa-Bolt from the following locations.\r\n<ul>\r\n	<li><a href=\"https://github.com/HSA-Libraries/Bolt\">Build from Source</a></li>\r\n</ul>\r\n<strong>Thrust</strong>\r\n\r\nThrust is a parallel algorithms library providing high level C++ interafce on top of CUDA, OpenMP and TBB. It resembles C++ standard template library and provides accelerated versions of the commonly used algorithms.\r\n\r\nThrust supports NVIDIA GPUs using CUDA and Intel / AMD GPUs using OpenMP and TBB. You can download thrust from the following locations.\r\n<ul>\r\n	<li><a href=\"https://developer.nvidia.com/cuda-downloads\">From CUDA 7.0</a></li>\r\n	<li><a href=\"https://github.com/thrust/thrust\">Header only library</a></li>\r\n</ul>\r\nArrayFire uses Thrust for sorting, set operations and finding regions in an image in our CUDA backend.\r\n\r\n<strong>Intel TBB</strong>\r\n\r\nThreading Building Blocks (TBB) is a C++ template library developed by intel for multi-core processors. It provides platform independent data structures and algorithms that decrease the complexity of working with multiple threads.\r\n\r\nTBB supports multi-core processors (including the Xeon Phi). You can download TBB from the following locations.\r\n<ul>\r\n	<li><a href=\"https://www.threadingbuildingblocks.org/download\">Source and binaries</a></li>\r\n</ul>\r\n<h3 id=\"reductions\">Reductions</h3>\r\nThe reduction algorithm reduces the vector into a single element by successively reducing two input elements to a single output element. The most commonly used operations are addition, minimum and maximum.\r\n\r\nIt is one of the most commonly used algorithms in scientific and engineering algorithms. Most notably in the fields of statistics and machine learning.\r\n\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=1374058645&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=1835396253&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=492096912&amp;format=interactive\">\r\n</iframe>\r\n\r\n<strong>AMD FirePro S10000</strong>\r\n<ul>\r\n	<li>For sizes less than 10 million elements, ArrayFire is the fastest followed by HSA-Bolt and BoostComput</li>\r\n	<li>For sizes approaching 100 million elements, HSA-Bolt is 10% faster ArrayFire, and 15% faster than BoostCompute</li>\r\n</ul>\r\n<strong>NVIDIA Tesla K20</strong>\r\n<ul>\r\n	<li>ArrayFire consistently performs better than other libraries for sizes less than 10 million elements</li>\r\n	<li>ArrayFire OpenCL performs better than ArrayFire CUDA for sizes greater than 1 million elements.</li>\r\n	<li>BoostCompute consistently performs better than Thrust</li>\r\n	<li>For sizes approaching 100 million elements, ArrayFire OpenCL is fastest followed by BoostCompute, Thrust and ArrayFire CUDA</li>\r\n</ul>\r\n<strong>Intel Xeon E5-2560v2</strong>\r\n<ul>\r\n	<li>Intel TBB is significantly faster than ArrayFire and BoostCompute for sizes less than 1 million elements</li>\r\n	<li>ArrayFire is about 20% to 30% slower for sizes greater than 1 million elements</li>\r\n	<li>BoostCompute is about 40% to 70% slower for sizes greater than 1 million elements</li>\r\n</ul>\r\n<h3 id=\"scan\">Scan</h3>\r\nThe scan algorithm is useful when performing condition select operations. It can also be used where cumulative distributions are needed.\r\n\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=1469250706&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=1909166539&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=944922182&amp;format=interactive\">\r\n</iframe>\r\n\r\n<strong>AMD FirePro S10000</strong>\r\n<ul>\r\n	<li>ArrayFire consistently performs better than other libraries</li>\r\n	<li>HSA-Bolt consistently performs better than BoostCompute</li>\r\n</ul>\r\n<strong>NVIDIA Tesla K20</strong>\r\n<ul>\r\n	<li>ArrayFire performs better than other libraries for sizes less than 1 million elements</li>\r\n	<li>ArrayFire OpenCL performs better than ArrayFire CUDA for sizes greater than 100000 elements</li>\r\n	<li>Thrust consistently performs better than BoostCompute</li>\r\n	<li>For sizes greater than 1 million elements, Thrust is 16% faster than ArrayFire OpenCL, 22% faster than ArrayFire CUDA</li>\r\n</ul>\r\n<strong>Intel Xeon E5-2560v2</strong>\r\n<ul>\r\n	<li>Intel TBB is significantly faster than ArrayFire and BoostCompute for all sizes</li>\r\n</ul>\r\n<h3 id=\"transform\">Transform</h3>\r\nThe transform operation performs the same operations on each element of the input array. For this benchmark a commonly used function called <code>saxpy</code> has been used.\r\n\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=2057408484&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=180276342&amp;format=interactive\">\r\n</iframe>\r\n<iframe width=\"540\" height=\"360\" seamless=\"\" frameborder=\"0\" scrolling=\"yes\" src=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/pubchart?oid=2014239669&amp;format=interactive\">\r\n</iframe>\r\n\r\n<strong>AMD FirePro S10000</strong>\r\n<ul>\r\n	<li>ArrayFire consistently performs better than other libraries</li>\r\n	<li>BoostCompute consistently performs better than HSA-Bolt</li>\r\n</ul>\r\n<strong>NVIDIA Tesla K20</strong>\r\n<ul>\r\n	<li>For sizes less than 1 million elements, Thrust is the fastest, followed by ArrayFire CUDA, ArrayFire OpenCL and BoostCompute</li>\r\n	<li>For sizes greater than 1 million elements, BoostCompute is fastest followed by ArrayFire OpenCL, Thrust and ArrayFire CUDA</li>\r\n</ul>\r\n<strong>Intel Xeon E5-2560v2</strong>\r\n<ul>\r\n	<li>For sizes less than 1 million elements, TBB is significantly faster than BoostCompute and ArrayFire</li>\r\n	<li>For sizes larger than 1 million elements, all three libraries perform within 5% of each other</li>\r\n</ul>\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOn AMD and NVIDIA GPUs, ArrayFire is the fastest library for vectors on the order of 10 million elements. At even smaller sizes, ArrayFire\'s memory manager ammortizes the memory allocation and deallocation time, making it significantly faster than the alternatives. While improvements can be made overall, one particular area that can be improved upon would be the scan algorithm at large sizes.\r\n\r\nOn Intel Xeons, TBB is significantly faster than OpenCL implementations. Improvements can and should be made in ArrayFire to extract the best performance out of multicore CPUs. Our roadmap for the next quarter includes a native parallel implementation for our CPU backend. This should bridge the performance gap seen in these benchmarks.\r\n\r\nEach library performed better than the others at some point in the benchmarks. Considering that all the libraries are open source, these results should provide a motivation for these libraries to learn from each other.\r\n<h3 id=\"links\">Links:</h3>\r\n<ul>\r\n	<li><a href=\"https://github.com/arrayfire/valhalla\">Code</a></li>\r\n	<li><a href=\"https://docs.google.com/spreadsheets/d/1eWmehHURrormikwlS0ZtlW2cF6D54H4jRoBekDgfpfk/edit#gid=60225335\">Raw data</a></li>\r\n</ul>','Benchmarking parallel vector libraries','','inherit','open','closed','','8337-revision-v1','','','2015-06-29 16:09:23','2015-06-29 16:09:23','',8337,'http://sandbox.arrayfire.com/8337-revision-v1/',0,'revision','',0),(8444,18528,'2015-06-29 16:11:21','2015-06-29 16:11:21','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux (x64), and the Jetson TK1. The Linux and Windows installers incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. The OSX Installer uses the Accelerate Framework to give the best performance on OSX machines. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a><span style=\"line-height: 1.5;\">. Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>.\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\r\n\r\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have received a substantial number of contributions. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire may be used in other languages, and contributing code changes that improve our build process. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-06-29 16:11:21','2015-06-29 16:11:21','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8445,7,'2015-06-29 17:41:09','2015-06-29 17:41:09','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lvvyk\" size=\"regular\" ]Windows, v3.0.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.0.2\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.0.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.0.2\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-06-29 17:41:09','2015-06-29 17:41:09','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8448,7,'2015-07-10 20:00:33','2015-07-10 20:00:33','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lvvyk\" size=\"regular\" ]Windows, v3.0.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.0.2\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.0.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.0.2\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-07-10 20:00:33','2015-07-10 20:00:33','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8451,18528,'2015-07-21 21:06:38','2015-07-21 21:06:38','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\n\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\n<h4>Packaging for Linux and OSX</h4>\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux (x64), and the Jetson TK1. The Linux and Windows installers incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. The OSX Installer uses the Accelerate Framework to give the best performance on OSX machines. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) </span><span style=\"line-height: 1.5;\">Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span>installing ArrayFire on OSX from source<span style=\"line-height: 1.5;\">. Combined with Ghislain\'s recent work to package ArrayFire and its dependencies for Homebrew, it is easier than ever to deploy ArrayFire on OSX. [edit... since this post was originally written Ghislain submitted his ArrayFire homebrew formula to the official <a href=\"https://github.com/Homebrew/homebrew-science\">homebrew-science</a> repository to which it has been accepted]</span>\n\n<span style=\"line-height: 1.5;\">Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>.\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\n<h4 id=\"improving-the-code\">Improving the code</h4>\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\n<h4 id=\"reporting-issues\">Reporting issues</h4>\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\n<ul>\n	<li>make requests for new features</li>\n	<li>suggest performance improvements</li>\n	<li>report build issues</li>\n	<li>file bug reports</li>\n	<li>and report on new hardware/backend support status.</li>\n</ul>\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\n\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\n<h4 id=\"whitepapers\">Whitepapers</h4>\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\n<h4 id=\"social-media\">Social media</h4>\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\n<h3 id=\"conclusion\">Conclusion</h3>\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have received a substantial number of contributions. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire may be used in other languages, and contributing code changes that improve our build process. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-autosave-v1','','','2015-07-21 21:06:38','2015-07-21 21:06:38','',8426,'http://sandbox.arrayfire.com/8426-autosave-v1/',0,'revision','',0),(8452,18528,'2015-07-13 16:53:14','2015-07-13 16:53:14','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux (x64), and the Jetson TK1. The Linux and Windows installers incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. The OSX Installer uses the Accelerate Framework to give the best performance on OSX machines. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) </span><span style=\"line-height: 1.5;\">Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/sutoiku/homebrew-arrayfire\">installing ArrayFire on OSX from source</a><span style=\"line-height: 1.5;\">. Combined with Ghislain\'s recent work to package ArrayFire and its dependencies for Homebrew, it is easier than ever to deploy ArrayFire on OSX. Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>.\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\r\n\r\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have received a substantial number of contributions. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire may be used in other languages, and contributing code changes that improve our build process. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-07-13 16:53:14','2015-07-13 16:53:14','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8454,18528,'2015-07-21 21:07:39','2015-07-21 21:07:39','<p id=\"the-many-benefits-of-open-source-contributors\">Making the decision to open source your software is not an easy process. Indeed, here at ArrayFire our choice to <a href=\"https://github.com/arrayfire/arrayfire\">release ArrayFire</a> under the open source, commercially friendly, BSD 3-Clause License came only after many hours of consideration and philosophical discussion (e.g. see our <a href=\"http://notonlyluck.com/2014/07/31/the-decision-to-open-source-arrayfire/\">CEO\'s blog on these topics</a>). Thus far this decision has proven to be strictly beneficial to our company.</p>\r\n\r\n<h3 id=\"the-impact-of-third-party-contributions\">The impact of third-party contributions</h3>\r\nAlthough ArrayFire is primarily developed by our engineers, there are several <a href=\"https://github.com/arrayfire/arrayfire/graphs/contributors\">contributions from other</a> developers. Therefore we feel particularly compelled to elucidate how these contributions have improved the ArrayFire ecosystem.\r\n<h4>Packaging for Linux and OSX</h4>\r\nOne of the best parts of open source distribution is that your code can be packaged and distributed for a wide variety of operating systems. We <a href=\"http://sandbox.arrayfire.com/download\">distribute binary installers</a> for Windows, OSX, and Linux (x64), and the Jetson TK1. The Linux and Windows installers incorporate the Intel Math Kernel Library (MKL) and hence perform better than pure from-source builds. The OSX Installer uses the Accelerate Framework to give the best performance on OSX machines. Nevertheless, a few users have taken up the task of packaging ArrayFire for their favorite operating systems. <span style=\"line-height: 1.5;\">In particular, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/ghisvail\">Ghislain Antony Vaillant</a><span style=\"line-height: 1.5;\"> created Debian packages for </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clFFT\">clFFT</a><span style=\"line-height: 1.5;\">, </span><a style=\"line-height: 1.5;\" href=\"https://github.com/clMathLibraries/clBLAS\">clBLAS</a><span style=\"line-height: 1.5;\">, and </span><a style=\"line-height: 1.5;\" href=\"https://ftp-master.debian.org/new/arrayfire_3.0.1-1.html\">recently added</a><span style=\"line-height: 1.5;\"> ArrayFire\'s CPU backend. After clFFT and clBLAS are accepted his intention is to also package and submit our OpenCL backend to the Debian package repository. (It is unlikely that the CUDA backend will be packaged since CUDA has a license that does not agree with Debian standards.) </span><span style=\"line-height: 1.5;\">Around the same time </span><a style=\"line-height: 1.5;\" href=\"https://github.com/hmalphettes\">Hugues Malphettes</a><span style=\"line-height: 1.5;\"> created a Homebrew Formula for </span>installing ArrayFire on OSX from source<span style=\"line-height: 1.5;\">. Combined with Ghislain\'s recent work to package ArrayFire and its dependencies for Homebrew, it is easier than ever to deploy ArrayFire on OSX. [edit... since this post was originally written Ghislain\'s homebrew formula has been accepted to the official <a href=\"https://github.com/Homebrew/homebrew-science\">homebrew-science</a> repository.] </span><span style=\"line-height: 1.5;\">Not to be left out of the packaging fun, our own </span><a style=\"line-height: 1.5;\" href=\"https://github.com/pavanky\">Pavan Yalamanchili</a><span style=\"line-height: 1.5;\"> recently assumed the role as maintainer for the </span><a style=\"line-height: 1.5;\" href=\"https://aur.archlinux.org/packages/arrayfire-git/\">ArrayFire Arch Linux package</a>.\r\n<h4 id=\"arrayfire-js\">ArrayFire.js</h4>\r\nAmong the most fundamental third party contributions is the creation of Node.js bindings for ArrayFire by <a href=\"https://github.com/unbornchikken\">Gábor Mező</a>. Gábor has previously created bindings for (<a href=\"https://github.com/unbornchikken/NOOOCL\">NOOCL</a>) CMake (<a href=\"https://github.com/unbornchikken/cmake-js\">CMake.js</a>) and made several contributions to the Foreign Function Interface for Node, <a href=\"https://github.com/node-ffi/node-ffi\">node-ffi</a>. In less than a month Gábor created the bindings and contributed it to our GitHub organization. This new <a href=\"https://github.com/arrayfire/arrayfire_js\">ArrayFire.js</a> library lets you use the power of ArrayFire asyncronously from Javascript. We will write more about this project in the future.\r\n<h4 id=\"improving-the-code\">Improving the code</h4>\r\nVery early on we received input from several developers on how we might improve our CMake build system. <a href=\"https://github.com/glehmann\">Gaëtan Lehmann</a> added <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file\">CMake project configuration files</a>. which automatically create the equivilant of CMake find scripts. This let us remove our (manually maintained) <code>FindArrayFire.cmake</code> script. Gaëtan also wins the award for squelching the most compiler warnings by cleaning up 1000+ unused function warnings issued by clang by <a href=\"https://github.com/arrayfire/arrayfire/commit/7084517cf72d9271076d17547e50fa7ae8b55370\">adding two lines of code</a>. Similarly, <a href=\"https://github.com/nathanjackson\">Nathan Jackson</a> discovered and fixed a race condition in a reduction kernel, and added several tests for complex values and <a href=\"https://github.com/FilipeMaia\">Filipe Maia</a> added support for <code>s64</code> and <code>u64 </code>datatypes by contributing six lines of code and fixed missing definitions for some proxy operators.\r\n<h3 id=\"how-can-you-help-\">How can you help?</h3>\r\nLike many open source projects, there are many ways to contribute to the ArrayFire library:\r\n<h4 id=\"reporting-issues\">Reporting issues</h4>\r\nThe most fundamental way you can contribute is to use our library and help us find problems and suggest methods by which the library may be improved. Using the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> you may\r\n<ul>\r\n	<li>make requests for new features</li>\r\n	<li>suggest performance improvements</li>\r\n	<li>report build issues</li>\r\n	<li>file bug reports</li>\r\n	<li>and report on new hardware/backend support status.</li>\r\n</ul>\r\nBe sure to read the <a href=\"https://github.com/arrayfire/arrayfire/blob/master/CONTRIBUTING.md\">contributing guidelines</a> prior to submitting a pull request.\r\n<h4 id=\"documentation-usage-examples-and-community-help\">Documentation, usage examples, and community help</h4>\r\nIf you are using ArrayFire and find someplace where you think our <a href=\"http://sandbox.arrayfire.com/docs/\">documentation</a> could be improved or want to create a <a href=\"http://sandbox.arrayfire.com/docs/examples.htm\">new example</a> we would be happy to hear from you. You may submit these improvements through either the <a href=\"https://github.com/arrayfire/arrayfire/issues\">ArrayFire GitHub issue tracker</a> or send us a message on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>.\r\n\r\nThe ArrayFire library also has many methods of providing community-driven help. We would be happy to have your assistance answering questions on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Group</a>, <a href=\"https://gitter.im/arrayfire/arrayfire?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge\">Gitter chat</a>, and <a href=\"https://github.com/arrayfire/arrayfire/issues\">GitHub issue tracker</a>. If the question can\'t be answered here, we also do email support.\r\n<h4 id=\"whitepapers\">Whitepapers</h4>\r\nIf you have found ArrayFire particularly useful in your field or want to exemplify how ArrayFire has improved your software, considering writing a whitepaper with us! We have written whitepapers on topics ranging low-level memory optimizations for HPC applications to the impact of ArrayFire\'s matrix multiplication abilities on high-level language wrappers. We have skilled writers on hand who will work with you to develop a great technical publication. Contact either <a href=\"mailto:sales@arrayfire.com\">sales@arrayfire.com</a> or <a href=\"mailto:technical@arrayfire.com\">technical@arrayfire.com</a> to get started.\r\n<h4 id=\"social-media\">Social media</h4>\r\nHelp spread the word about ArrayFire by following <a href=\"https://twitter.com/arrayfire\">@arrayfire</a> on Twitter, and <a href=\"https://plus.google.com/+Arrayfire\">ArrayFire</a> on Google Plus. You can also collect some <em>sweet, sweet karma</em> by posting our blogs and progress updates on the <a href=\"http://reddit.com/r/OpenCL\">/r/OpenCL</a>, <a href=\"http://reddit.com/r/CUDA\">/r/CUDA</a>, <a href=\"http://reddit.com/r/cpp\">/r/cpp</a> and <a href=\"http://reddit.com/r/programming\">/r/programming</a> subreddits and <a href=\"https://news.ycombinator.com/\">HackerNews</a>\r\n<h4 id=\"directly-fund-arrayfire-development\">Directly fund ArrayFire development</h4>\r\nLastly, if you are a researcher who uses ArrayFire in your work consider writing ArrayFire in as a subcontractor on your next grant. Similarly, if you love ArrayFire but need some additional functionality fast, consider hiring ArrayFire to write the code for you. We offer a full range of <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> options that fit almost any budget.\r\n<h3 id=\"conclusion\">Conclusion</h3>\r\nOne of the most overlooked benefits of making a project open source are contributions from third parties. Since ArrayFire was open sourced in November 2014 we have received a substantial number of contributions. We have third-parties packaging our software for OSX and various Linux distributions, creating wrappers so ArrayFire may be used in other languages, and contributing code changes that improve our build process. Even a person who does not feel comfortable writing code for the ArrayFire library core may contribute by reporting issues, improving our documentation, answering questions on our Google Group page, collaborating with ArrayFire LLC to write whitepapers, talking about us on social media, and even directly funding development of the library through ArrayFire\'s <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting</a>, <a href=\"http://sandbox.arrayfire.com/support/\">support</a>, and OpenCL/CUDA/ArrayFire <a href=\"http://sandbox.arrayfire.com/training/\">training</a> services.','Contributors: A big benefit to open source software','','inherit','open','closed','','8426-revision-v1','','','2015-07-21 21:07:39','2015-07-21 21:07:39','',8426,'http://sandbox.arrayfire.com/8426-revision-v1/',0,'revision','',0),(8459,1,'2015-07-31 16:15:48','2015-07-31 16:15:48','','Order &ndash; July 31, 2015 @ 04:15 PM','','wc-completed','open','closed','order_55bb9f304721d','order-jul-31-2015-0415-pm','','','2015-07-31 16:15:49','2015-07-31 16:15:49','',0,'http://sandbox.arrayfire.com/?post_type=shop_order&#038;p=8459',0,'shop_order','',4),(8461,18528,'2015-08-10 16:53:40','2015-08-10 16:53:40','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n\r\n<li><code>ArrayFire_CPU_FOUND</code> - True of the ArrayFire CPU library has been found.</li>\r\n<li><code>ArrayFire_CPU_LIBRARIES</code> - Location of ArrayFire\'s CPU library, if found.</li>\r\n<li><code>ArrayFire_CUDA_FOUND</code> - True of the ArrayFire CUDA library has been found.</li>\r\n<li><code>ArrayFire_CUDA_LIBRARIES</code> - Location of ArrayFire\'s CUDA library, if found.</li>\r\n<li><code>ArrayFire_OpenCL_FOUND</code> - True of the ArrayFire OpenCL library has been found.</li>\r\n<li><code>ArrayFire_OpenCL_LIBRARIES</code> - Location of ArrayFire\'s OpenCL library, if found.</li>\r\n</ul>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','publish','open','closed','','building-an-arrayfire-program-with-cmake','','','2015-08-11 13:20:21','2015-08-11 13:20:21','',0,'http://sandbox.arrayfire.com/?p=8461',0,'post','',5),(8462,18528,'2015-08-08 20:27:33','2015-08-08 20:27:33','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Gropus page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time when linking against multiple backends. The instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you<a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators unless you are very familure with the process. There is a link to a GitHub repository containing the full worked example at the bottom of this blog post.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code><span class=\"hljs-function\"><span class=\"hljs-title\">CMAKE_MINIMUM_REQUIRED</span><span class=\"hljs-params\">(VERSION <span class=\"hljs-number\">3.0</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">PROJECT</span><span class=\"hljs-params\">(foo)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FIND_PACKAGE</span><span class=\"hljs-params\">(ArrayFire REQUIRED)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">INCLUDE_DIRECTORIES</span><span class=\"hljs-params\">(${ArrayFire_INCLUDE_DIRS})</span></span>\r\n\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe fooA.cpp fooB.cpp)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe ${ArrayFire_LIBRARIES} )</span></span>\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True <span class=\"hljs-keyword\">of</span> the ArrayFire CPU <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_CPU_LIBRARIES    - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> CPU <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\nArrayFire_CUDA_FOUND       - True <span class=\"hljs-keyword\">of</span> the ArrayFire CUDA <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> CUDA <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\nArrayFire_OpenCL_FOUND     - True <span class=\"hljs-keyword\">of</span> the ArrayFire OpenCL <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> OpenCL <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error <span class=\"hljs-keyword\">at</span> src/CMakeLists.txt:<span class=\"hljs-number\">5</span> (FIND_PACKAGE):\r\n  By <span class=\"hljs-operator\">not</span> providing <span class=\"hljs-string\">\"FindArrayFire.cmake\"</span> <span class=\"hljs-operator\">in</span> CMAKE_MODULE_PATH this project\r\n  has asked CMake <span class=\"hljs-built_in\">to</span> find <span class=\"hljs-operator\">a</span> package configuration <span class=\"hljs-built_in\">file</span> provided <span class=\"hljs-keyword\">by</span>\r\n  <span class=\"hljs-string\">\"ArrayFire\"</span>, but CMake did <span class=\"hljs-operator\">not</span> find <span class=\"hljs-constant\">one</span>.\r\n\r\n  Could <span class=\"hljs-operator\">not</span> find <span class=\"hljs-operator\">a</span> package configuration <span class=\"hljs-built_in\">file</span> provided <span class=\"hljs-keyword\">by</span> <span class=\"hljs-string\">\"ArrayFire\"</span> <span class=\"hljs-operator\">with</span>\r\n  <span class=\"hljs-keyword\">any</span> <span class=\"hljs-operator\">of</span> <span class=\"hljs-operator\">the</span> following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add <span class=\"hljs-operator\">the</span> installation prefix <span class=\"hljs-operator\">of</span> <span class=\"hljs-string\">\"ArrayFire\"</span> <span class=\"hljs-built_in\">to</span> CMAKE_PREFIX_PATH <span class=\"hljs-operator\">or</span> <span class=\"hljs-built_in\">set</span>\r\n  <span class=\"hljs-string\">\"ArrayFire_DIR\"</span> <span class=\"hljs-built_in\">to</span> <span class=\"hljs-operator\">a</span> <span class=\"hljs-built_in\">directory</span> containing <span class=\"hljs-constant\">one</span> <span class=\"hljs-operator\">of</span> <span class=\"hljs-operator\">the</span> above <span class=\"hljs-built_in\">files</span>.  If\r\n  <span class=\"hljs-string\">\"ArrayFire\"</span> provides <span class=\"hljs-operator\">a</span> separate development package <span class=\"hljs-operator\">or</span> SDK, be sure <span class=\"hljs-keyword\">it</span> has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have your first project running with ArrayFire!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nNext we will reduce compilation time using <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> for our project. To make an object library, we simply use the following:\r\n<pre><code>...\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FILE</span><span class=\"hljs-params\">(GLOB SOURCE <span class=\"hljs-string\">\"*.cpp\"</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_LIBRARY</span><span class=\"hljs-params\">(FOO_CORE OBJECT ${SOURCE})</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe ${ArrayFire_LIBRARIES} )</span></span>\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FILE</span><span class=\"hljs-params\">(GLOB SOURCE <span class=\"hljs-string\">\"*.cpp\"</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_LIBRARY</span><span class=\"hljs-params\">(FOO_CORE OBJECT ${SOURCE})</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )</span></span>\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example with source code.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:27:33','2015-08-08 20:27:33','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8463,18528,'2015-08-08 20:39:05','2015-08-08 20:39:05','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code><span class=\"hljs-function\"><span class=\"hljs-title\">CMAKE_MINIMUM_REQUIRED</span><span class=\"hljs-params\">(VERSION <span class=\"hljs-number\">3.0</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">PROJECT</span><span class=\"hljs-params\">(foo)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FIND_PACKAGE</span><span class=\"hljs-params\">(ArrayFire REQUIRED)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">INCLUDE_DIRECTORIES</span><span class=\"hljs-params\">(${ArrayFire_INCLUDE_DIRS})</span></span>\r\n\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe fooA.cpp fooB.cpp)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe ${ArrayFire_LIBRARIES} )</span></span>\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True <span class=\"hljs-keyword\">of</span> the ArrayFire CPU <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_CPU_LIBRARIES    - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> CPU <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\nArrayFire_CUDA_FOUND       - True <span class=\"hljs-keyword\">of</span> the ArrayFire CUDA <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> CUDA <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\nArrayFire_OpenCL_FOUND     - True <span class=\"hljs-keyword\">of</span> the ArrayFire OpenCL <span class=\"hljs-keyword\">library</span> has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location <span class=\"hljs-keyword\">of</span> ArrayFire<span class=\"hljs-attribute\">\'s</span> OpenCL <span class=\"hljs-keyword\">library</span>, <span class=\"hljs-keyword\">if</span> found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error <span class=\"hljs-keyword\">at</span> src/CMakeLists.txt:<span class=\"hljs-number\">5</span> (FIND_PACKAGE):\r\n  By <span class=\"hljs-operator\">not</span> providing <span class=\"hljs-string\">\"FindArrayFire.cmake\"</span> <span class=\"hljs-operator\">in</span> CMAKE_MODULE_PATH this project\r\n  has asked CMake <span class=\"hljs-built_in\">to</span> find <span class=\"hljs-operator\">a</span> package configuration <span class=\"hljs-built_in\">file</span> provided <span class=\"hljs-keyword\">by</span>\r\n  <span class=\"hljs-string\">\"ArrayFire\"</span>, but CMake did <span class=\"hljs-operator\">not</span> find <span class=\"hljs-constant\">one</span>.\r\n\r\n  Could <span class=\"hljs-operator\">not</span> find <span class=\"hljs-operator\">a</span> package configuration <span class=\"hljs-built_in\">file</span> provided <span class=\"hljs-keyword\">by</span> <span class=\"hljs-string\">\"ArrayFire\"</span> <span class=\"hljs-operator\">with</span>\r\n  <span class=\"hljs-keyword\">any</span> <span class=\"hljs-operator\">of</span> <span class=\"hljs-operator\">the</span> following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add <span class=\"hljs-operator\">the</span> installation prefix <span class=\"hljs-operator\">of</span> <span class=\"hljs-string\">\"ArrayFire\"</span> <span class=\"hljs-built_in\">to</span> CMAKE_PREFIX_PATH <span class=\"hljs-operator\">or</span> <span class=\"hljs-built_in\">set</span>\r\n  <span class=\"hljs-string\">\"ArrayFire_DIR\"</span> <span class=\"hljs-built_in\">to</span> <span class=\"hljs-operator\">a</span> <span class=\"hljs-built_in\">directory</span> containing <span class=\"hljs-constant\">one</span> <span class=\"hljs-operator\">of</span> <span class=\"hljs-operator\">the</span> above <span class=\"hljs-built_in\">files</span>.  If\r\n  <span class=\"hljs-string\">\"ArrayFire\"</span> provides <span class=\"hljs-operator\">a</span> separate development package <span class=\"hljs-operator\">or</span> SDK, be sure <span class=\"hljs-keyword\">it</span> has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FILE</span><span class=\"hljs-params\">(GLOB SOURCE <span class=\"hljs-string\">\"*.cpp\"</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_LIBRARY</span><span class=\"hljs-params\">(FOO_CORE OBJECT ${SOURCE})</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe ${ArrayFire_LIBRARIES} )</span></span>\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">FILE</span><span class=\"hljs-params\">(GLOB SOURCE <span class=\"hljs-string\">\"*.cpp\"</span>)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_LIBRARY</span><span class=\"hljs-params\">(FOO_CORE OBJECT ${SOURCE})</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">ADD_EXECUTABLE</span><span class=\"hljs-params\">(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)</span></span>\r\n<span class=\"hljs-function\"><span class=\"hljs-title\">TARGET_LINK_LIBRARIES</span><span class=\"hljs-params\">(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )</span></span>\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:39:05','2015-08-08 20:39:05','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8464,18528,'2015-08-08 20:41:12','2015-08-08 20:41:12','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION <span class=\"hljs-number\">3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True <span class=\"hljs-keyword\">of the ArrayFire CPU <span class=\"hljs-keyword\">library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location <span class=\"hljs-keyword\">of ArrayFire<span class=\"hljs-attribute\">\'s CPU <span class=\"hljs-keyword\">library, <span class=\"hljs-keyword\">if found\r\nArrayFire_CUDA_FOUND       - True <span class=\"hljs-keyword\">of the ArrayFire CUDA <span class=\"hljs-keyword\">library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location <span class=\"hljs-keyword\">of ArrayFire<span class=\"hljs-attribute\">\'s CUDA <span class=\"hljs-keyword\">library, <span class=\"hljs-keyword\">if found\r\nArrayFire_OpenCL_FOUND     - True <span class=\"hljs-keyword\">of the ArrayFire OpenCL <span class=\"hljs-keyword\">library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location <span class=\"hljs-keyword\">of ArrayFire<span class=\"hljs-attribute\">\'s OpenCL <span class=\"hljs-keyword\">library, <span class=\"hljs-keyword\">if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error <span class=\"hljs-keyword\">at src/CMakeLists.txt:<span class=\"hljs-number\">5 (FIND_PACKAGE):\r\n  By <span class=\"hljs-operator\">not providing \"FindArrayFire.cmake\" <span class=\"hljs-operator\">in CMAKE_MODULE_PATH this project\r\n  has asked CMake <span class=\"hljs-built_in\">to find <span class=\"hljs-operator\">a package configuration <span class=\"hljs-built_in\">file provided <span class=\"hljs-keyword\">by\r\n  \"ArrayFire\", but CMake did <span class=\"hljs-operator\">not find <span class=\"hljs-constant\">one.\r\n\r\n  Could <span class=\"hljs-operator\">not find <span class=\"hljs-operator\">a package configuration <span class=\"hljs-built_in\">file provided <span class=\"hljs-keyword\">by \"ArrayFire\" <span class=\"hljs-operator\">with\r\n  <span class=\"hljs-keyword\">any <span class=\"hljs-operator\">of <span class=\"hljs-operator\">the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add <span class=\"hljs-operator\">the installation prefix <span class=\"hljs-operator\">of \"ArrayFire\" <span class=\"hljs-built_in\">to CMAKE_PREFIX_PATH <span class=\"hljs-operator\">or <span class=\"hljs-built_in\">set\r\n  \"ArrayFire_DIR\" <span class=\"hljs-built_in\">to <span class=\"hljs-operator\">a <span class=\"hljs-built_in\">directory containing <span class=\"hljs-constant\">one <span class=\"hljs-operator\">of <span class=\"hljs-operator\">the above <span class=\"hljs-built_in\">files.  If\r\n  \"ArrayFire\" provides <span class=\"hljs-operator\">a separate development package <span class=\"hljs-operator\">or SDK, be sure <span class=\"hljs-keyword\">it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:41:12','2015-08-08 20:41:12','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8465,18528,'2015-08-08 20:42:03','2015-08-08 20:42:03','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION <span class=\"hljs-number\">3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire<span class=\"hljs-attribute\">\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire<span class=\"hljs-attribute\">\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire<span class=\"hljs-attribute\">\'s OpenCL library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:<span class=\"hljs-number\">5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake <span class=\"hljs-built_in\">to find a package configuration <span class=\"hljs-built_in\">file provided by\r\n  \"ArrayFire\", but CMake did not find <span class=\"hljs-constant\">one.\r\n\r\n  Could not find a package configuration <span class=\"hljs-built_in\">file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" <span class=\"hljs-built_in\">to CMAKE_PREFIX_PATH or <span class=\"hljs-built_in\">set\r\n  \"ArrayFire_DIR\" <span class=\"hljs-built_in\">to a <span class=\"hljs-built_in\">directory containing <span class=\"hljs-constant\">one of the above <span class=\"hljs-built_in\">files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:42:03','2015-08-08 20:42:03','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8466,18528,'2015-08-08 20:42:44','2015-08-08 20:42:44','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake <span class=\"hljs-built_in\">to find a package configuration <span class=\"hljs-built_in\">file provided by\r\n  \"ArrayFire\", but CMake did not find <span class=\"hljs-constant\">one.\r\n\r\n  Could not find a package configuration <span class=\"hljs-built_in\">file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" <span class=\"hljs-built_in\">to CMAKE_PREFIX_PATH or <span class=\"hljs-built_in\">set\r\n  \"ArrayFire_DIR\" <span class=\"hljs-built_in\">to a <span class=\"hljs-built_in\">directory containing <span class=\"hljs-constant\">one of the above <span class=\"hljs-built_in\">files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:42:44','2015-08-08 20:42:44','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8467,18528,'2015-08-08 20:43:22','2015-08-08 20:43:22','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$&lt;TARGET_OBJECTS:FOO_CORE&gt;</code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $&lt;TARGET_OBJECTS:FOO_CORE&gt;)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:43:22','2015-08-08 20:43:22','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8468,18528,'2015-08-08 20:54:04','2015-08-08 20:54:04','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Lets say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$<TARGET_OBJECTS:FOO_CORE></code> argument uses the compiled objects to create the <code>fooEXE</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a f actor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-08 20:54:04','2015-08-08 20:54:04','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8470,18528,'2015-08-10 13:39:10','2015-08-10 13:39:10','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:39:10','2015-08-10 13:39:10','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8471,18528,'2015-08-10 13:41:30','2015-08-10 13:41:30','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:41:30','2015-08-10 13:41:30','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8472,18528,'2015-08-10 13:42:27','2015-08-10 13:42:27','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre><code>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of the CPU ArrayFire library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of the CUDA ArrayFire library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of OpenCL ArrayFire library, if found\r\n</code></pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:42:27','2015-08-10 13:42:27','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8473,18528,'2015-08-10 13:43:30','2015-08-10 13:43:30','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre>ArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:43:30','2015-08-10 13:43:30','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8474,18528,'2015-08-10 13:44:28','2015-08-10 13:44:28','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre>\r\n<font face=\"console\" color=\"black\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</font>\r\n</pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:44:28','2015-08-10 13:44:28','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8475,18528,'2015-08-10 13:45:01','2015-08-10 13:45:01','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<div>\r\n<font face=\"console\" color=\"black\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</font>\r\n</div>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:45:01','2015-08-10 13:45:01','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8476,18528,'2015-08-10 13:45:55','2015-08-10 13:45:55','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<code>\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</code>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:45:55','2015-08-10 13:45:55','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8477,18528,'2015-08-10 13:46:30','2015-08-10 13:46:30','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre>\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:46:30','2015-08-10 13:46:30','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8478,18528,'2015-08-10 13:48:19','2015-08-10 13:48:19','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<samp>\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</samp>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:48:19','2015-08-10 13:48:19','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8479,18528,'2015-08-10 13:49:19','2015-08-10 13:49:19','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<samp style=\"font: Monospace;>\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</samp>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:49:19','2015-08-10 13:49:19','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8480,18528,'2015-08-10 13:49:47','2015-08-10 13:49:47','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<samp style=\"font: Monospace;\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</samp>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:49:47','2015-08-10 13:49:47','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8481,18528,'2015-08-10 13:50:18','2015-08-10 13:50:18','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<samp style=\"font: Monospace; font-size: 75%\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</samp>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:50:18','2015-08-10 13:50:18','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8482,18528,'2015-08-10 13:50:39','2015-08-10 13:50:39','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<pre style=\"font: Monospace; font-size: 75%\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</pre>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:50:39','2015-08-10 13:50:39','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8483,18528,'2015-08-10 13:51:04','2015-08-10 13:51:04','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n<samp style=\"font: Monospace; font-size: 75%\">\r\nArrayFire_CPU_FOUND        - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES    - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND       - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES   - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND     - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES - Location of ArrayFire\'s OpenCL library, if found\r\n</samp>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 13:51:04','2015-08-10 13:51:04','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8485,18528,'2015-08-10 14:02:11','2015-08-10 14:02:11','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n\r\n<li><code>ArrayFire_CPU_FOUND</code> - True of the ArrayFire CPU library has been found.</li>\r\n<li><code>ArrayFire_CPU_LIBRARIES</code> - Location of ArrayFire\'s CPU library, if found.</li>\r\n<li><code>ArrayFire_CUDA_FOUND</code> - True of the ArrayFire CUDA library has been found.</li>\r\n<li><code>ArrayFire_CUDA_LIBRARIES</code> - Location of ArrayFire\'s CUDA library, if found.</li>\r\n<li><code>ArrayFire_OpenCL_FOUND</code> - True of the ArrayFire OpenCL library has been found.</li>\r\n<li><code>ArrayFire_OpenCL_LIBRARIES</code> - Location of ArrayFire\'s OpenCL library, if found.</li>\r\n</ul>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-10 14:02:11','2015-08-10 14:02:11','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8487,17794,'2015-08-10 15:00:04','2015-08-10 15:00:04','I have heard many complaints about the verbosity of the OpenCL API. This claim in not unwarranted.\r\n\r\nThe verbosity is due to the low level nature of OpenCL. It is written in the C programming language; the <a href=\"http://joelonsoftware.com/articles/CollegeAdvice.html\">lingua franca</a> of programming languages. While this allows you to run an OpenCL program on virtually any platform, it has some disadvantages.\r\n\r\nIn a typical OpenCL program must:\r\n<ol>\r\n	<li>Query for the platform</li>\r\n	<li>Get the device IDs from the platform</li>\r\n	<li>Create a context from a set of device IDs</li>\r\n	<li>Create a command queue from the context</li>\r\n	<li>Create buffer objects for your data</li>\r\n	<li>Transfer the data to the buffer</li>\r\n	<li>Create and build a program from source</li>\r\n	<li>Extract the kernels</li>\r\n	<li>Launch the kernels</li>\r\n	<li>Transfer the data to the host</li>\r\n</ol>\r\nWow that was longer than I thought it would be. As you can imagine this can be a daunting task for anyone who is not familiar with the OpenCL API.\r\n\r\nFor kicks and giggles I decided to create the smallest OpenCL program with a focus on simplicity and readability. I am going to make use of the excellent <a title=\"OpenCL C++ header\" href=\"http://www.khronos.org/registry/cl/api/1.2/cl.hpp\" target=\"_blank\">C++ API</a> from the <a title=\"Khronos Website\" href=\"http://www.khronos.org\">Khronos</a> website. Technically you can create a program that transfers to and from the device but I wanted to make something less trivial. Here are my requirements for the program:\r\n<ul>\r\n	<li>Transfer data from host to device</li>\r\n	<li>Perform an addition on two vectors and store it in a third</li>\r\n	<li>Return the data to the host</li>\r\n	<li>Print the results</li>\r\n</ul>\r\nHere is my attempt:\r\n<pre>\r\n#define __CL_ENABLE_EXCEPTIONS\r\n#include \"cl.hpp\"\r\n#include <vector>\r\n#include <iostream>\r\n#include <iterator>\r\n#include <algorithm>\r\n\r\nusing namespace cl;\r\nusing namespace std;\r\n\r\nint main(int argc, char* argv[]) {\r\n    Context(CL_DEVICE_TYPE_DEFAULT);\r\n    static const unsigned elements = 1000;\r\n    vector<float> data(elements, 5);\r\n    Buffer a(begin(data), end(data), true, false);\r\n    Buffer b(begin(data), end(data), true, false);\r\n    Buffer c(CL_MEM_READ_WRITE, elements * sizeof(float));\r\n\r\n    Program addProg(R\"d(\r\n        kernel\r\n        void add(   global const float * restrict const a,\r\n                    global const float * restrict const b,\r\n                    global       float * restrict const c) {\r\n            unsigned idx = get_global_id(0);\r\n            c[idx] = a[idx] + b[idx];\r\n        }\r\n    )d\", true);\r\n\r\n    auto add = make_kernel<Buffer, Buffer, Buffer>(addProg, \"add\");\r\n    add(EnqueueArgs(elements), a, b, c);\r\n\r\n    vector<float> result(elements);\r\n    cl::copy(c, begin(result), end(result));\r\n\r\n    std::copy(begin(result), end(result), ostream_iterator<float>(cout, \", \"));\r\n}\r\n</pre>\r\n\r\nNot bad eh? The biggest savings were realized by making use of the default platform, context, command queue objects in the C++ API. I also took advantage of a few C++11 features including <a href=\"http://en.cppreference.com/w/cpp/language/string_literal\">string literals</a>, and auto. This code was tested on OSX using the clang++ compiler. It should be able to run on Visual Studio 2013 and GCC with little or no changes.\r\n\r\nLets dive into the code. A default context can be created by passing <code>CL_DEVICE_TYPE_DEFAULT</code> to the <code>cl::Context</code> function. This allows you to call several OpenCL functions without specifying a context. In many cases managing a context is not necessary and adds unnecessary overhead to the code.\r\n\r\nI am also taking advantage of the special <code>Buffer</code> constructors in the C++ API which take iterators as inputs. This allows you to allocate the correct amount of memory and transfer the data with one call.\r\n\r\nI especially like the <code>make_kernel</code> function in the C++ API. It is a function which creates a functor(an object which overloads the parenthesis operator). Lets take a look at how it is used.\r\n<pre>\r\n    auto add = make_kernel<Buffer, Buffer, Buffer>(addProg, \"add\");\r\n    add(EnqueueArgs(elements), a, b, c);\r\n</pre>\r\n<code>make_kernel</code> is a template function which takes the program object and the name of the kernel as arguments. The template parameters are the type of the input parameters of the kernel. This function returns a functor which takes an <code>EnqueueArgs</code> object as well as three <code>Buffer</code> objects. The <code>EnqueueArgs</code> object can be used to set the launch configuration of the kernel. In this case I took advantage of the default command queue but that can also be set using the <code>EnqueueArgs</code> object.\r\n\r\nThe <code>copy</code> command can be used to transfer the data to and from the device. In this case it transfers the data from the <code>c</code> buffer into the <code>result</code> vector.\r\n\r\nThe C++ OpenCL API provides numerous abstractions over the C counterpart. It is also easy to mix the C and C++ interface in the same program. I have yet to find a functionality which is missing from the C++ API. I would encourage everyone to check out the <a href=\"http://www.khronos.org/registry/cl/specs/opencl-cplusplus-1.2.pdf\">C++ Wrapper API</a> for OpenCL.','Quest for the Smallest OpenCL Program','','inherit','open','closed','','6219-revision-v1','','','2015-08-10 15:00:04','2015-08-10 15:00:04','',6219,'http://sandbox.arrayfire.com/6219-revision-v1/',0,'revision','',0),(8489,18528,'2015-10-20 21:52:30','2015-10-20 21:52:30','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n\r\n<li><code>ArrayFire_CPU_FOUND</code> - True of the ArrayFire CPU library has been found.</li>\r\n<li><code>ArrayFire_CPU_LIBRARIES</code> - Location of ArrayFire\'s CPU library, if found.</li>\r\n<li><code>ArrayFire_CUDA_FOUND</code> - True of the ArrayFire CUDA library has been found.</li>\r\n<li><code>ArrayFire_CUDA_LIBRARIES</code> - Location of ArrayFire\'s CUDA library, if found.</li>\r\n<li><code>ArrayFire_OpenCL_FOUND</code> - True of the ArrayFire OpenCL library has been found.</li>\r\n<li><code>ArrayFire_OpenCL_LIBRARIES</code> - Location of ArrayFire\'s OpenCL library, if found.</li>\r\n</ul>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-autosave-v1','','','2015-10-20 21:52:30','2015-10-20 21:52:30','',8461,'http://sandbox.arrayfire.com/8461-autosave-v1/',0,'revision','',0),(8490,18528,'2015-08-11 13:20:21','2015-08-11 13:20:21','<h3>Introduction</h3>\r\nIn the last week there were a few questions about how to use ArrayFire with CMake on Linux on the <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire Google Groups page</a>. Although we have some quick notes about this <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">in the documentation</a> I thought it would be fun to provide a fully worked example that demonstrates a cool CMake trick to reduce compilation time by a factor of three when linking against multiple backends. At the bottom of this post is a link to a GitHub repository containing a minimal CMake project setup which links a program against ArrayFire\'s CPU, OpenCL, and CUDA backends.\r\n\r\n<!--more-->\r\n\r\nThe instructions below will work on Linux, OSX, and Windows; however, you will need to use <a href=\"http://www.cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html\">CMake generators</a> if you want to use XCode or Visual Studio to compile your code. For Visual Studio specifically, we suggest you <a href=\"http://sandbox.arrayfire.com/docs/using_on_windows.htm\">follow the documentation</a> to set up Visual Studio projects rather than using CMake generators because it is a much more straightforward process.\r\n<h3>Prerequisites</h3>\r\nForemost, make sure that you have both a C++11 compatible compiler and CMake 3.0 (or later) installed on your system. Please <a href=\"http://sandbox.arrayfire.com/docs/using_on_linux.htm\">see the documentation</a> for specific commands for Fedora, Debian, Ubuntu, and a special requirement for the Tegra TK1. Next, ensure that you have <a href=\"http://sandbox.arrayfire.com/download\">downloaded</a> (or <a href=\"https://github.com/arrayfire/arrayfire\">compiled ArrayFire from source</a>) and installed it to your system. Pay close attention to the installation path as this <em>may</em> need to be manually specified at a later stage.\r\n<h3>Creating a project</h3>\r\nSet up a directory as you would any other project. Let\'s say we have two sources files, <code>fooA.cpp</code> and <code>fooB.cpp </code>which we wish to compile into an executable called <code>fooExe</code> and link against ArrayFire. In the top level folder of your project create a file called <code>CMakeLists.txt</code> and fill it with the following contents:\r\n<pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.0)\r\nPROJECT(foo)\r\nFIND_PACKAGE(ArrayFire REQUIRED)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\nADD_EXECUTABLE(fooExe fooA.cpp fooB.cpp)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FIND_PACKAGE</code> command will attempt to find the ArrayFire library using ArrayFire’s pre-built <code>ArrayFireConfigure.cmake</code> script located in the <code>share/ArrayFire/cmake</code> sub-folder of the ArrayFire installation root. The word <code>REQUIRED</code> will cause CMake to fail during the setup stage if ArrayFire is not found. The <code>ADD_EXECUTABLE</code> command specifies that we wish to create an executable called <code>fooExe</code> which will be composed of the <code>fooA.cpp</code> and <code>fooB.cpp</code> source files. Next, the <code>TARGET_LINK_LIBRARIES</code> command instructs CMake to link the <code>fooExe</code> program with the most powerful ArrayFire backend library (typically CUDA). If you wish to link against a different backend, the <code>ArrayFireConfigure.cmake</code> script also provides the following variables for use:\r\n\r\n<li><code>ArrayFire_CPU_FOUND</code> - True of the ArrayFire CPU library has been found.</li>\r\n<li><code>ArrayFire_CPU_LIBRARIES</code> - Location of ArrayFire\'s CPU library, if found.</li>\r\n<li><code>ArrayFire_CUDA_FOUND</code> - True of the ArrayFire CUDA library has been found.</li>\r\n<li><code>ArrayFire_CUDA_LIBRARIES</code> - Location of ArrayFire\'s CUDA library, if found.</li>\r\n<li><code>ArrayFire_OpenCL_FOUND</code> - True of the ArrayFire OpenCL library has been found.</li>\r\n<li><code>ArrayFire_OpenCL_LIBRARIES</code> - Location of ArrayFire\'s OpenCL library, if found.</li>\r\n</ul>\r\nSee the <a href=\"http://www.cmake.org/cmake/help/v3.3/\">CMake documentation</a> for inquires about the other portions of the file.\r\n\r\nNow, to build the project we execute the following commands:\r\n<pre><code>cmake .\r\nmake\r\n</code></pre>\r\nThe <code>cmake</code> command instructs CMake to parse the current directory’s <code>CMakeLists.txt</code> file and generate the necessary files for compiling the program. If the ArrayFire library is not found, you may get an error like the following:\r\n<pre><code>CMake Error at src/CMakeLists.txt:5 (FIND_PACKAGE):\r\n  By not providing \"FindArrayFire.cmake\" in CMAKE_MODULE_PATH this project\r\n  has asked CMake to find a package configuration file provided by\r\n  \"ArrayFire\", but CMake did not find one.\r\n\r\n  Could not find a package configuration file provided by \"ArrayFire\" with\r\n  any of the following names:\r\n\r\n    ArrayFireConfig.cmake\r\n    arrayfire-config.cmake\r\n\r\n  Add the installation prefix of \"ArrayFire\" to CMAKE_PREFIX_PATH or set\r\n  \"ArrayFire_DIR\" to a directory containing one of the above files.  If\r\n  \"ArrayFire\" provides a separate development package or SDK, be sure it has\r\n  been installed.\r\n</code></pre>\r\nIn this case you need to specify the full path to the folder which contains the <code>ArrayFireConfigure.cmake</code> script (found in the <code>share/ArrayFire/cmake</code> sub-directory of the installation folder). For example, if ArrayFire were installed to <code>/opt</code> this <code>cmake</code> command above would be replaced with the following:\r\n\r\n<code>cmake -DArrayFire_DIR=/opt/share/ArrayFire/cmake .</code>\r\n\r\nIf all goes well, then CMake will generate the necessary files and the compilation will be successful and you will have a project running with ArrayFire in only a few lines of CMake code!\r\n<h3>Reduce compilation time when linking against multiple backends</h3>\r\nIf you are building a project that will link against multiple ArrayFire backends, here is a pretty awesome trick to reduce compilation times significantly. We will take advantage of <a href=\"http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library\">CMake Object Libraries</a> to compile source code that is <em>common to all backends</em> into object files and then link them together with a <em>specific</em> ArrayFire backend. Here is a quick demonstration of this in action in a CMakeLists.txt file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe $)\r\nTARGET_LINK_LIBRARIES(fooExe ${ArrayFire_LIBRARIES} )\r\n</code></pre>\r\nThe <code>FILE</code> operation isn’t suggested by the CMake folks, but it makes getting all of the source files in a directory very quick. The <code>ADD_LIBRARY</code> command with the optional <code>OBJECT</code> argument creates a library of object files called <code>FOO_CORE</code>. Lastly, the <code>ADD_EXECUTABLE</code> command with the <code>$</code> argument uses the compiled objects to create the <code>fooExe</code> executable.\r\n\r\nThis looks very similar to what we did before, but because the source files are pre-compiled, we can create several executables that link against different ArrayFire backends without re-compiling the source files. Consider the following <code>CMakeLists.txt</code> file:\r\n<pre><code>...\r\nFILE(GLOB SOURCE \"*.cpp\")\r\nADD_LIBRARY(FOO_CORE OBJECT ${SOURCE})\r\nADD_EXECUTABLE(fooExe-cuda $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-cuda ${ArrayFire_CUDA_LIBRARIES} )\r\nADD_EXECUTABLE(fooExe-opencl $<TARGET_OBJECTS:FOO_CORE>)\r\nTARGET_LINK_LIBRARIES(fooExe-opencl ${ArrayFire_OpenCL_LIBRARIES} )\r\n</code></pre>\r\nHere we create two executables, <code>fooExe-cuda</code> and <code>fooExe-opencl</code>, but only compile the <code>fooA.cpp</code> and <code>fooB.cpp</code> files once! If you were to link against all three backends, like the <a href=\"https://github.com/bkloppenborg/arrayfire-benchmark\">ArrayFire benchmark suite</a> does, this simple trick could reduce your compilation times by about a factor of three!\r\n<h3>A fully worked example</h3>\r\nPlease see my <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Project Example</a> for a fully worked example that efficiently compiles code and links it with all three of ArrayFire\'s backends.','Building an ArrayFire program with CMake','','inherit','open','closed','','8461-revision-v1','','','2015-08-11 13:20:21','2015-08-11 13:20:21','',8461,'http://sandbox.arrayfire.com/8461-revision-v1/',0,'revision','',0),(8492,18528,'2015-08-20 13:24:53','2015-08-20 13:24:53','Under Windows and Mac the Intel GPU drivers include OpenCL support; however, on Linux OpenCL on Intel GPUs is implemented through an open source project called <a href=\"http://www.freedesktop.org/wiki/Software/Beignet/\">Beignet</a> (pronnounced like \"ben-yay\", a type of <a href=\"http://en.wikipedia.org/wiki/Beignet\">French pastry</a> akin to a what we would call a \"fritter\" in English). Below I have written a step-by-step guide on how you can get Beignet running on an Ubuntu 14.10 system which has an Intel 3rd, 4th, or 5th <a href=\"http://ark.intel.com/\">generation Intel processor</a>. Instructions for other variants of Linux will be similar, except for the commands to install the prerequisite packages.\r\n\r\nThere are several little caveats which need to be discussed up front. Foremost, the Beignet project supports the following hardware:\r\n<ul>\r\n	<li>3rd Generation Intel Core Processors</li>\r\n	<li>Intel “Bay Trail” platforms with Intel HD Graphics</li>\r\n	<li>4th Generation Intel Core Processors (requires a kernel patch be applied for shared memory!)</li>\r\n	<li>5th Generation Intel Core Processors \"Broadwell\".</li>\r\n</ul>\r\nThere are also a few noteworthy issues of which you should be aware:\r\n<ul>\r\n	<li>If your computer is running a Linux kernel in the 3.15 or 3.16 branch, you will need to disable some register whitelist functionality every time you reboot your system. This can be accomplished by running <code>echo 0 &gt; /sys/module/i915/parameters/enable_cmd_parser</code> as root.</li>\r\n	<li>4th Generation Intel Processors (i.e. i3/5/7-4xxx) require a kernel patch for shared/local memory to function.</li>\r\n	<li>There is no double precision support</li>\r\n	<li>OpenGL-OpenCL interop via <code>cl_khr_gl_sharing</code> is not supported</li>\r\n</ul>\r\nThere are additional release notes that can be found on the <a href=\"http://www.freedesktop.org/wiki/Software/Beignet/\">Beignet</a> project page.\r\n<h3>Installing prerequisites</h3>\r\n<pre><code>sudo apt-get install build-essential g++ cmake \r\nsudo apt-get install clang libclang-3.5-dev libclang-dev libclang1\r\nsudo apt-get install ocl-icd-opencl-dev ocl-icd-libopencl1</code></pre>\r\nNote, if you are on a Ubuntu 14.04 system, you should install <code>libclang-3.4-dev</code> instead, then run <code>update-alternatives</code> to point <code>llvm-link</code> and <code>llvm-as</code> to the correct version. The latter can be accomplished using the following commands:\r\n<pre><code>sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-3.4 34\r\nsudo update-alternatives --install /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.4 34  \r\n</code></pre>\r\nIf you want to use the standard OpenCL ICD loader, you will also need to install these packages:\r\n<pre><code>sudo apt-get install opencl-headers ocl-icd-dev ocl-icd-libopencl1    \r\n</code></pre>\r\nI would also recomment you install the <code>clinfo</code> program so that you can verify that your installation is successful:\r\n<pre><code>sudo apt-get install clinfo    \r\n</code></pre>\r\n<h3>Check out and compile Beignet</h3>\r\n<pre><code>git clone git://anongit.freedesktop.org/beignet\r\ncd beignet\r\ngit checkout Release_v1.0.0\r\nmkdir build\r\ncd build\r\ncmake ..   \r\n</code></pre>\r\nDuring the CMake stage, ensure that the OCL ICD header file is installed, otherwise the library will not create an installable client driver. If everything went fine, go ahead and compile the source using\r\n<pre><code>make    \r\n</code></pre>\r\n(Note, you can do make -jN with N &gt; 1 to do a parallel build.)\r\nNext we verify that Beignet is functioning correctly on your hardware by running unit tests. These can be found in the <code>utest</code> folder. The unit tests require some enviornmental variables be set prior to invocation:\r\n<pre><code>cd utests\r\ncat setenv.sh\r\n[copy all of the export commands, run them in your shell]\r\n./utest_run   \r\n</code></pre>\r\nIf a significant fraction of the unit tests fail and you have a 3.15 or 3.16 kernel, you need to disable register whitelisting using a command similar to the following:\r\n<pre><code>sudo su\r\necho 0 > /sys/module/i915/parameters/enable_cmd_parser\r\nexit    \r\n</code></pre>\r\nand try re-running the tests. Please note that this change is not permanent and you will need to re-run it if you reboot your system. Alternatively, you could add this command to a startup script. The Beignet release notes mention there is a kernel patch to fix this issue which you could backport if you so desired.\r\n\r\nIf most of the tests pass, but those that involve local memory (~20-30 of the tests) fail, you will need to apply the <a href=\"#kernel-patch\">kernel patch</a> listed below.\r\n\r\nIf all was well, install Beignet to your system:\r\n<pre><code>sudo make install   \r\n</code></pre>\r\nYou can see a list of installed software in the <code>install_manifest.txt</code> file in the build directory.\r\n<h3>Verify Beignet is installed</h3>\r\nIn a terminal run the <code>clinfo</code> program. You should see something like this:\r\n<pre><code>$ clinfo\r\n...      \r\nPlatform Name:              Intel Gen OCL Driver\r\nNumber of devices:          1\r\nDevice Type:                CL_DEVICE_TYPE_GPU\r\n...\r\nName:                       Intel(R) HD Graphics Haswell GT2 Desktop\r\nVendor:                     Intel\r\nDevice OpenCL C version:    OpenCL C 1.2 beignet 0.9.1\r\nDriver version:             0.9.1\r\nProfile:                    FULL_PROFILE\r\nVersion:                    OpenCL 1.2 beignet 0.9.1\r\nExtensions:                 cl_khr_global_int32_base_atomics \r\n                            cl_khr_global_int32_extended_atomics \r\n                            cl_khr_local_int32_base_atomics \r\n                            cl_khr_local_int32_extended_atomics \r\n                            cl_khr_byte_addressable_store cl_khr_icd   \r\n</code></pre>\r\nTake note that the Intel OpenCL driver is loaded for a GPU device using <code>beignet</code>. This indicates the Installable Client Driver (ICD) is correctly installed. Also note the extensions listed.\r\n<h3>Applying the kernel patch to enable OpenCL shared local memory.</h3>\r\nIf you are using Beignet on a 4th generation Intel processor, you will need to apply a kernel patch to enable shared/local memory. This is a fairly lengthy process that will require at least 70 GB of hard disk space and perhaps an hour of compilation time if the build is executed in parallel.\r\n\r\nIn the next few paragraphs I\'ll walk you through how you can apply the kernel patch. I have based my instructions on the <a href=\"https://help.ubuntu.com/community/Kernel/Compile\">kernel compilation instructions for Ubuntu</a>. Instructions for other variants of Linux will be significantly different.\r\n\r\nInstall prerequisites:\r\n<pre><code>sudo apt-get build-dep linux-image-`uname -r`    \r\n</code></pre>\r\nMake a working directory for the kernel somewhere and download the source\r\n<pre><code>mkdir kernel\r\ncd kernel\r\napt-get source linux-image-`uname -r`    \r\n</code></pre>\r\nNext we see if we can automatically apply the patch. First download the patch:\r\n<pre><code>wget https://01.org/sites/default/files/disable-batchbuffer-security.patch    \r\n</code></pre>\r\nNow <code>cd</code> into the kernel directory:\r\n<pre><code>cd linux-3.16.0    \r\n</code></pre>\r\nCheck some details about the patch\r\n<pre><code>git apply --stat ../disable-batchbuffer-security.patch    \r\n</code></pre>\r\nTry automatically applying the patch:\r\n<pre><code>git apply --check ../disable-batchbuffer-security.patch    \r\n</code></pre>\r\nIf it automatically applies with no errors, just apply it:\r\n<pre><code>git apply ../disable-batchbuffer-security.patch    \r\n</code></pre>\r\nIf it did not work (as was the case on my system), the change is fairly simple. Open the <code>drivers/gpu/drm/i915/i915_gem_execbuffer.c</code> file in an editor:\r\n<pre><code>gedit drivers/gpu/drm/i915/i915_gem_execbuffer.c   \r\n</code></pre>\r\nIn the <code>i915_gem_do_execbuffer</code> function, find the following code:\r\n<pre><code>flags = 0;\r\nif (args-&gt;flags &amp; I915_EXEC_SECURE) {\r\n    if (!file-&gt;is_master || !capable(CAP_SYS_ADMIN))\r\n        return -EPERM;    \r\n</code></pre>\r\nAnd add the line <code>flags |= I915_DISPATCH_SECURE;</code> as follows:\r\n<pre><code>flags = 0;\r\nflags |= I915_DISPATCH_SECURE;\r\nif (args-&gt;flags &amp; I915_EXEC_SECURE) {\r\n    if (!file-&gt;is_master || !capable(CAP_SYS_ADMIN))\r\n        return -EPERM;  \r\n</code></pre>\r\nThis was inserted on line 998 for me. Save the file. Now we need to compile and install the modified kernel.\r\n\r\nNow we build the new kernel. Run the following commands from within the kernel source directory:\r\n<pre><code>fakeroot debian/rules clean\r\nDEB_BUILD_OPTIONS=parallel=8 fakeroot debian/rules binary-headers binary-generic    \r\n</code></pre>\r\nThis will build some Debian packages and place them in the directory <em>above</em> the kernel source root.\r\n\r\nAfter the kernel has compiled, install it:\r\n<pre><code>cd ../ (or go back into the kernel directory)\r\nsudo dpkg -i linux-headers-3.16.0-29-generic_3.16.0-29.54_amd64.deb \r\nsudo dpkg -i linux-image-3.16.0-29-generic_3.16.0-29.54_amd64.deb    \r\n</code></pre>\r\n(you might have to change the numeric kernel version to match what you compiled) Now add the kernel to the boot options:\r\n<pre><code>sudo update-grub\r\nsudo reboot    \r\n</code></pre>\r\nNow go back and re-run the Beignet unit test framework from above. With any luck everything will work fine.','OpenCL on Intel HD / Iris graphics on Linux','','inherit','open','closed','','7739-revision-v1','','','2015-08-20 13:24:53','2015-08-20 13:24:53','',7739,'http://sandbox.arrayfire.com/7739-revision-v1/',0,'revision','',0),(8494,1,'2015-08-27 21:50:22','2015-08-27 21:50:22','','Order &ndash; August 27, 2015 @ 09:50 PM','Ship to: Sandia National Laboratories\r\n1515 Eubank SE\r\nAlbuquerque NM  87123\r\nAttn:  Courtney Black 844-3801','wc-completed','open','closed','order_55df861993b76','order-aug-27-2015-0950-pm','','','2015-08-27 21:50:22','2015-08-27 21:50:22','',0,'http://sandbox.arrayfire.com/?post_type=shop_order&#038;p=8494',0,'shop_order','',4),(8495,17728,'2015-08-31 19:24:32','2015-08-31 19:24:32','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lvvyk\" size=\"regular\" ]Windows, v3.1.0\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.1.0\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.1.0\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.1.0\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-08-31 19:24:32','2015-08-31 19:24:32','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8497,6,'2015-09-14 18:23:10','2015-09-14 18:23:10','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on <b>computer vision</b> and <b>machine learning</b> functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories:</b>\r\n<ul>\r\n	<li><strong>Computer Vision</strong>\r\n<ul>\r\n	<li>SIFT feature descriptor</li>\r\n	<li>Harris corner detector</li>\r\n	<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Machine Learning</strong>\r\n<ul>\r\n	<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n	<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n	<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Other Functions</strong>\r\n<ul>\r\n	<li>Singular Value Decomposition</li>\r\n	<li>Select and Replace</li>\r\n	<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or go to our <a href=\"https://github.com/arrayfire/arrayfire\">GitHub account</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','publish','open','closed','','arrayfire-v3-1-official-release','','','2015-09-14 19:56:57','2015-09-14 19:56:57','',0,'http://sandbox.arrayfire.com/?p=8497',0,'post','',1),(8498,6,'2015-09-08 20:09:33','2015-09-08 20:09:33','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features a significant number of additional Computer Vision and Image Processing functions added to the library. It also includes new support for Array and Data Handling functions. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>Major updates and new features</b>\r\n<ul>\r\n	<li>Major changes to...</li>\r\n	<li></li>\r\n</ul>\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n	<li>Computer Vision</li>\r\n	<li>Image Processing</li>\r\n	<li>Linear Algebra</li>\r\n	<li>Array &amp; Data Handling</li>\r\n	<li>Visualization</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-08 20:09:33','2015-09-08 20:09:33','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8500,6,'2015-09-08 20:38:56','2015-09-08 20:38:56','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features a significant number of additional Computer Vision and Image Processing functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>Major updates and new features</b>\r\n<ul>\r\n	<li>Major changes to...</li>\r\n	<li></li>\r\n</ul>\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n	<li>Computer Vision</li>\r\n	<li>Image Processing</li>\r\n	<li>Linear Algebra</li>\r\n	<li>Array &amp; Data Handling</li>\r\n	<li>Visualization</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-08 20:38:56','2015-09-08 20:38:56','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8502,6,'2015-09-11 22:17:21','2015-09-11 22:17:21','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features a significant number of additional Computer Vision and Image Processing functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n	<li>Computer Vision</li>\r\n	<li>Image Processing</li>\r\n	<li>Linear Algebra</li>\r\n	<li>Array &amp; Data Handling</li>\r\n	<li>Visualization</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:17:21','2015-09-11 22:17:21','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8503,6,'2015-09-11 22:22:56','2015-09-11 22:22:56','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on computer vision and machine learning functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n	<li>Computer Vision</li>\r\n	<li>Image Processing</li>\r\n	<li>Linear Algebra</li>\r\n	<li>Array &amp; Data Handling</li>\r\n	<li>Visualization</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:22:56','2015-09-11 22:22:56','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8504,17728,'2015-09-11 22:39:58','2015-09-11 22:39:58','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on computer vision and machine learning functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<li><b>Computer Vision</b>\r\n<ul>\r\n<li>SIFT feature descriptor</li>\r\n<li>Harris corner detector</li>\r\n<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n<li><b>Machine Learning</b>\r\n<ul>\r\n<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n<li><b>Other Functions</b>\r\n<ul>\r\n<li>Singular Value Decomposition</li>\r\n<li>Select and Replace</li>\r\n<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:39:58','2015-09-11 22:39:58','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8505,17728,'2015-09-11 22:40:40','2015-09-11 22:40:40','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on computer vision and machine learning functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n    <li><b>Computer Vision</b>\r\n    <ul>\r\n        <li>SIFT feature descriptor</li>\r\n        <li>Harris corner detector</li>\r\n        <li>SUSAN corner detector</li>\r\n    </ul>\r\n    </li>\r\n<li><b>Machine Learning</b>\r\n<ul>\r\n<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n<li><b>Other Functions</b>\r\n<ul>\r\n<li>Singular Value Decomposition</li>\r\n<li>Select and Replace</li>\r\n<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:40:40','2015-09-11 22:40:40','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8506,17728,'2015-09-11 22:42:22','2015-09-11 22:42:22','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on computer vision and machine learning functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n\r\n<ul>\r\n\r\n<li><strong>Computer Vision</strong>\r\n<ul>\r\n<li>SIFT feature descriptor</li>\r\n<li>Harris corner detector</li>\r\n<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Machine Learning</strong>\r\n<ul>\r\n<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Other Functions</strong>\r\n<ul>\r\n<li>Singular Value Decomposition</li>\r\n<li>Select and Replace</li>\r\n<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n\r\n</ul>\r\n\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:42:22','2015-09-11 22:42:22','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8507,17728,'2015-09-11 22:42:56','2015-09-11 22:42:56','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on computer vision and machine learning functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n<li><strong>Computer Vision</strong>\r\n<ul>\r\n<li>SIFT feature descriptor</li>\r\n<li>Harris corner detector</li>\r\n<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Machine Learning</strong>\r\n<ul>\r\n<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Other Functions</strong>\r\n<ul>\r\n<li>Singular Value Decomposition</li>\r\n<li>Select and Replace</li>\r\n<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n\r\n</ul>\r\n\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-autosave-v1','','','2015-09-11 22:42:56','2015-09-11 22:42:56','',8497,'http://sandbox.arrayfire.com/8497-autosave-v1/',0,'revision','',0),(8508,17728,'2015-09-11 22:44:02','2015-09-11 22:44:02','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on <b>computer vision</b> and <b>machine learning</b> functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n<li><strong>Computer Vision</strong>\r\n<ul>\r\n<li>SIFT feature descriptor</li>\r\n<li>Harris corner detector</li>\r\n<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Machine Learning</strong>\r\n<ul>\r\n<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n\r\n<li><strong>Other Functions</strong>\r\n<ul>\r\n<li>Singular Value Decomposition</li>\r\n<li>Select and Replace</li>\r\n<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n\r\n</ul>\r\n\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-11 22:44:02','2015-09-11 22:44:02','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8509,17728,'2015-09-13 16:19:47','2015-09-13 16:19:47','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lvvyk\" size=\"regular\" ]Windows, v3.1.1\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.1.1\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.1.1\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.1.1\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-09-13 16:19:47','2015-09-13 16:19:47','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8510,6,'2015-09-14 18:21:29','2015-09-14 18:21:29','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on <b>computer vision</b> and <b>machine learning</b> functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories</b>\r\n<ul>\r\n	<li><strong>Computer Vision</strong>\r\n<ul>\r\n	<li>SIFT feature descriptor</li>\r\n	<li>Harris corner detector</li>\r\n	<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Machine Learning</strong>\r\n<ul>\r\n	<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n	<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n	<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Other Functions</strong>\r\n<ul>\r\n	<li>Singular Value Decomposition</li>\r\n	<li>Select and Replace</li>\r\n	<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-14 18:21:29','2015-09-14 18:21:29','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8511,6,'2015-09-14 18:22:21','2015-09-14 18:22:21','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on <b>computer vision</b> and <b>machine learning</b> functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories:</b>\r\n<ul>\r\n	<li><strong>Computer Vision</strong>\r\n<ul>\r\n	<li>SIFT feature descriptor</li>\r\n	<li>Harris corner detector</li>\r\n	<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Machine Learning</strong>\r\n<ul>\r\n	<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n	<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n	<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Other Functions</strong>\r\n<ul>\r\n	<li>Singular Value Decomposition</li>\r\n	<li>Select and Replace</li>\r\n	<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or GitHub account page to <a href=\"https://github.com/arrayfire/arrayfire\">download</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-14 18:22:21','2015-09-14 18:22:21','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8513,6,'2015-09-14 19:56:57','2015-09-14 19:56:57','Today we are pleased to announce the release of <a href=\"http://sandbox.arrayfire.com/\">ArrayFire v3.1</a>. This new version features new functional support with a focus on <b>computer vision</b> and <b>machine learning</b> functions added to the library, along with new support for Array and Data Handling functions. This release also includes support for CUDA 7.5. A complete list of ArrayFire v3.1 updates and new features can be found in the product <a href=\"http://sandbox.arrayfire.com/docs/releasenotes.htm\">Release Notes</a>.\r\n\r\nWith over 8 years of continuous development, the open source ArrayFire library is the top CUDA and OpenCL software library. ArrayFire supports CUDA-capable GPUs, OpenCL devices, and other accelerators. With its easy-to-use API, this hardware-neutral software library is designed for maximum speed without the hassle of writing time-consuming CUDA and OpenCL device code. With ArrayFire’s library functions, developers can maximize productivity and performance. Each of ArrayFire’s functions has been hand-tuned by CUDA and OpenCL experts.\r\n\r\n<b>New functions added in the following categories:</b>\r\n<ul>\r\n	<li><strong>Computer Vision</strong>\r\n<ul>\r\n	<li>SIFT feature descriptor</li>\r\n	<li>Harris corner detector</li>\r\n	<li>SUSAN corner detector</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Machine Learning</strong>\r\n<ul>\r\n	<li>Image wrap and unwrap (used in Convolutional Networks)</li>\r\n	<li>Real to Complex FFTs (used in Convolutional Networks)</li>\r\n	<li>Nearest Neighbor Search</li>\r\n</ul>\r\n</li>\r\n	<li><strong>Other Functions</strong>\r\n<ul>\r\n	<li>Singular Value Decomposition</li>\r\n	<li>Select and Replace</li>\r\n	<li>Inplace FFTs</li>\r\n</ul>\r\n</li>\r\n</ul>\r\n<b>Availability</b>\r\n\r\nVisit ArrayFire’s website to download <a href=\"http://sandbox.arrayfire.com/download/\">ArrayFire v3.1 Installers</a> or go to our <a href=\"https://github.com/arrayfire/arrayfire\">GitHub account</a> and build the source code. The ArrayFire software library operates under the BSD 3-Clause License which enables unencumbered deployment and portability of ArrayFire for all uses, including commercially.\r\n\r\n<b>Dedicated support and coding services</b>\r\n\r\nArrayFire offers dedicated <a href=\"http://sandbox.arrayfire.com/support/\">support packages</a> for ArrayFire users.\r\n\r\nArrayFire serves many clients through consulting and <a href=\"http://sandbox.arrayfire.com/consulting/\">coding services</a>, algorithm development, porting code, and training courses for developers.','ArrayFire v3.1 Official Release','','inherit','open','closed','','8497-revision-v1','','','2015-09-14 19:56:57','2015-09-14 19:56:57','',8497,'http://sandbox.arrayfire.com/8497-revision-v1/',0,'revision','',0),(8516,17728,'2015-09-27 18:57:53','2015-09-27 18:57:53','','Windows Installer','','publish','open','closed','','windows-installer','','','2018-07-06 00:13:47','2018-07-06 04:13:47','',0,'http://sandbox.arrayfire.com/?page_id=8516',0,'page','',0),(8517,17728,'2015-09-27 18:57:53','2015-09-27 18:57:53','','Windows Installer','','inherit','open','closed','','8516-revision-v1','','','2015-09-27 18:57:53','2015-09-27 18:57:53','',8516,'http://sandbox.arrayfire.com/8516-revision-v1/',0,'revision','',0),(8518,17728,'2015-09-27 19:05:11','2015-09-27 19:05:11','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lvvyk\" size=\"regular\" ]Windows, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.1.2\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.1.2\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-09-27 19:05:11','2015-09-27 19:05:11','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8519,17728,'2015-09-27 19:05:25','2015-09-27 19:05:25','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/windows-installer\" size=\"regular\" ]Windows, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw515\" size=\"regular\" ]Linux, v3.1.2\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/ltx4p\" size=\"regular\" ]Mac OSX, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/l/37882/2015-03-19/lw51f\" size=\"regular\" ]Tegra K1 v3.1.2\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-09-27 19:05:25','2015-09-27 19:05:25','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8520,17728,'2015-09-27 19:07:02','2015-09-27 19:07:02','<del datetime=\"2017-07-04T09:17:16+00:00\">','Linux x86_64 installer','','publish','open','closed','','linux-x86_64-installer','','','2018-07-06 00:12:34','2018-07-06 04:12:34','',0,'http://sandbox.arrayfire.com/?page_id=8520',0,'page','',0),(8521,17728,'2015-09-27 19:07:02','2015-09-27 19:07:02','','Linux x86_64 installer','','inherit','open','closed','','8520-revision-v1','','','2015-09-27 19:07:02','2015-09-27 19:07:02','',8520,'http://sandbox.arrayfire.com/8520-revision-v1/',0,'revision','',0),(8522,17728,'2015-09-27 19:09:13','2015-09-27 19:09:13','','Linux armv7l installer','','publish','open','closed','','linux-armv7l-installer','','','2016-12-22 11:28:38','2016-12-22 16:28:38','',0,'http://sandbox.arrayfire.com/?page_id=8522',0,'page','',0),(8523,17728,'2015-09-27 19:09:13','2015-09-27 19:09:13','','Linux armv7l installer','','inherit','open','closed','','8522-revision-v1','','','2015-09-27 19:09:13','2015-09-27 19:09:13','',8522,'http://sandbox.arrayfire.com/8522-revision-v1/',0,'revision','',0),(8524,17728,'2015-09-27 19:10:36','2015-09-27 19:10:36','','OSX installer','','publish','open','closed','','osx-installer','','','2018-07-11 14:56:27','2018-07-11 18:56:27','',0,'http://sandbox.arrayfire.com/?page_id=8524',0,'page','',0),(8525,17728,'2015-09-27 19:10:36','2015-09-27 19:10:36','','OSX installer','','inherit','open','closed','','8524-revision-v1','','','2015-09-27 19:10:36','2015-09-27 19:10:36','',8524,'http://sandbox.arrayfire.com/8524-revision-v1/',0,'revision','',0),(8526,17728,'2015-09-27 19:12:28','2015-09-27 19:12:28','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/windows-installer\" size=\"regular\" ]Windows, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-x86_64-installer\" size=\"regular\" ]Linux, v3.1.2\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/osx-installer\" size=\"regular\" ]Mac OSX, v3.1.2\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-armv7l-installer\" size=\"regular\" ]Tegra K1 v3.1.2\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-09-27 19:12:28','2015-09-27 19:12:28','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8530,18673,'2015-10-07 19:28:19','0000-00-00 00:00:00','','Particle Filter Localization with ArrayFire','','draft','open','closed','','','','','2015-10-07 19:28:19','2015-10-07 19:28:19','',0,'http://sandbox.arrayfire.com/?p=8530',0,'post','',0),(8531,1,'2015-10-09 19:26:54','2015-10-09 19:26:54','','Order &ndash; October 9, 2015 @ 07:26 PM','PO SAOO3610','wc-completed','open','closed','order_561814f98a20d','order-oct-09-2015-0726-pm','','','2015-10-09 19:26:54','2015-10-09 19:26:54','',0,'http://sandbox.arrayfire.com/?post_type=shop_order&#038;p=8531',0,'shop_order','',4),(8535,11,'2015-10-18 19:11:58','2015-10-18 19:11:58','One of the most powerful aspects of parallel program on integrated GPUs is taking advantage of shared memory and caches. The best example of this is sharing common data between the CPU and GPU via. zero-copy buffers. This technique permits your program to avoid the O(N) cost of copying data to/from the GPU. This feature is particularly useful for applications that deal with real-time data streams, like video processing.\n\n<!--more-->\n\nCreating zero copy buffers is not that difficult, but there is one caveat when it comes to using the buffers. First, lets consider how to make zero-copy buffers:\n<h4 id=\"method-1-let-opencl-allocate-memory-and-use-map-unmap-buffers\">Method 1: OpenCL allocation of zero-copy buffers</h4>\nThe first method of allocating zero-copy buffers is quite simple: let OpenCL do it for you. To create a buffer in this fashion simply specify the <code>CL_MEM_ALLOC_HOST_PTR</code> argument to the <code>cl::Buffer</code> constructor (or<code>clCreateBuffer</code> if you are using the C API):\n<pre><code class=\"lang-c++\">// Instruct OpenCL to allocate host memory\n::size_t size = N * sizeof(float)\nBuffer d_results(context, CL_MEM_ALLOC_HOST_PTR, size);\n\n... launch kernels, etc\n</code></pre>\n<h4 id=\"method-2-allocate-aligned-memory-and-use-map-unmap-buffers\">Method 2: Programmer-allocated aligned memory</h4>\nIn situations where you are streaming data or doing DMA between devices, it may be necessary to use aligned memory. In this situation, Intel OpenCL devices require that data be allocated with 4k alignment and be a multiple of 64 bytes (a cache line). At present AMD APUs follow this same alignment convention. Aligned allocation requires calls to OS-specific functions, after the memory is allocated, you can use create a buffer using CL_MEM_USE_HOST_PTR function:\n<pre><code class=\"lang-c++\">::size_t size = N * sizeof(float); // size must be a multiple of 64\n::size_t alignment = 4096;\n// Allocate aligned memory on the host. The particular function is OS-dependent.\n//  memalign(size_t alignment, size_t size) on Linux, release memory with free(...)\n//  _aligned_malloc(size_t size, size_t alignment) on Windows, release with _aligned_free(...)\n//  posix_memalign(void ** ptr, size_t alignment, size_t size) on OSX, release with free(...)\nfloat * h_results = (float*) memalign(alignment, size);\n\n// Create an OpenCL buffer using the host pointer\nBuffer d_results = cl::Buffer(context, CL_MEM_USE_HOST_PTR, size, t_results);\n</code></pre>\n<h4 id=\"accessing-memory\">Accessing zero-copy memory buffers</h4>\nAfter your buffers are created, how do we access the data contained in them? Given method 2, one might think your code could directly access the elements of \"h_results\", but this probably won\'t work. Perhaps the most misunderstood aspect of zero-copy buffers in OpenCL relates to the state of the buffer after being used in a kernel invocation. It is often thought that the memory in the buffers will be updated immediately after the kernel completes; however, the OpenCL specification <strong>does not guarantee this behavior</strong>. Instead, it is up to the programmer to ensure that the buffer is correctly updated prior to accessing the data. To do so, simply use the OpenCL map/unmap buffer commands:\n<pre><code class=\"lang-c++\">// Get exclusive access to the buffer\nfloat * temp = (float*) queue.enqueueMapBuffer(d_results, CL_TRUE, CL_MAP_READ, 0, size);\n\n... use the mapped buffer\n\n// release the buffer back to OpenCL’s control\nqueue.enqueueUnmapMemObject(d_results, temp);</code></pre>\nNote that you must unmap the buffer after use to inform OpenCL that it has been given control over the memory location.\n<h4 id=\"further-reading\">Further reading</h4>\n<a href=\"https://software.intel.com/en-us/articles/getting-the-most-from-opencl-12-how-to-increase-performance-by-minimizing-buffer-copies-on-intel-processor-graphics\">Getting the Most from OpenCL™ 1.2: How to Increase Performance by Minimizing Buffer Copies on Intel® Processor Graphics</a>\n\n<a href=\"http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/opencl-optimization-guide/#50401315_pgfId-503784\">AMD OpenCL Optimization Guide: Mapping and zero-copy buffers</a>\n\n&nbsp;','Using zero-copy buffers on integrated GPUs','','inherit','open','closed','','8125-autosave-v1','','','2015-10-18 19:11:58','2015-10-18 19:11:58','',8125,'http://sandbox.arrayfire.com/8125-autosave-v1/',0,'revision','',0),(8536,11,'2016-10-15 15:55:13','2016-10-15 19:55:13','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fifth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/windows-installer\" size=\"regular\" ]Windows, v3.4.1\r\n(64-bit)[/button][/column][column type=\"one-fifth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-x86_64-installer\" size=\"regular\" ]Linux, v3.4.1\r\n(64-bit)[/button][/column][column type=\"one-fifth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/osx-installer\" size=\"regular\" ]Mac OSX, v3.4.1\r\n(64-bit)[/button][/column][column type=\"one-fifth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://sandbox.arrayfire.com/installer_archive/3.4.1/ArrayFire-v3.4.1_Linux_aarch64.sh\" size=\"regular\" ]Tegra X1 v3.4.1\r\n(64-bit)[/button][/column][column type=\"one-fifth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-armv7l-installer\" size=\"regular\"]Tegra K1 v3.4.1\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-autosave-v1','','','2016-10-15 15:55:13','2016-10-15 19:55:13','',5931,'http://sandbox.arrayfire.com/5931-autosave-v1/',0,'revision','',0),(8537,11,'2015-10-18 19:14:40','2015-10-18 19:14:40','[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nArrayFire Installers\r\n[/custom_headline]\r\n[custom_headline type=\"left\" level=\"h5\"]\r\nEach download contains both CUDA and OpenCL files.\r\n[/custom_headline]\r\n[gap size=\"4%\"]\r\n\r\n[column type=\"one-fourth\"][button  block=\"true\" onclick=\"&lt;!-- Google Code for ArrayFire Download (Windows) Conversion Page\r\nIn your html page, add the snippet and call\r\ngoog_report_conversion when someone clicks on the\r\nchosen link or button. --&gt;\r\n&lt;script type=\"text/javascript\"&gt;\r\n/* &lt;!&amp;#91;CDATA&amp;#91; */\r\ngoog_snippet_vars = function() {\r\nvar w = window;\r\nw.google_conversion_id = 1021026651;\r\nw.google_conversion_label = \"18VJCJjPql4Q28Lu5gM\";\r\nw.google_remarketing_only = false;\r\n}\r\n// DO NOT CHANGE THE CODE BELOW.\r\ngoog_report_conversion = function(url) {\r\ngoog_snippet_vars();\r\nwindow.google_conversion_format = \"3\";\r\nwindow.google_is_call = true;\r\nvar opt = new Object();\r\nopt.onload_callback = function() {\r\nif (typeof(url) != \'undefined\') {\r\nwindow.location = url;\r\n}\r\n}\r\nvar conv_handler = window&amp;#91;\'google_trackConversion\'&amp;#93;;\r\nif (typeof(conv_handler) == \'function\') {\r\nconv_handler(opt);\r\n}\r\n}\r\n/* &amp;#93;&amp;#93;&gt; */\r\n&lt;/script&gt;\r\n&lt;script type=\"text/javascript\"\r\nsrc=\"//www.googleadservices.com/pagead/conversion_async.js\"&gt;\r\n&lt;/script&gt;\" class=\"center-text\" type=\"flat\" shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/windows-installer\" size=\"regular\" ]Windows, v3.1.3\r\n(64-bit)[/button][/column] [column type=\"one-fourth\"][button block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-x86_64-installer\" size=\"regular\" ]Linux, v3.1.3\r\n(64-bit)[/button][/column][column type=\"one-fourth\"][button  block=\"true\" type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/osx-installer\" size=\"regular\" ]Mac OSX, v3.1.3\r\n(64-bit)[/button][/column] [column type=\"one-fourth\" last=\"true\"][button block=\"true\"  type=\"flat\"  shape=\"rounded\" href=\"http://go.sandbox.arrayfire.com/linux-armv7l-installer\" size=\"regular\" ]Tegra K1 v3.1.3\r\n(32-bit)[/button][/column][gap size=\"9%\"]\r\n\r\nCheck out our GitHub repository to <a href=\"https://github.com/arrayfire/arrayfire\">build from the source</a>.\r\n\r\nLooking for an older installer? <a href=\"http://sandbox.arrayfire.com/installer_archive\">Try here</a>.[/content_band]\r\n<p style=\"text-align: left;\">[content_band inner_container=\"true\" no_margin=\"true\" border=\"none\" padding_top=\"10px\" padding_bottom=\"40px\" bg_color=\"#f1f1f1\"][column type=\"one-half\"][gap size=\"8%\"]<img class=\"aligncenter wp-image-5156\" src=\"http://sandbox.arrayfire.com/wp-content/uploads/2014/02/mobile_Exported1-e1395437261846.png\" alt=\"mobile_Exported\" width=\"233\" height=\"311\" />[/column][column type=\"one-half\" last=\"true\"]\r\n[custom_headline type=\"left\" level=\"h2\"]\r\nGreat. What now?\r\n[/custom_headline]</p>\r\n<p style=\"text-align: left;\">[gap size=\"5%\"]</p>\r\n<p style=\"text-align: left;\">Welcome to ArrayFire! You\'ve got an awesome library there—learn more about its features and functions on <a href=\"http://www.sandbox.arrayfire.com/docs/index.htm\">our documentation</a>.</p>\r\n<p style=\"text-align: left;\">In addition to our <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">ArrayFire user group</a> and <a href=\"http://sandbox.arrayfire.com/blog/\">our blog</a>, we offer a plethora of <a href=\"http://sandbox.arrayfire.com/support/\">support options</a> to fit your needs.</p>\r\n<p style=\"text-align: left;\">Got a job that needs closer attention? Hire us! Our engineers are acceleration wizards. Check out our <a href=\"http://sandbox.arrayfire.com/consulting/\">consulting offerings</a>, or set up a free <a href=\"http://meetme.so/arrayfire\">technical consultation</a> with us today![/column]</p>\r\n<p style=\"text-align: left;\">[/content_band]</p>\r\n<p style=\"text-align: center;\"></p>','Download','','inherit','open','closed','','5931-revision-v1','','','2015-10-18 19:14:40','2015-10-18 19:14:40','',5931,'http://sandbox.arrayfire.com/5931-revision-v1/',0,'revision','',0),(8542,18528,'2015-10-21 17:15:05','2015-10-21 17:15:05','Recently one of our interns completed his project ahead of schedule and asked if he could spend some time writing a particle filtering demo in ArrayFire for use at our upcoming trade shows. While learning the ins and outs of ArrayFire he posed several excellent questions which prompted us to start a series of blog posts entitled \"<a href=\"http://sandbox.arrayfire.com/tag/learning-arrayfire-from-scratch/\">Learning ArrayFire from scratch</a>\" that are geared to first-time users of our library.\r\n\r\nIn today\'s post I will cover the installation process on Windows, Mac, and Linux. Our next post will discuss the basics of setting up your first ArrayFire project.\r\n\r\n<!--more-->\r\n\r\nInstalling ArrayFire couldn\'t be easier. We ship installers for Windows, OSX, and Linux. Although you could <a href=\"https://github.com/arrayfire/arrayfire\">build ArrayFire from source</a>, we suggest using our pre-compiled binaries as they include the Intel Math Kernel Library to accelerate linear algebra functions.\r\n\r\nPlease note that although our download page requires a valid login, registration is free and downloading ArrayFire is also free. We request your contact information so that we may notify you of software updates and occasionally collect user feedback about our library.\r\n\r\nIn general, the installation process for ArrayFire looks like this:\r\n<ol type=\"1\">\r\n	<li>Install prerequisites</li>\r\n	<li><a href=\"http://sandbox.arrayfire.com/download/\">Download</a> the ArrayFire installer for your operating system</li>\r\n	<li>Install ArrayFire</li>\r\n	<li>Test the installation</li>\r\n	<li><a href=\"#GettingHelp\">Where to go for help?</a></li>\r\n</ol>\r\nBelow you will find instructions for\r\n<ul>\r\n	<li><a href=\"#Windows\">Windows</a></li>\r\n	<li>Linux including\r\n<ul>\r\n	<li><a href=\"#Debian\">Debian 8</a></li>\r\n	<li><a href=\"#Ubuntu\">Ubuntu 14.10 and later</a></li>\r\n	<li><a href=\"#Fedora\">Fedora 21</a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#OSX\">Mac OSX (.sh and brew)</a></li>\r\n</ul>\r\n<h3><a id=\"Windows\" class=\"anchor\"></a>Windows</h3>\r\nIf you wish to use CUDA or OpenCL please ensure that you have also installed\r\nsupport for these technologies from your video card vendor\'s website.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> and run the ArrayFire installer.\r\nAfter it has completed, you need to add ArrayFire to the path for all users.\r\n<ol>\r\n	<li>Open Advanced System Settings:\r\n* Windows 8: Move the Mouse pointer to the bottom right corner of the screen, Right click, choose System. Then click \"Advanced System Settings\"\r\n* Windows 7: Open the Start Menu and Right Click on \"Computer\". Then choose Properties and click \"Advanced System Settings\"</li>\r\n	<li>In Advanced System Settings window, click on Advanced tab</li>\r\n	<li>Click on Environment Variables, then under System Variables, find PATH, and click on it.</li>\r\n	<li>In edit mode, append <span class=\"lang:default decode:true  crayon-inline \">%AF_PATH%/lib</span> . NOTE: Ensure that there is a semi-colon separating <span class=\"lang:default decode:true  crayon-inline \">%AF_PATH%/lib</span>  from any existing content (e.g. <span class=\"lang:default decode:true  crayon-inline \">EXISTING_PATHS;%AF_PATH%/lib;</span> ) otherwise other software may not function correctly.</li>\r\n</ol>\r\nFinally, verify that the path addition worked correctly. You can do this by running any of the HelloWorld examples located in <span class=\"lang:default decode:true  crayon-inline \">AF_PATH/examples/helloworld/</span>\r\n<h3>Linux</h3>\r\n<h4><a id=\"Debian\" class=\"anchor\"></a>Debian 8</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\napt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev libglew-dev libglewmx-dev libglfw3-dev cmake\r\n\r\n# Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-zone\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h4><a id=\"Fedora\" class=\"anchor\"></a>Fedora 21</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment \"># Install prerequiste packages\r\nyum install freeimage atlas fftw libGLEW libGLEWmx glfw cmake\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-downloads\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h4><a id=\"Ubuntu\" class=\"anchor\"></a>Ubuntu 14.04 and later</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\nsudo apt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev libglew-dev libglewmx-dev libglfw3-dev cmake\r\n</pre>\r\nUbuntu 14.04 will not have the libglfw3-dev package in its repositories. You can either build the library from source (following the <a href=\"https://github.com/arrayfire/arrayfire/wiki/Build-Instructions-for-Linux#general-dependencies\">instructions listed</a>) or install the library from a PPA as follows:\r\n<pre class=\"lang:default decode:true\">sudo apt-add repository ppa:keithw/glfw3\r\nsudo apt-get update\r\nsudo apt-get install glfw3</pre>\r\nAfter this point, the installation should proceed identically to Ubuntu 14.10 or newer.\r\n\r\nIf you are using ArrayFire on the Tegra-K1 also install these packages:\r\n<pre class=\"fragment\">sudo apt-get install libatlas3gf-base libatlas-dev libfftw3-dev liblapacke-dev\r\n</pre>\r\nIf your system has a CUDA GPU, we suggest downloading the latest drivers from NVIDIA in the form of a Debian package and installing using the package manager. At present, CUDA downloads can be found on the <a href=\"https://developer.nvidia.com/cuda-downloads\">NVIDIA CUDA download page</a> Follow NVIDIA\'s instructions for getting CUDA set up.\r\n\r\nIf you wish to use OpenCL, simply install the OpenCL ICD loader along with any drivers required for your hardware.\r\n<pre class=\"fragment\"># Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nFinally, <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer using:\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h3><a id=\"OSX\" class=\"anchor\"></a>Mac OSX</h3>\r\nOn OSX there are several dependencies that are not integrated into the operating system. The ArrayFire installer automatically satisfies these dependencies using <a href=\"http://brew.sh/\">Homebrew</a>. If you don\'t have Homebrew installed on your system, the ArrayFire installer will ask you do to so.\r\n\r\nSimply <a href=\"http://sandbox.arrayfire.com/download\">download</a> the ArrayFire installer and double-click it to carry out the installation.\r\n\r\nArrayFire can also be installed through Homebrew directly using <span class=\"lang:default decode:true  crayon-inline \">brew install arrayfire</span> ; however, it will not include MKL acceleration of linear algebra functions.\r\n<h3><a id=\"Testing\" class=\"anchor\"></a>Testing the installation</h3>\r\nAfter ArrayFire is installed, you can build the example programs as follows:\r\n<pre class=\"fragment\">cp -r /usr/local/share/doc/arrayfire/examples .\r\ncd examples\r\nmkdir build\r\ncd build\r\ncmake ..\r\nmake\r\n</pre>\r\n<h3><a id=\"GettingHelp\" class=\"anchor\"></a>Getting help</h3>\r\n<ul>\r\n	<li>Google Groups: <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">https://groups.google.com/forum/#!forum/arrayfire-users</a></li>\r\n	<li>ArrayFire Services: <a href=\"http://sandbox.arrayfire.com/consulting/\">Consulting</a> | <a href=\"http://sandbox.arrayfire.com/support/\">Support</a> | <a href=\"http://sandbox.arrayfire.com/training/\">Training</a></li>\r\n	<li>ArrayFire Blogs: <a href=\"http://sandbox.arrayfire.com/blog/\">http://sandbox.arrayfire.com/blog/</a></li>\r\n	<li>Email: <a href=\"#\">technical@arrayfire.com</a></li>\r\n</ul>\r\n&nbsp;','Learning ArrayFire from scratch: Installation','','publish','open','closed','','learning-arrayfire-from-scratch-installation','','','2015-11-09 16:24:06','2015-11-09 16:24:06','',0,'http://sandbox.arrayfire.com/?p=8542',0,'post','',9),(8543,18528,'2015-10-20 21:47:52','2015-10-20 21:47:52','Recently one of our interns completed his project ahead of schedule and asked if he could spend some time writing a particle filtering demo in ArrayFire for use at our upcoming trade shows. While learning the ins and outs of ArrayFire he posed several excellent questions which prompted us to start a series of blog posts entitled \"Learning ArrayFire from scratch\" that are geared to first-time users of our library.\r\n\r\nIn today\'s post I will cover the installation process on Windows, Mac, and Linux. Our next post will discuss the basics of setting up your first ArrayFire project.\r\n\r\n<!--more-->\r\n\r\nInstalling ArrayFire couldn\'t be easier. We ship installers for Windows, OSX, and Linux. Although you could <a href=\"https://github.com/arrayfire/arrayfire\">build ArrayFire from source</a>, we suggest using our pre-compiled binaries as they include the Intel Math Kernel Library to accelerate linear algebra functions.\r\n\r\nPlease note that although our download page requires a valid login, registration is free and downloading ArrayFire is also free. We request your contact information so that we may notify you of software updates and occasionally collect user feedback about our library.\r\n\r\nIn general, the installation process for ArrayFire looks like this:\r\n<ol type=\"1\">\r\n	<li>Install prerequisites</li>\r\n	<li><a href=\"http://sandbox.arrayfire.com/download/\">Download</a> the ArrayFire installer for your operating system</li>\r\n	<li>Install ArrayFire</li>\r\n	<li>Test the installation</li>\r\n	<li><a href=\"#GettingHelp\">Where to go for help?</a></li>\r\n</ol>\r\nBelow you will find instructions for\r\n<ul>\r\n	<li><a href=\"#Windows\">Windows</a></li>\r\n	<li>Linux including\r\n<ul>\r\n	<li><a href=\"#Debian\">Debian 8</a></li>\r\n	<li><a href=\"#Ubuntu\">Ubuntu 14.10 and later</a></li>\r\n	<li><a href=\"#Fedora\">Fedora 21</a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#OSX\">Mac OSX (.sh and brew)</a></li>\r\n</ul>\r\n<h1>Windows</h1>\r\nIf you wish to use CUDA or OpenCL please ensure that you have also installed support for these technologies from your video card vendor\'s website. After this, simply <a href=\"http://sandbox.arrayfire.com/download/\">download</a> and run the installer.\r\n<h1>Linux</h1>\r\n<h2><a id=\"Debian\" class=\"anchor\"></a>Debian 8</h2>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\napt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n\r\n# Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-zone\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h2><a id=\"Fedora\" class=\"anchor\"></a>Fedora 21</h2>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Install prerequiste packages\r\nyum install freeimage atlas fftw cmake\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-downloads\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h2><a id=\"Ubuntu\" class=\"anchor\"></a>Ubuntu 14.10 and later</h2>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\nsudo apt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n</pre>\r\nIf you are using ArrayFire on the Tegra-K1 also install these packages:\r\n<pre class=\"fragment\">sudo apt-get install libatlas3gf-base libatlas-dev libfftw3-dev liblapacke-dev\r\n</pre>\r\nIf your system has a CUDA GPU, we suggest downloading the latest drivers from NVIDIA in the form of a Debian package and installing using the package manager. At present, CUDA downloads can be found on the <a href=\"https://developer.nvidia.com/cuda-downloads\">NVIDIA CUDA download page</a> Follow NVIDIA\'s instructions for getting CUDA set up.\r\n\r\nIf you wish to use OpenCL, simply install the OpenCL ICD loader along with any drivers required for your hardware.\r\n<pre class=\"fragment\"># Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nFinally, <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer using:\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h1><a id=\"OSX\" class=\"anchor\"></a>Mac OSX</h1>\r\nOn OSX there are several dependencies that are not integrated into the operating system. The ArrayFire installer automatically satisfies these dependencies using <a href=\"http://brew.sh/\">Homebrew</a>. If you don\'t have Homebrew installed on your system, the ArrayFire installer will ask you do to so.\r\n\r\nSimply <a href=\"http://sandbox.arrayfire.com/download\">download</a> the ArrayFire installer and double-click it to carry out the installation.\r\n\r\nArrayFire can also be installed through Homebrew directly using <code>brew install arrayfire</code>; however, it will not include MKL acceleration of linear algebra functions.\r\n<h2>Testing installation</h2>\r\nAfter ArrayFire is installed, you can build the example programs as follows:\r\n<pre class=\"fragment\">cp -r /usr/local/share/doc/arrayfire/examples .\r\ncd examples\r\nmkdir build\r\ncd build\r\ncmake ..\r\nmake\r\n</pre>\r\n<h2><a id=\"GettingHelp\" class=\"anchor\"></a>Getting help</h2>\r\n<ul>\r\n	<li>Google Groups: <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">https://groups.google.com/forum/#!forum/arrayfire-users</a></li>\r\n	<li>ArrayFire Services: <a href=\"http://sandbox.arrayfire.com/consulting/\">Consulting</a> | <a href=\"http://sandbox.arrayfire.com/support/\">Support</a> | <a href=\"http://sandbox.arrayfire.com/training/\">Training</a></li>\r\n	<li>ArrayFire Blogs: <a href=\"http://sandbox.arrayfire.com/blog/\">http://sandbox.arrayfire.com/blog/</a></li>\r\n	<li>Email: <a href=\"#\">technical@arrayfire.com</a></li>\r\n</ul>\r\n&nbsp;','Learning ArrayFire from scratch: Installation','','inherit','open','closed','','8542-revision-v1','','','2015-10-20 21:47:52','2015-10-20 21:47:52','',8542,'http://sandbox.arrayfire.com/8542-revision-v1/',0,'revision','',0),(8544,18528,'2015-10-20 21:49:46','2015-10-20 21:49:46','Recently one of our interns completed his project ahead of schedule and asked if he could spend some time writing a particle filtering demo in ArrayFire for use at our upcoming trade shows. While learning the ins and outs of ArrayFire he posed several excellent questions which prompted us to start a series of blog posts entitled \"Learning ArrayFire from scratch\" that are geared to first-time users of our library.\r\n\r\nIn today\'s post I will cover the installation process on Windows, Mac, and Linux. Our next post will discuss the basics of setting up your first ArrayFire project.\r\n\r\n<!--more-->\r\n\r\nInstalling ArrayFire couldn\'t be easier. We ship installers for Windows, OSX, and Linux. Although you could <a href=\"https://github.com/arrayfire/arrayfire\">build ArrayFire from source</a>, we suggest using our pre-compiled binaries as they include the Intel Math Kernel Library to accelerate linear algebra functions.\r\n\r\nPlease note that although our download page requires a valid login, registration is free and downloading ArrayFire is also free. We request your contact information so that we may notify you of software updates and occasionally collect user feedback about our library.\r\n\r\nIn general, the installation process for ArrayFire looks like this:\r\n<ol type=\"1\">\r\n	<li>Install prerequisites</li>\r\n	<li><a href=\"http://sandbox.arrayfire.com/download/\">Download</a> the ArrayFire installer for your operating system</li>\r\n	<li>Install ArrayFire</li>\r\n	<li>Test the installation</li>\r\n	<li><a href=\"#GettingHelp\">Where to go for help?</a></li>\r\n</ol>\r\nBelow you will find instructions for\r\n<ul>\r\n	<li><a href=\"#Windows\">Windows</a></li>\r\n	<li>Linux including\r\n<ul>\r\n	<li><a href=\"#Debian\">Debian 8</a></li>\r\n	<li><a href=\"#Ubuntu\">Ubuntu 14.10 and later</a></li>\r\n	<li><a href=\"#Fedora\">Fedora 21</a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#OSX\">Mac OSX (.sh and brew)</a></li>\r\n</ul>\r\n<h2><a id=\"Windows\" class=\"anchor\"></a>Windows</h2>\r\nIf you wish to use CUDA or OpenCL please ensure that you have also installed support for these technologies from your video card vendor\'s website. After this, simply <a href=\"http://sandbox.arrayfire.com/download/\">download</a> and run the installer.\r\n<h2>Linux</h2>\r\n<h3><a id=\"Debian\" class=\"anchor\"></a>Debian 8</h3>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\napt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n\r\n# Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-zone\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h3><a id=\"Fedora\" class=\"anchor\"></a>Fedora 21</h3>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Install prerequiste packages\r\nyum install freeimage atlas fftw cmake\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-downloads\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h3><a id=\"Ubuntu\" class=\"anchor\"></a>Ubuntu 14.10 and later</h3>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\nsudo apt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n</pre>\r\nIf you are using ArrayFire on the Tegra-K1 also install these packages:\r\n<pre class=\"fragment\">sudo apt-get install libatlas3gf-base libatlas-dev libfftw3-dev liblapacke-dev\r\n</pre>\r\nIf your system has a CUDA GPU, we suggest downloading the latest drivers from NVIDIA in the form of a Debian package and installing using the package manager. At present, CUDA downloads can be found on the <a href=\"https://developer.nvidia.com/cuda-downloads\">NVIDIA CUDA download page</a> Follow NVIDIA\'s instructions for getting CUDA set up.\r\n\r\nIf you wish to use OpenCL, simply install the OpenCL ICD loader along with any drivers required for your hardware.\r\n<pre class=\"fragment\"># Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nFinally, <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer using:\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h2><a id=\"OSX\" class=\"anchor\"></a>Mac OSX</h2>\r\nOn OSX there are several dependencies that are not integrated into the operating system. The ArrayFire installer automatically satisfies these dependencies using <a href=\"http://brew.sh/\">Homebrew</a>. If you don\'t have Homebrew installed on your system, the ArrayFire installer will ask you do to so.\r\n\r\nSimply <a href=\"http://sandbox.arrayfire.com/download\">download</a> the ArrayFire installer and double-click it to carry out the installation.\r\n\r\nArrayFire can also be installed through Homebrew directly using <code>brew install arrayfire</code>; however, it will not include MKL acceleration of linear algebra functions.\r\n<h2>Testing installation</h2>\r\nAfter ArrayFire is installed, you can build the example programs as follows:\r\n<pre class=\"fragment\">cp -r /usr/local/share/doc/arrayfire/examples .\r\ncd examples\r\nmkdir build\r\ncd build\r\ncmake ..\r\nmake\r\n</pre>\r\n<h2><a id=\"GettingHelp\" class=\"anchor\"></a>Getting help</h2>\r\n<ul>\r\n	<li>Google Groups: <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">https://groups.google.com/forum/#!forum/arrayfire-users</a></li>\r\n	<li>ArrayFire Services: <a href=\"http://sandbox.arrayfire.com/consulting/\">Consulting</a> | <a href=\"http://sandbox.arrayfire.com/support/\">Support</a> | <a href=\"http://sandbox.arrayfire.com/training/\">Training</a></li>\r\n	<li>ArrayFire Blogs: <a href=\"http://sandbox.arrayfire.com/blog/\">http://sandbox.arrayfire.com/blog/</a></li>\r\n	<li>Email: <a href=\"#\">technical@arrayfire.com</a></li>\r\n</ul>\r\n&nbsp;','Learning ArrayFire from scratch: Installation','','inherit','open','closed','','8542-revision-v1','','','2015-10-20 21:49:46','2015-10-20 21:49:46','',8542,'http://sandbox.arrayfire.com/8542-revision-v1/',0,'revision','',0),(8545,18528,'2015-10-20 21:51:24','2015-10-20 21:51:24','Recently one of our interns completed his project ahead of schedule and asked if he could spend some time writing a particle filtering demo in ArrayFire for use at our upcoming trade shows. While learning the ins and outs of ArrayFire he posed several excellent questions which prompted us to start a series of blog posts entitled \"Learning ArrayFire from scratch\" that are geared to first-time users of our library.\r\n\r\nIn today\'s post I will cover the installation process on Windows, Mac, and Linux. Our next post will discuss the basics of setting up your first ArrayFire project.\r\n\r\n<!--more-->\r\n\r\nInstalling ArrayFire couldn\'t be easier. We ship installers for Windows, OSX, and Linux. Although you could <a href=\"https://github.com/arrayfire/arrayfire\">build ArrayFire from source</a>, we suggest using our pre-compiled binaries as they include the Intel Math Kernel Library to accelerate linear algebra functions.\r\n\r\nPlease note that although our download page requires a valid login, registration is free and downloading ArrayFire is also free. We request your contact information so that we may notify you of software updates and occasionally collect user feedback about our library.\r\n\r\nIn general, the installation process for ArrayFire looks like this:\r\n<ol type=\"1\">\r\n	<li>Install prerequisites</li>\r\n	<li><a href=\"http://sandbox.arrayfire.com/download/\">Download</a> the ArrayFire installer for your operating system</li>\r\n	<li>Install ArrayFire</li>\r\n	<li>Test the installation</li>\r\n	<li><a href=\"#GettingHelp\">Where to go for help?</a></li>\r\n</ol>\r\nBelow you will find instructions for\r\n<ul>\r\n	<li><a href=\"#Windows\">Windows</a></li>\r\n	<li>Linux including\r\n<ul>\r\n	<li><a href=\"#Debian\">Debian 8</a></li>\r\n	<li><a href=\"#Ubuntu\">Ubuntu 14.10 and later</a></li>\r\n	<li><a href=\"#Fedora\">Fedora 21</a></li>\r\n</ul>\r\n</li>\r\n	<li><a href=\"#OSX\">Mac OSX (.sh and brew)</a></li>\r\n</ul>\r\n<h3><a id=\"Windows\" class=\"anchor\"></a>Windows</h3>\r\nIf you wish to use CUDA or OpenCL please ensure that you have also installed support for these technologies from your video card vendor\'s website. After this, simply <a href=\"http://sandbox.arrayfire.com/download/\">download</a> and run the installer.\r\n<h3>Linux</h3>\r\n<h4><a id=\"Debian\" class=\"anchor\"></a>Debian 8</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\napt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n\r\n# Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-zone\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h4><a id=\"Fedora\" class=\"anchor\"></a>Fedora 21</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Install prerequiste packages\r\nyum install freeimage atlas fftw cmake\r\n</pre>\r\nIf you wish to use CUDA, please <a href=\"https://developer.nvidia.com/cuda-downloads\">download the latest version of CUDA</a> and install it on your system.\r\n\r\nNext <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer.\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h4><a id=\"Ubuntu\" class=\"anchor\"></a>Ubuntu 14.10 and later</h4>\r\nFirst install the prerequisite packages:\r\n<pre class=\"fragment\"># Prerequisite packages:\r\nsudo apt-get install libfreeimage-dev libatlas3gf-base libfftw3-dev cmake\r\n</pre>\r\nIf you are using ArrayFire on the Tegra-K1 also install these packages:\r\n<pre class=\"fragment\">sudo apt-get install libatlas3gf-base libatlas-dev libfftw3-dev liblapacke-dev\r\n</pre>\r\nIf your system has a CUDA GPU, we suggest downloading the latest drivers from NVIDIA in the form of a Debian package and installing using the package manager. At present, CUDA downloads can be found on the <a href=\"https://developer.nvidia.com/cuda-downloads\">NVIDIA CUDA download page</a> Follow NVIDIA\'s instructions for getting CUDA set up.\r\n\r\nIf you wish to use OpenCL, simply install the OpenCL ICD loader along with any drivers required for your hardware.\r\n<pre class=\"fragment\"># Enable GPU support (OpenCL):\r\napt-get install ocl-icd-libopencl1\r\n</pre>\r\nFinally, <a href=\"http://sandbox.arrayfire.com/download/\">download</a> ArrayFire. After you have the file, run the installer using:\r\n<pre class=\"fragment\">./arrayfire_*_Linux_x86_64.sh --exclude-subdir --prefix=/usr/local\r\n</pre>\r\n<h3><a id=\"OSX\" class=\"anchor\"></a>Mac OSX</h3>\r\nOn OSX there are several dependencies that are not integrated into the operating system. The ArrayFire installer automatically satisfies these dependencies using <a href=\"http://brew.sh/\">Homebrew</a>. If you don\'t have Homebrew installed on your system, the ArrayFire installer will ask you do to so.\r\n\r\nSimply <a href=\"http://sandbox.arrayfire.com/download\">download</a> the ArrayFire installer and double-click it to carry out the installation.\r\n\r\nArrayFire can also be installed through Homebrew directly using <code>brew install arrayfire</code>; however, it will not include MKL acceleration of linear algebra functions.\r\n<h3><a id=\"Testing\" class=\"anchor\"></a>Testing the installation</h3>\r\nAfter ArrayFire is installed, you can build the example programs as follows:\r\n<pre class=\"fragment\">cp -r /usr/local/share/doc/arrayfire/examples .\r\ncd examples\r\nmkdir build\r\ncd build\r\ncmake ..\r\nmake\r\n</pre>\r\n<h3><a id=\"GettingHelp\" class=\"anchor\"></a>Getting help</h3>\r\n<ul>\r\n	<li>Google Groups: <a href=\"https://groups.google.com/forum/#!forum/arrayfire-users\">https://groups.google.com/forum/#!forum/arrayfire-users</a></li>\r\n	<li>ArrayFire Services: <a href=\"http://sandbox.arrayfire.com/consulting/\">Consulting</a> | <a href=\"http://sandbox.arrayfire.com/support/\">Support</a> | <a href=\"http://sandbox.arrayfire.com/training/\">Training</a></li>\r\n	<li>ArrayFire Blogs: <a href=\"http://sandbox.arrayfire.com/blog/\">http://sandbox.arrayfire.com/blog/</a></li>\r\n	<li>Email: <a href=\"#\">technical@arrayfire.com</a></li>\r\n</ul>\r\n&nbsp;','Learning ArrayFire from scratch: Installation','','inherit','open','closed','','8542-revision-v1','','','2015-10-20 21:51:24','2015-10-20 21:51:24','',8542,'http://sandbox.arrayfire.com/8542-revision-v1/',0,'revision','',0),(8546,18528,'2015-11-06 13:50:15','2015-11-06 13:50:15','<div class=\"header\">\r\n<div class=\"headertitle\">\r\n<div class=\"title\">Continuing our blog series \"<a href=\"http://sandbox.arrayfire.com/tag/learning-arrayfire-from-scratch/\">Learning ArrayFire from scratch</a>\" today we will discuss how to set up an ArrayFire project on Windows using Visual Studio or CMake.</div>\r\n</div>\r\n</div>\r\n<!--more-->\r\n\r\nIf you have not already done so, please make sure you have installed, configured, and tested ArrayFire following the <a class=\"el\" href=\"installing.htm\">installation instructions</a>.\r\n<div class=\"contents\">\r\n<div class=\"textblock\">\r\n<h3>The big picture</h3>\r\nThe ArrayFire Windows installer creates the following:\r\n<pre class=\"lang:default highlight:0 decode:true \">AF_PATH                 Environment variable to point to the installation location.\r\n                        This is normally C:/Program Files/ArrayFire/v*\r\nAF_PATH/include         Header files for ArrayFire (Include Dir)\r\nAF_PATH/lib             All ArrayFire backends libraries, dlls and dependency dlls \r\n                        (Library dir)\r\nAF_PATH/examples        Examples to get started. Some examples also have pre-built \r\n                        exectuables\r\nAF_PATH/cmake           CMake config files for automatic configuration by external \r\n                        projects\r\nAF_PATH/uninstall.exe   Uninstaller\r\nAF_PATH/*               Other miscellenous files including licenses, logos, copyrights</pre>\r\nThe installer also appends <span class=\"lang:default decode:true  crayon-inline \">%AF_PATH%/lib</span>  to the User <span class=\"lang:default decode:true  crayon-inline \">PATH</span>  variable (see the <a class=\"el\" href=\"installing.htm\">installation instructions</a> for further details).\r\n<h4>Dealing with CUDA NVVM DLLs</h4>\r\nWhen using CUDA with ArrayFire you may encounter a linker error indicating the NVVM DLLs are missing. This is because the NVVM DLLs are not part of the standard <span class=\"lang:default decode:true  crayon-inline \">CUDA_PATH\\bin</span>  installation directory that is added to your <span class=\"lang:default decode:true  crayon-inline \">PATH</span>  when the CUDA installer runs. Thus, NVVM will not be found during the linking stage. There are a few ways to deal with this issue:\r\n<ol type=\"1\">\r\n	<li>Copy the DLLs to the executable location. This is, by far, the cleanest solution and we recommend doing this with ArrayFire projects. To do so, create a post-build event to copy the NVVM DLL as discussed below in <a href=\"#s3partA\">Step 3 - Part A</a>.</li>\r\n	<li>Copy <span class=\"lang:default decode:true  crayon-inline\">CUDA_PATH\\nvvm\\bin\\nvvm64_30_0.dll</span>  to <span class=\"lang:default decode:true  crayon-inline \">CUDA_PATH\\bin</span> . This is a one time copy such that the NVVM DLL is now with all the other CUDA dlls and in a directory that is a part of PATH and hence the DLL can be detected automatically.</li>\r\n	<li>Add <span class=\"lang:default decode:true  crayon-inline \">%CUDA_PATH%\\nvvm\\bin</span>  to the system PATH environment variable. This will allow automatic detection by the system and No further copying will be required. ArrayFire does not add this to PATH since the CUDA installer doesn\'t add it to PATH.</li>\r\n</ol>\r\n<h3><a id=\"step1\" class=\"anchor\"></a>Step 1: Running pre-built executables</h3>\r\nThe ArrayFire installer ships with a few pre-built executables with the examples. These should run out of the box when double clicked.\r\n\r\nSome prebuilt examples are:\r\n<ul>\r\n	<li>Helloworld (examples/helloworld)</li>\r\n	<li>BLAS (examples/benchmarks)</li>\r\n	<li>FFT (examples/benchmarks)</li>\r\n	<li>Pi Estimation (examples/benchmarks)</li>\r\n	<li>Conway (Graphics) (examples/graphics)</li>\r\n</ul>\r\nNote: For the CUDA executables, you will need to copy <span class=\"lang:default decode:true  crayon-inline \">CUDA_PATH\\nvvm\\bin\\nvvm64_30_0.dll</span>  to the location of the executables.\r\n<h3><a id=\"step2\" class=\"anchor\"></a>Step 2: Build and Run a Project</h3>\r\n<ol type=\"1\">\r\n	<li>Open Visual Studio 2013. Load the HelloWorld solution which is located at <span class=\"lang:default decode:true  crayon-inline \">AF_PATH/examples/helloworld/helloworld.sln</span> .</li>\r\n	<li>Build the <span class=\"lang:default decode:true  crayon-inline \">helloworld</span>  example. Be sure to, select the platform/configuration of your choice using the platform drop-down (the options are CPU, CUDA, OpenCL, and Unified) and Solution Configuration drop down (options of Release and Debug) menus.</li>\r\n	<li>Run the <span class=\"lang:default decode:true  crayon-inline \">helloworld</span>  example.</li>\r\n</ol>\r\n<h3><a id=\"step3\" class=\"anchor\"></a>Step 3: Using ArrayFire within Visual Studio</h3>\r\nThis is divided into 4 parts:\r\n<ul>\r\n	<li><a href=\"#s3partA\">Part A: Adding ArrayFire to an existing solution (Single Backend)</a></li>\r\n	<li><a href=\"#s3partB\">Part B: Adding ArrayFire CUDA to a new/existing CUDA project</a></li>\r\n	<li><a href=\"#s3partC\">Part C: Project with all ArrayFire backends</a></li>\r\n	<li><a href=\"#s3partD\">Part D: ArrayFire with CMake</a></li>\r\n</ul>\r\n<h4><a id=\"s3partA\" class=\"anchor\"></a>Part A: Adding ArrayFire to an existing solution (Single Backend)</h4>\r\nNote: If you plan on using native CUDA code in the project, use the steps under <a href=\"#s3partB\">Part B</a>.\r\n\r\nAdding a single backend to an existing project is quite simple.\r\n<ol type=\"1\">\r\n	<li>Add <code>\"<span class=\"lang:default decode:true  crayon-inline \">$(AF_PATH)/include;</span> \"</code> to <em>Project Properties -&gt; C/C++ -&gt; General -&gt; Additional Include Directories</em>.</li>\r\n	<li>Add <code>\"<span class=\"lang:default decode:true  crayon-inline \">$(AF_PATH)/lib;</span> \"</code> to <em>Project Properties -&gt; Linker -&gt; General -&gt; Additional Library Directories</em>.</li>\r\n	<li>Add <span class=\"lang:default decode:true  crayon-inline \">afcpu.lib</span>  or <span class=\"lang:default decode:true  crayon-inline \">afcuda.lib</span>  or <span class=\"lang:default decode:true  crayon-inline \">afopencl.lib</span>  to <em>Project Properties -&gt; Linker -&gt; Input -&gt; Additional Dependencies</em>. based on your preferred backend.</li>\r\n	<li>(Optional) You may choose to define <span class=\"lang:default decode:true  crayon-inline \">NOMINMAX, AF_&lt;CPU/CUDA/OPENCL&gt;</span>  and/or <span class=\"lang:default decode:true  crayon-inline \">AF_&lt;DEBUG/RELEASE&gt;</span>  in your projects. This can be added to <em>Project Properties -&gt; C/C++ -&gt; General -&gt; Preprocessor-&gt; Preprocessory definitions</em>.</li>\r\n</ol>\r\nIf you are using the CUDA backend, it is important to ensure that the CUDA NVVM DLLs are copied to the exectuable directory. This can be done by adding a post build event.\r\n\r\nOpen the <em>Project Properties -&gt; Build Events -&gt; Post Build Events</em> dialog and add the following lines to it.\r\n<div class=\"fragment\">\r\n<pre class=\"lang:default decode:true\">echo copy \"$(CUDA_PATH)\\nvvm\\bin\\nvvm64*.dll\" \"$(OutDir)\" \r\necho copy \"$(CUDA_PATH)\\nvvm\\bin\\nvvm64*.dll\" \"$(OutDir)\"</pre>\r\n<h4 class=\"line\"> <a id=\"s3partB\" class=\"anchor\"></a>Part B: Adding ArrayFire CUDA to a new/existing CUDA project</h4>\r\n</div>\r\nIf your project contains custom CUDA code, the instructions are slightly different as it requires using a CUDA NVCC Project:\r\n<ol type=\"1\">\r\n	<li>Create a custom \"CUDA NVCC project\" in Visual Studio</li>\r\n	<li>Add <code>\"<span class=\"lang:default decode:true  crayon-inline \">$(AF_PATH)/include;</span> \"</code> to <em>Project Properties -&gt; CUDA C/C++ -&gt; General -&gt; Additional Include Directories</em>.</li>\r\n	<li>Add <code>\"<span class=\"lang:default decode:true  crayon-inline \">$(AF_PATH)/lib;</span> \"</code> to <em>Project Properties -&gt; Linker -&gt; General -&gt; Additional Library Directories</em>.</li>\r\n	<li>Add <span class=\"lang:default decode:true  crayon-inline \">afcpu.lib</span>  or <span class=\"lang:default decode:true  crayon-inline \">afcuda.lib</span>  or <span class=\"lang:default decode:true  crayon-inline \">afopencl.lib</span>  to <em>Project Properties -&gt; Linker -&gt; Input -&gt; Additional Dependencies</em>. based on your preferred backend.</li>\r\n	<li>(Optional) You may choose to define <span class=\"lang:default decode:true  crayon-inline \">NOMINMAX, AF_CUDA</span>  and/or <span class=\"lang:default decode:true  crayon-inline \">AF_&lt;DEBUG/RELEASE&gt;</span>  in your projects. This can be added to <em>Project Properties -&gt; C/C++ -&gt; General -&gt; Preprocessor-&gt; Preprocessory definitions</em>.</li>\r\n	<li>Pick a solution to handle the NVVM DLLs. We recommend the post build event method used in <a href=\"#s3partA\">Part A</a>.</li>\r\n</ol>\r\n<h4><a id=\"s3partC\" class=\"anchor\"></a>Part C: Project with all ArrayFire backends</h4>\r\nIf you wish to create a project that allows you to use all the ArrayFire backends with ease, the best way to go is to copy the <em>HelloWorld sln/vcxproj/cpp</em> file trio and rename them to suit your project.\r\n\r\nAll the ArrayFire examples are pre-configured for all ArrayFire backends as well as the Unified API. These can be chosen from the Solution/Platform configuration drop down boxes.\r\n\r\nYou can alternately download the template project from <a href=\"https://github.com/arrayfire/arrayfire-project-templates\">ArrayFire Project Templates</a>\r\n<h4><a id=\"s3partD\" class=\"anchor\"></a>Part D: ArrayFire with CMake</h4>\r\n<em>NOTE:</em> The ArrayFire installer sets up CMake file and registry so that it can be found by CMake by simply using the <span class=\"lang:default decode:true  crayon-inline \">Find_PACKAGE(ArrayFire)</span>  command.\r\n\r\nIf you are writing a new ArrayFire project in C/C++ from scratch, we suggest you grab a copy of our <a href=\"https://github.com/arrayfire/arrayfire-project-templates\">CMake Project Example</a>; however, it is useful to read the documentation below in case you need to add ArrayFire to an existing project.\r\n\r\nAs <a href=\"#big-picture\">discussed above</a>, ArrayFire ships with a series of CMake scripts to make finding and using our library easy. The scripts will automatically find all versions of the ArrayFire library and pick the most powerful of the installed backends (typically CUDA).\r\n\r\nFirst create a file called <span class=\"lang:default decode:true  crayon-inline \">CMakeLists.txt</span>  in your project directory:\r\n<pre class=\"fragment\">cd your-project-directory\r\ntouch CMakeLists.txt\r\n</pre>\r\nand populate it with the following code:\r\n<pre class=\"fragment\">FIND_PACKAGE(ArrayFire)\r\nINCLUDE_DIRECTORIES(${ArrayFire_INCLUDE_DIRS})\r\n\r\n... [gather source files, etc.]\r\n\r\n# If you intend to use OpenCL, you need to find it\r\nFIND_PACKAGE(OpenCL)\r\nSET(EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT} ${OpenCL_LIBRARIES})\r\n\r\n# Or if you intend to use CUDA, you need it as well as NVVM:\r\nFIND_PACKAGE(CUDA)\r\nFIND_PACKAGE(NVVM) # this FIND script can be found in the ArrayFire CMake example repository\r\nSET(EXTRA_LIBS ${CMAKE_THREAD_LIBS_INIT} ${CUDA_LIBRARIES} ${NVVM_LIB})\r\n\r\nADD_EXECUTABLE(my_executable [list your source files here])\r\nTARGET_LINK_LIBRARIES(my_executable ${ArrayFire_LIBRARIES} ${EXTRA_LIBS})\r\n</pre>\r\nwhere <span class=\"lang:default decode:true  crayon-inline \">my_executable</span>  is the name of the executable you wish to create. See the <a href=\"https://cmake.org/documentation/\">CMake documentation</a> for more information on how to use CMake. Clearly the above code snippet precludes the use of both CUDA and OpenCL, see the <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Example</a> for an example of how to build executables for both backends from the same CMake script.\r\n\r\nIn the above code listing, the <span class=\"lang:default decode:true  crayon-inline \">FIND_PACKAGE</span>  will find the ArrayFire include files, libraries, and define several variables including:\r\n<pre class=\"fragment\">ArrayFire_INCLUDE_DIRS    - Location of ArrayFire\'s include directory.\r\nArrayFire_LIBRARIES       - Location of ArrayFire\'s libraries.\r\n                            This will default to a GPU backend if one\r\n                            is found\r\nArrayFire_FOUND           - True if ArrayFire has been located\r\n</pre>\r\nIf you wish to use a specific backend, the find script also defines these variables:\r\n<pre class=\"fragment\">ArrayFire_CPU_FOUND         - True of the ArrayFire CPU library has been found.\r\nArrayFire_CPU_LIBRARIES     - Location of ArrayFire\'s CPU library, if found\r\nArrayFire_CUDA_FOUND        - True of the ArrayFire CUDA library has been found.\r\nArrayFire_CUDA_LIBRARIES    - Location of ArrayFire\'s CUDA library, if found\r\nArrayFire_OpenCL_FOUND      - True of the ArrayFire OpenCL library has been found.\r\nArrayFire_OpenCL_LIBRARIES  - Location of ArrayFire\'s OpenCL library, if found\r\nArrayFire_Unified_FOUND     - True of the ArrayFire Unified library has been found.\r\nArrayFire_Unified_LIBRARIES - Location of ArrayFire\'s Unified library, if found\r\n</pre>\r\nTherefore, if you wish to target a specific specific backend, simply replace <span class=\"lang:default decode:true  crayon-inline \">${ArrayFire_LIBRARIES}</span>  with <span class=\"lang:default decode:true  crayon-inline \">${ArrayFire_CPU}</span> ,<span class=\"lang:default decode:true  crayon-inline \"> ${ArrayFire_OPENCL}</span> , <span class=\"lang:default decode:true  crayon-inline \">${ArrayFire_CUDA}</span> , or <span class=\"lang:default decode:true  crayon-inline \">${ArrayFire_Unified}</span>  in the <span class=\"lang:default decode:true  crayon-inline \">TARGET_LINK_LIBRARIES</span>  command above.\r\n\r\nNext we need to instruct CMake to create build instructions and then compile. We suggest using CMake\'s out-of-source build functionality to keep your build and source files cleanly separated. To do this open the CMake GUI.\r\n<ul>\r\n	<li>Under source directory, add the path to your project</li>\r\n	<li>Under build directory, add the path to your project and append /build</li>\r\n	<li>Click configure and choose Visual Studio 2013 Win 64 as the generator.</li>\r\n	<li>If configuration was successful, click generate. This will create a my-project.sln file under build. You can open this in Visual Studio and compile the ALL_BUILD project.</li>\r\n</ul>\r\nThe <a href=\"https://github.com/bkloppenborg/arrayfire-cmake-example\">ArrayFire CMake Example</a> is a CMake project used to demo how ArrayFire can be using with a CMake project.\r\n\r\nNote: The CMake project does not add the post build event to copy the NVVM DLLs in case of CUDA backend. You will need to either copy it manually to the exectuable directory, or pick another solution for it.\r\n\r\n</div>\r\n</div>','Setting up an ArrayFire project on Windows','','publish','open','closed','','setting-up-an-arrayfire-project-on-windows','','','2015-11-06 20:49:45','2015-11-06 20:49:45','',0,'http://sandbox.arrayfire.com/?p=8546',0,'post','',0),(8548,18528,'2015-10-20 21:57:15','2015-10-20 21:57:15','In our previous post we discussed','Learning ArrayFire from scratch: First project on Windows','','inherit','open','closed','','8546-revision-v1','','','2015-10-20 21:57:15','2015-10-20 21:57:15','',8546,'http://sandbox.arrayfire.com/8546-revision-v1/',0,'revision','',0),(8549,18528,'2015-10-20 21:58:54','2015-10-20 21:58:54','Continuing our blog series\r\n\r\n&nbsp;\r\n\r\nIn our previous post we discussed how to <a href=\"http://setting-up-an-arrayfire-project-on-windows\">install ArrayFire on Windows, Mac, and Linux</a>. In this post, we will','Setting up an ArrayFire project on Windows','','inherit','open','closed','','8546-revision-v1','','','2015-10-20 21:58:54','2015-10-20 21:58:54','',8546,'http://sandbox.arrayfire.com/8546-revision-v1/',0,'revision','',0),(8551,18528,'2015-10-20 22:02:25','2015-10-20 22:02:25','Continuing our blog series \"Learning ArrayFire from scratch\" today we will discuss how to set up an ArrayFire project on Windows using Microsoft Visual Studio.','Setting up an ArrayFire project on Windows','','inherit','open','closed','','8546-revision-v1','','','2015-10-20 22:02:25','2015-10-20 22:02:25','',8546,'http://sandbox.arrayfire.com/8546-revision-v1/',0,'revision','',0),(8552,18528,'2015-10-20 22:04:07','2015-10-20 22:04:07','Continuing our blog series \"<a href=\"http://sandbox.arrayfire.com/tag/learning-arrayfire-from-scratch/\">Learning ArrayFire from scratch</a>\" today we will discuss how to set up an ArrayFire project on Windows using Microsoft Visual Studio.','Setting up an ArrayFire project on Windows','','inherit','open','closed','','8546-revision-v1','','','2015-10-20 22:04:07','2015-10-20 22:04:07','',8546,'http://sandbox.arrayfire.com/8546-revision-v1/',0,'revision','',0),