This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Contents Introduction.................................................................... 1 Graphics Processing Units .......................................... 1 RapidMind Development Platform......................... 2 Writing RapidMind Enabled Applications ...... 2 How Does It Work? .................................................. 3 Example: A Particle System ...................................... 3 Example: Blinn-Phong Shading ............................... 5 High Performance Made Simple .............................. 6 About RapidMind Inc. ................................................. 6 Writing Applications for the GPU Using the RapidMind™ Development Platform Abstract The RapidMind Development Platform allows developers to use standard C++ programming to easily create applications targeted for high- performance processors, including GPUs, the Cel l BE, and multi-core CPUs. In the case of the GPU, the RapidMind platform can be used for both shaders and general purpose processing. For shaders, the platform provides many advantages over other shading systems, including support for object-oriented programming. For general purpose processing, the platform provides a simple computational model th at can be mapped onto any available computational resource in a system, including both GPUs and other processors. Code can be written once, then run in parallel on any of the processors that RapidMind supports. Copyright © 2006 RapidMind Inc.Copyright © 2006 RapidMind Inc. Page 1 Introduction Graphics Processing Units (GPUs), the main processors of commodity video accelerator cards in PCs, are capable of achieving very high levels of performance by utilizing the power of parallel processing. In fact, these processors typically have more than an order of magnitude more floating-point power than the host CPU they support. Although designed for graphics applications, they can be used for arbitrary computations; however, graphics APIs do not directly support this mode of usage. The RapidMind Development Platform makes it straightforward to access a GPU’s power for general-purpose computation without any need to work through a graphics API. The RapidMind platform provides a simple data-para llel model of execution that is easy to understand and use, and maps efficiently onto the capabilities of GPUs. The RapidMind platform’s unique interface enables access to a GPU’s power from with in a single ISO-standard C++ program without any specia l extensions. It al lows the use of famil i ar development environments and tools by building upon concepts and strategies already familiar to C++ programmers. It is also possible to use the platform to write shaders and graphical applications as a special case of the platform’s general-purpose capabilities. The RapidMind platform supports both NVIDIA® and ATI® GPUs. This document outlines the challenges general-purpose GPU programming presents to programmers and describes how these challenges are effectively overcome using the RapidMind Development Platform. A simple example of a particle system simulation is used to show how straightforward it is to leverage GPUs for general purpose computation by using the RapidMind Development Platform. We also demonstrate how the platform can be used to program shaders for graphical applications. Graphics Processing Units GPUs from ATI and NVIDIA are massively parallel processors that can support more than 30x the floating-point power of typical host CPUs and more than 5x the memory bandwidth. This processing power is necessary to implement shaders, which are small programs which must be executed at every vertex to transform it in 3D space and at every pixel to compute the color of that pixel. Although they are powerful, GPUs are widely available on inexpensive video accelerator cards, and are standard components of most PCs. The execution of shaders can be considered a form of stream processing, a massively parallel computing model that emphasizes coherent access to memory. However, the programming model for GPUs is usuall y expressed in graphics terms, and can be inconvenient to use for general-purpose computation. For instance, to apply a function to an array, it is necessary to bind a shader and draw a rectangle to the screen. To implement random-access reads from memory, it is necessary to set up texture maps and bind them to shaders. To write to output arrays, it is necessary to use frame buffer object interfaces to bind the output of the shaders to a texture. To write to computed locations in output arrays, it is necessary to reinterpret image pixel values as vertex positions and render a sequence of points that the rasterizer scatters to new locations on a destination buffer. This makes it very complex and confusing to program GPUs for general applications. Although GPU hardware vendors provide languages for programming the shader units of their hardware, these languages only provide the ability to program shaders—not the whole system. Many other aspects of the GPU must be managed, in particular memory. The GPU memory is separate from the host memory, so it is necessary to transfer data to and from the video accelerator. Also, binding shader code to the host application requires a large amount of glue code. Finally, after programming a GPU this way, the resulting code will only run on GPUs, and cannot easily be ported to other hardware targets, such as the Cell BE.Copyright © 2006 RapidMind Inc. Page 2 RapidMind Development Platform RapidMind provides a software development platform that allows the developer to use standard C++ programming to easily create high-performance and massively parallel applications that run on the GPU. Developers are provided a single, simple and standard way to program which the RapidMind platform then maps onto all available computational resources in a given system. Developers can continue to use their existing C++ compilers and build systems. The RapidMind platform is embedded in the application and transparently manages massively para llel computations. Application Structure Writing RapidMind Enabled Applications Users of the RapidMind Development Platform continue to program in C++ using their existing compiler. After identifying components of their application to accelerate, the overall process of integration is as follows: 1. Replace types: The developer replaces numerical types representing


View Full Document

UCLA COMSCI 239 - Writing Applications

Download Writing Applications
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Writing Applications and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Writing Applications 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?