Image Processing Functions in ArrayFire v3.4

Stefan Yurkevitch ArrayFire Leave a Comment

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 …

Random Number Generators in ArrayFire v3.4

Kumar Aatish ArrayFire Leave a Comment

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 …

Sparse Matrices in ArrayFire v3.4

Shehzan Mohammed ArrayFire Leave a Comment

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) …

A Simple Particle System with ArrayFire

Stefan Yurkevitch ArrayFire Leave a Comment

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 …

Visualizing the af::array with Forge

Stefan Yurkevitch ArrayFire Leave a Comment

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.

ArrayFire – CUDA Interoperability

Brian Kloppenborg ArrayFire, CUDA 2 Comments

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.

Manipulating and restructuring arrays

Stefan Yurkevitch ArrayFire Leave a Comment

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.

Introduction to Vectorization in ArrayFire

Stefan Yurkevitch ArrayFire Leave a Comment

Programmers and Data Scientists want to take advantage of fast and parallel computational devices. One of the best ways of doing this is to write vectorized code; however, this is often easier said than done. In today’s continuation of the blog series “Learning ArrayFire from scratch“, we will discuss the various methods by which you can maximize the performance of your code by using ArrayFire’s built-in vectorization features.

Introduction to the ArrayFire array

Brian Kloppenborg ArrayFire Leave a Comment

The fundamental primitive of the ArrayFire Library is our container object, the array. As the next post in our blog series, “Learning ArrayFire from scratch“, we will describe how to construct arrays, what datatypes arrays support, indexing, how to query an array for various properties (content, dimensions), and how to write mathematical expressions that involve arrays.