AMD Performance Library on Linux®: Making the Penguin Fly




Getting the most out of x86 hardware requires fancy code and knowledge of processor internals—unless you’re doing things the easy way: letting the AMD libraries make your Linux app fly.

A common perception among developers is that, in order to get the best performance out of a processor, especially in the tight loops that process multimedia, you have to drop down to the assembly level.

Even if you use intrinsics to operate at a slightly higher level, it is believed that you're forced to learn a lot about the processor architecture to make judicious decisions about how to craft the code. Moreover, the code needs to accommodate the different feature sets of earlier generations of x86 processors.

In sum, the perception is that squeezing the last bit of performance out of code is a real headache.

It's not.

Because, fortunately, AMD provides a series of libraries that remove most of this drudgery. One of these, the AMD Performance Library, is a vast collection of imaging- and signal-processing-oriented functions that exploit advanced features of modern processors to accelerate software performance.

The library contains a dispatcher that queries the processor when the library is first called and determines the chip's capabilities. The dispatcher then loads the functions that make best use of that processor's feature set.

As new processor generations are released, AMD releases updates to the library. Sites that use the APL as a dynamic linked component can then upgrade immediately by swapping in the new release. This step is particularly easy on Linux®, where it requires only a replacement of the library in the default library directory.

Using the library in applications distributed to customers, clients, and users is facilitated by the fact that the APL is available at no cost from AMD.

This article describes how to use the library on Linux, including installation and writing C/C++ code to access the library. A companion piece discusses how to use the library on Windows® and access it from the Microsoft® .NET framework. Users of Mono software (http://www.mono-project.com/) on Linux should consult the companion article for helpful information.





0 comments

Make A Comment
top