ArrayFire uses Just In Time compilation to combine many light weight functions into a single kernel launch. This along with our easy-to-use API allows users to not only quickly prototype their algorithms, but also get the best out of the underlying hardware. This feature has been a favorite among our users in the domains of finance and scientific simulation. That said, ArrayFire v3.3 and earlier had a few limitations. Namely: Multiple outputs with inter-dependent variables were generating multiple kernels. The number of operations per kernel was fairly limited by default. In the latest release of ArrayFire, we addressed these issues to get some pretty impressive numbers. In the rest of the post, we demonstrate the performance improvements using our BlackScholes ...
There are a number of additions and updates to image based features in the new v3.4 release of ArrayFire. Among the updates are: New interpolation methods for several existing functions approx1, approx2 transform resize Functions for image moments This blog post will display some typical use cases for these new features. ArrayFire v3.4 implements several new interpolation methods for 1-d and 2-d domains. The new interpolation methods for 1-d functions are: AF_INTERP_LINEAR_COSINE AF_INTERP_CUBIC and for 2-d functions are: AF_INTERP_BILINEAR_COSINE AF_INTERP_BICUBIC The behavior of the interpolation methods can be seen in the following pictures. A common use for interpolation is image filtering. Given a coarse image, we can resample it to be smoother.
af::array img = af::randu(7,7); //create a random image
//define sample points for interpolation
af::array Xs = af::seq(0, 6, 0.1f);
af::array Ys = af::seq(0, 6, 0.1f);
Xs = af::tile(Xs, 1, Ys.dims(0));
Ys = af::tile(Ys.T(), Xs.dims(0));
//interpolate based on specific method
af::array img_bilinear = af::approx2(img, Xs, Ys, AF_INTERP_BILINEAR);
af::array img_bilinearcos = af::approx2(img, Xs, Ys, AF_INTERP_BILINEAR_COSINE);
af::array img_bicubic = af::approx2(img, Xs, Ys, AF_INTERP_BICUBIC_SPLINE);
The new interpolation methods further apply to several similar image ...
Pseudorandom number generators (PRNGs) are an integral part of many applications in statistics, modeling, and simulations. In ArrayFire v3.4, we introduce random number generation enhancements that improve speed, accuracy, storage, and unity among the ArrayFire backends. Previously in ArrayFire v3.3, each ArrayFire backend used a different PRNG. In ArrayFire v3.4, each ArrayFire backend is able to select from among 3 different random number generators. ArrayFire v3.3 (platform specific) ArrayFire v3.4 (all generators on all platforms) CUDA XORWOW CUDA, OpenCL, CPU Philox (CBRNG), Threefry (CBRNG), Mersenne Twister OpenCL Threefry (CBRNG) CPU Mersenne Twister As seen above, the XORWOW generator (which was only available for CUDA devices previously) has been replaced by the Philox generator which is available along with Threefry and Mersenne ...
In ArrayFire v3.4, we have added support for sparse matrices, which greatly reduce the memory footprint on GPUs and accelerated devices for many applications. A sparse data structure is one where all the non-zero elements are not stored. Sparse matrices are useful when the number of zero-values elements are much greater than the number of non-zero elements (i.e. the sparsity of the matrix is high). A sparse data structure is generally stored as 3 arrays: A data or values array containing all the non-zero elements A vector for row indices (based on storage format) A vector for column indices (based on storage format) There are many ways to store sparse matrices, the most prominent of which are: Compressed Sparse Row (CSR) Compressed Storage Column (CSC) ...
It's the 4th of July today and we're celebrating at ArrayFire! The 4th of July implies fireworks, and fireworks obviously imply particle systems. Particle systems are a collection of many small images or points that can be rendered to represent some complex behaving object. So before we can launch our fireworks, we will need to create a particle system. The large number of particles in a system lends well to GPU computation. Thankfully, ArrayFire's easy to use interface will allow us to do this simply and efficiently. First, let's examine the structure of a typical particle system. Individual particles in a system typically have a variety of properties that govern their individual behavior. A non-comprehensive list below summarizes some of ...
Introduction A couple of months ago, I began investigating GPU passthrough on my workstation to test ArrayFire on different operating systems. Around the same time, we at ArrayFire found ourselves with a few surplus GPUs. Having had great success with my virtualization efforts, we decided to build a Virtualized GPU Server to utilize these GPUs. Building a Virtualized GPU Server alleviated one of the pain points at our company: We no longer need to swap GPUs or Hard Disks to test a new environment. To maximize the number of GPUs we can put in a machine, we ended up getting a Quantum TXR430-0768R from Exxact Computing which comes in a 4U form factor and supports upto 8x double width GPUs. ...
The ArrayFire library attempts to make high-performance computing as easy as possible for scientists and engineers. Because many tasks need to be visualized, ArrayFire also provides a high-level interface to our Forge visualization library. In today's "Learning ArrayFire from scratch" post we present an overview of ArrayFire's visualization functionality and demonstrate how to use Forge to display data contained in af::array objects.
In last week's "Learning ArrayFire from scratch" post we discussed how to interface ArrayFire and CUDA to improve your productivity. This week we demonstrate how to mix ArrayFire and OpenCL in your application.
Although ArrayFire is quite extensive, there remain many cases in which you may want to write custom kernels in CUDA or OpenCL. For example, you may wish to add ArrayFire to an existing code base to increase your productivity, or you may need to supplement ArrayFire's functionality with your own custom implementation of specific algorithms. Today's "Learning ArrayFire from scratch", blog post discusses how you can interface ArrayFire and CUDA.
One of the most common questions we see on the ArrayFire Google Group pertains to methods to manipulate the dimensions of ArrayFire array objects. Thus we will continue the "Learning ArrayFire from scratch" blog series by providing a detailed discussion of the numerous functions that permit you to change the dimentionality, flatten, flip, join, shift, transpose, and tile arrays.