MIT researchers streamline coding for image processing
- 02 August, 2012 20:52
Researchers at the Massachusetts Institute of Technology have figured out a way of helping developers more easily rearrange their image processing code so that it could execute faster and use fewer computational resources.
Such a technique could prove especially beneficial for mobile phones and other portable devices where battery power is at a premium. Users are growing ever more accustomed to running advanced photo manipulation apps like Instagram on their phones, so developers of these apps are struggling to make their creations as speedy as possible.
"I was looking for some easier way to write high performance code for mobile devices, but it turned out to be great for desktops as well," said Andrew Adams, a postdoctoral student at the MIT Computer Science and Artificial Intelligence Laboratory (CSAIL).
Adams, along with other researchers from MIT, Stanford University and Adobe, have developed a DSL (Domain Specific Language), and associated compiler, that creates a layer of abstraction that allows developers to easily move around chunks of code in order to find the most computationally efficient method of processing images.
The researchers have used the DSL, called Halide, to rewrite several common image-processing functions. In many cases they were able to demonstrate two-, three-, or even six-fold increases in speed.
Typically, image processing involves multiple steps, some of which can be executed in a parallel in multicore processors. For developers, however, moving code around to find the optimal order of execution can be a complicated and error-prone process, given that with the imperative languages used today for image processing -- such as C++ -- the order in which a program executes tends to be "baked into the code," Adams said.
"Getting performance improvements on mobile platforms can be quite painful. If you've already optimized your code a certain way, If you want to try optimizing a different way you have to rearrange all your code, and you'll probably just increased the number bugs. It's just a painful experience," Adams said.
Borrowing ideas from functional programming, Halide provides developers with the ability to easily schedule when and where each routine should execute. The programmer can experiment with the order in which the program executes, without worrying about introducing bugs or breakages.
Halide can also save time in porting programs to different hardware as well. The programmer needs only to reorder the execution of code that is optimal for the new platform.
The DSL is an extension of C++, and compilers are available for both x86 and ARM mobile processors, as well as for Nvidia Cuda GPUs. The researchers may also create a version tailored for the OpenGL library. Ultimately, though, they hope that the ideas behind Halide -- rather than the DSL itself -- are embedded in commercial development tools and languages.
The researchers plan to discuss Halide at the Association for Computing Machinery's Special Interest Group on Computer Graphics and Interactive Techniques (Siggraph) conference next week in Los Angeles.
Join the CIO Australia group on LinkedIn. The group is open to CIOs, IT Directors, COOs, CTOs and senior IT managers.
Larry Page wants to see your medical records
Dual-Persona Smartphones Not a BYOD Panacea
After two-year hiatus, EFF accepts bitcoin donations again
CIOs struggle to deliver timely mobile business apps: survey
Spiceworks' free management software gets integrated MDM
Real-Time Protection Against Malware Infection
Malware is at such high levels (more than 60 million unique samples per year) that protecting an endpoint with traditional antivirus software, has become futile. More than 100,000 new types of malware are now released every day, and antivirus vendors are racing to add new protection features to try to keep their protection levels up. Read more.
BYOD and Beyond - Implementing a Unified Access Solution
The rise of BYOD programs is the single most radical shift in the economics of client computing for business since PCs invaded the workplace. Whether you are contemplating the creation of a BYOD program or currently trying to establish one, this fact cannot be overstated. Find out how to overcome these challenges.
The Foundation for Cloud Management
For businesses looking to provide real-time business solutions to employees and customers alike, you need to have a comprehensive network management strategy. The network is the foundation of all successful cloud services; it must be robust to meet traffic, efficiency, and performance demands. Download today the four steps to get your network operations cloud-ready.