How to write vectorized code

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

Q/A Using ArrayFire

Shehzan MohammedArrayFire Leave a Comment

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

Peter EntschevArrayFire, 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 YalamanchiliArrayFire, 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 = …

https://www.youtube.com/watch?v=ZQVzXaOWSZ0

In Case you Missed it: ArrayFire Joint Webinar with AMD

Oded GreenEvents, OpenCL Leave a Comment

ArrayFire recently gave two webinar presentations to OpenCL developers as part of a joint webinar series with AMD. Due to popular demand for the first webinar, we ended up presenting a second! In case you missed it, here’s a recording of the webinar complete with the presentation and an informative Q&A session:  http://bit.ly/SkzIJs This webinar focused on enhancing productivity by using existing OpenCL libraries while achieving a high level of performance and maximizing system utilization. We demonstrated how our ArrayFire software library offers simple GPU programming with the benefit of awesome performance. In the webinar we showed how to use several image processing and computer vision building blocks in less than 3 lines of code.  The immediate takeaway message of …

Getting Started with OpenCL on Android

Pradeep GarigipatiAndroid, Java, OpenCL 12 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 …

Joint Webinar with AMD: An Introduction to OpenCL Libraries

ScottAnnouncements, ArrayFire, Events, OpenCL Leave a Comment

Back by popular demand! You’re invited to join us for a second webinar held jointly with AMD to discuss productive OpenCL Programming – An Introduction to OpenCL Libraries. We had so many people attend the first one, we decided to hold a second webinar! The webinar will be held on Monday, May 19 at 9 am PT / 11 am CT / 12 pm ET. Join ArrayFire COO Oded Green as he demonstrates best practices to help you quickly get started with OpenCL programming.  Learn how to get the best performance from AMD hardware in various programming languages using the ArrayFire library. Oded will discuss the latest advancements in the OpenCL ecosystem, including cutting edge OpenCL libraries such as clBLAS, clFFT, clMAGMA and ArrayFire. …

Open Source Initiatives from ArrayFire

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

How to Make GPU Hardware Decisions

ScottComputing Trends, CUDA, Hardware & Infrastructure, OpenCL Leave a Comment

We get questions all the time about how to make GPU hardware decisions. We’ve seen just about every scenario you can imagine, and so we always jump at the chance to help others through this decision process. Here’s a recent question from a customer. “I’ve just found your post on Analytic Bridge and have taken a look at your website … I’m replacing my two Tesla M1060 cards (computing capability too low) and I’m considering used Tesla M2070s or the new GTX 760 cards. Could you offer any insight? I believe the GTX 760 cards may well outperform the older 2070s and are much cheaper.” And here’s our response. “The GTX 760 will probably outperform the M2070 for single precision …

GitLab at ArrayFire

Shehzan MohammedHardware & Infrastructure Leave a Comment

Until recently, we had our central git repositories hosted on a virtual machine. This was running on a big, noisy, rack mounted server. We started thinking about cutting down the number of machines we use on a daily basis (Just can’t stop optimizing). The opportunity popped up during an office move to our new location. We had discussed this idea in a few meetings before, but for various reasons, they were not acted upon. During the move Umar started hacking on GitLab to get it working for us internally. The office move came as a blessing in disguise. He used one of our old Dell Inspiron laptops that was just gathering dust. We ordered new DDR2 (yes, DDR2) RAM for it and installed …