Image editing using ArrayFire: Part 3

Pradeep Garigipati ArrayFire, C/C++, CUDA, Image Processing, OpenCL 1 Comment

Today, we will be doing the third post in our series Image editing using ArrayFire. References to old posts are available below. * Part 1 * Part 2 In this post, we will be looking at the following operations. Image Histogram Simple Binary Theshold Otsu Threshold Iterative Threshold Adaptive Binary Threshold Emboss Filter Today’s post will be mostly dominated by different types of threshold operations we can achieve using ArrayFire. Image Histogram We have a built-in function in ArrayFire that creates a histogram. The input image was converted to gray scale before histogram calculation as our histogram implementation works for vector and 2D matrices only. In case, you need histogram for all three channels of a color image, you can …

Quest for the Smallest OpenCL Program

Umar Arshad C/C++, OpenCL 8 Comments

I have heard many complaints about the verbosity of the OpenCL API. This claim is not unwarranted. The verbosity is due to the low-level nature of OpenCL. It is written in the C programming language; the lingua franca of programming languages. While this allows you to run an OpenCL program on virtually any platform, it has some disadvantages. A typical OpenCL program must: Query for the platform Get the device IDs from the platform Create a context from a set of device IDs Create a command queue from the context Create buffer objects for your data Transfer the data to the buffer Create and build a program from source Extract the kernels Launch the kernels Transfer the data to the host …

ArrayFire Capability Update – July 2014

Oded Green Android, ArrayFire, C/C++, CUDA, Fortran, Java, OpenCL, R 1 Comment

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 …

How to write vectorized code

Pavan Yalamanchili ArrayFire, C/C++ Leave a Comment

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

Writing a Simple Corner Detector with ArrayFire

Peter Entschev ArrayFire, C/C++, Computer Vision 2 Comments

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 …

Custom Kernels with ArrayFire

Pavan Yalamanchili ArrayFire, C/C++, CUDA, OpenCL Leave a Comment

As extensive as ArrayFire is, there are a few cases where you are still working with custom CUDA or OpenCL kernels. For example, you may want to integrate ArrayFire into an existing code base for productivity or you may want to keep it around the old implementation for testing purposes. In this post we are going to talk about how to integrate your custom kernels into ArrayFire in a seamless fashion. In and Out of ArrayFire First let us look at the following code and then break it down bit by bit. int main() { af::array x = af::randu(num, 1); af::array y = af::array(num, 1); float *d_x = x.device(); float *d_y = y.device(); af::sync(); launch_simple_kernel(d_y, d_x, num); x.unlock(); y.unlock(); float err = …

Getting Started with OpenCL on Android

Pradeep Garigipati Android, Java, OpenCL 10 Comments

Mobile devices are carving their niche into the world of computing with more processing power day by day. GPUs on mobile devices have been around for a while, but using them for accelerating computation is still quite new. Until recently, the only way to access the GPU was through OpenGL. Around december 2008, Khronos released OpenCL, a generic API for accelerating non-graphics tasks. OpenCL enables us to take advantage of acceleration hardware. Since it is an open standard, many hardware vendors provide support on their devices. With the recent release of Adreno and Mali SDKs, you can now run OpenCL code on mobile GPUs. Today’s post is going to be about how to do image processing on camera feed on …

Open Source Initiatives from ArrayFire

Pavan Yalamanchili Announcements, ArrayFire, CUDA, Fortran, Java, Open Source, OpenCL, OpenGL, R Leave a Comment

At ArrayFire we like to use a lot of Free/Open Source software. We use various Linux distributions, Jenkins, Gitlab, gcc, emacs, vim and numerous other FOSS tools on a daily basis. We also love the idea of developing software collaboratively and openly. Last year we started working with AMD on CL Math Libraries. Internally we’ve had numerous discussions about contributing to the GPGPU community. However, it’s neither simple nor straightforward to take a closed software Open Source. Earlier this year, we decided to take the first step and Open Source all of the ArrayFire library’s  tertiary projects. This includes all of our ArrayFire library’s language wrappers, examples, and source code used for our blog posts. All of our projects are hosted at our …

ArrayFire for Defense and Intelligence Applications

Aaron Taylor Announcements, C/C++, Events, Fortran Leave a Comment

AccelerEyes and NVIDIA invite you to participate in a joint webinar designed to help you learn about ArrayFire, a productive, easy-to-use GPU software library for C, C++, and Fortran. Major defense and intelligence institutions are discovering just how effective GPU computing can be in enabling unique solutions for applications related to video analysis, recognition, and tracking. During this informative webinar, Kyle Spafford, a Senior Software Developer at AccelerEyes, will explain how to accelerate common defense and intelligence algorithms using ArrayFire. The webinar will take place on Tuesday, September 17, 2013 at 10:00 AM PDT. Register for this webinar by clicking here. We hope you will join us as we discuss exciting developments in GPU computing software!

Getting Started with ArrayFire – a 30-minute Jump Start

ArrayFire ArrayFire, C/C++, CUDA, OpenCL 1 Comment

In case you missed it, we recently held a webinar on the ArrayFire GPU Computing Library. This webinar was part of an ongoing series of webinars that will help you learn more about the many applications of ArrayFire, while interacting with AccelerEyes GPU computing experts. ArrayFire is the world’s most comprehensive GPU software library. In this webinar, James Malcolm, who has built many of ArrayFire’s core components, walked us through the basic principles and syntax for ArrayFire. He also provided an overview of existing efforts in GPU software, and compared them to the extensive capabilities of ArrayFire. For example, the same application that takes 26 lines to write in Thrust, can be coded up in just 3 lines in ArrayFire! ArrayFire has supported …