In response to user requests for additional ArrayFire capabilities, we have decided to extend the library to have CPU fall back when OpenCL drivers for CPUs are not available. This means that ArrayFire code will be portable to both devices that have OpenCL setup and devices without it. This is done through the creation of additional backends. This will allow ArrayFire users to write their code once and have it run on multiple systems. We currently support the following systems and architectures: NVIDIA GPUs (Tesla, Fermi, and Kepler) AMD’s GPUs, CPUs and APUs Intel’s CPUs, GPUs and Xeon Phi Co-Processor Mobile and Embedded devices As part of this update process we are also looking at extending ArrayFire capabilities to low power systems such …
Image editing using ArrayFire
In this post, we will be looking at the following simple image editing operations using the ArrayFire library. contrast modification brightness modification translation digital zoom alpha blending unsharp mask Code required to do each operation and the corresponding input/output sample are given below in their corresponding sections. All the operations are built using some existing image manipulation functions and the awesome element-wise operations in ArrayFire. Contrast modification /** * contrast value should be in the range [-1,1] **/ void changeContrast(array &in, const float contrast) { float scale = tan((contrast+1)*Pi/4); in = ((in/255.0f – 0.5f) * scale + 0.5f) * 255.0f; } Brightness modification /** * brightness value should be in the range [0,1] **/ void changeBrightness(array &in, const float brightness, …
Remote Off-Screen Rendering with OpenGL
At ArrayFire, we constantly encounter projects that require OpenGL and run on a remote server that does not have a display. In this blog, we have compiled a list of steps that users can use to run full profile OpenGL applications over SSH on remote systems without a display. A few notes before we get started. This blog is limited to computers running distributions of Linux. The first part of the blog that shows the configuration of the xorg.conf file is limited to NVIDIA cards (with display). AMD cards support this capability without the modification of xorg.conf file. However, we have not been able to get a comprehensive list of supported devices. Requirements You will need access to the remote …
ArrayFire on Tegra K1
We’re pleased to announce the arrival of ArrayFire for NVIDIA Tegra K1! This version of ArrayFire comes with all the capabilities and features of our standard version of ArrayFire. It includes all ArrayFire CUDA functionality—with the exception of linear algebra support—as well as fully operational graphics support. ArrayFire for Tegra currently works with Tegra K1 processors running Linux for Tegra. We invite and encourage you to test it out on your boards and give us feedback; any bug fixes or performance improvements will be promptly resolved, as this is a separate branch of ArrayFire. If you’d like to deploy ArrayFire on Android, feel free to contact us for further support. We are open to partnering with anyone wishing to deploy ArrayFire in other …
Indexing with ArrayFire
ArrayFire is a fantastic library when it comes to performance. One of the things that people overlook when looking into ArrayFire is it’s powerful indexing capabilities. The main data structure in the ArrayFire library is the array. The array stores the data in a column major order. This means that the following code: float a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; array A(3, 3, a); Will produce the following matrix: Notice how the first three values of the a array make up the first column of A. When you want to perform an operation on every element of the array you can just use the variable name with the operation. The following command adds 5 to …
Computer Vision in ArrayFire – Part 1: Feature Detection
A few weeks ago we wrote Writing a Simple Corner Detector with ArrayFire. In that post, we discussed a little bit about the new features that we are working on for ArrayFire. Some of these new computer vision features will be available in the next release of ArrayFire. For the next release, ArrayFire will have a complete set to start with feature tracking, including FAST for feature detection [1], ORB for description [2] and a Hamming distance matcher. We will also include a dedicated version of the Harris corner detector [3], even though it can be written using existing ArrayFire functions. This implementation is straightforward, easy to use and will have better performance. For this post, we will share some …
Image Processing Benchmarks on NVIDIA Jetson TK1
In this post we will be looking at benchmarks of the following ArrayFire image processing functions on an ARM device. Erosion/Dilation Median filter Resize Histogram Bilateral filter Convolution We pitted the brand new compute 3.2 GPU on NVIDIA Jetson TK1 against a mobile NVIDIA GPU. The closest match to the GPU (from here on referred as TK1) on the Jetson board we have in our mobile card deck is a NVIDIA GT 650M. The GPU device properties that have critical effect on the function performance are listed below. Property Name / Device Name Jetson TK1 GK20A GT 650M Compute 3.2 3.0 Number of multiprocessors 1 2 Cores 192 384 Base clock rate 852 MHz 950 MHz Total global memory 1746 …
How to write vectorized code
Programmers and Data Scientists want to take advantage of fast and parallel computational devices. Writing vectorized code is becoming a necessity to get the best performance out of the current generation parallel hardware and scientific computing software. However, writing vectorized code may not be intuitive immediately. There are many ways you can vectorize a given code segment. Each method has its own benefits and drawbacks. Hence, writing vectorized code involves analyzing the pros and cons of the available methods and choosing the right one to solve your problem. In this post, I present various ways to vectorize your code using ArrayFire. ArrayFire is chosen because of my familiarity with the software. The same methods can be easily used in numpy, octave, …
Q/A Using ArrayFire
One of the reasons for ArrayFire’s usefulness is the various performance oriented function from many domains. What many people don’t realize is that ArrayFire also includes many utilities for image loading and visualization. In many cases, setting up a test harness is a ton of work. This is where ArrayFire can come in handy. Recently we worked on a project for one of our customers that involved image processing. As a part of development we wanted to make sure the quality is not compromised. They did not have a sufficient test framework in place. One option was to do this was the old fashioned way by reading two images and comparing them on CPU. Given that we needed to compare hundreds of images and …
Writing a Simple Corner Detector with ArrayFire
In the upcoming months we’ll be adding a lot of new Computer Vision functionality to ArrayFire, specifically targeting the most commonly used applications in this field. New functions include feature tracking, object classification, scene segmentation, optical flow, and stereo-vision. Feature tracking consists of three basic steps: Detecting good or unique features; normally they are corners or blobs of an object. Extracting a descriptor for each feature—understanding the texture of a small patch around each feature. Descriptor matching—finding out the best match for each pair of descriptors (one from the object being tracked, another from a scene that potentially contains that object), if any. Harris corner detector In this article we will be using ArrayFire to dive deeper into the first step of feature …