2010/2/251GPGPUKedResultComputation of Normal VectorImage resolution: 640 x 480CPU: 625 clock timeGPU: 125 clock timeResultComputation of Normal VectorImage resolution: 1280 x 1024CPU: 2500 clock timeGPU: 172 clock timeOK, What is GPU A graphics accelerator incorporates custommicrochips which contain special mathematicaloperations commonly used in graphics rendering.GPGPU• General purpose computing on GPU GPGPU GPGP GP2(boring RD -.-||)hi, I am R2-D2Why faster
2010/2/252Why faster Why faster CPU GPUGeneral purpose Specialized hardwareSerial execution Parallel executionMinimum latency Maximum throughputDevelopment tools:Focus on GPGPU CUDA: Compute Unified Device Architecture Developed by NVIDIA C like language Full developing environment Compiler Debugger Math librariesDevelopment tools:Focus on GPGPU Advantage: Shared memory amongst threads 16k Faster downloads and readbacks to and from GPU Full support for integer and bitwise operationsDevelopment tools:Shader programming ARB low-level assembly language OpenGL shading language Cg programming language DirectX high-level shader languageDevelopment tools:Shader programming
2010/2/253Development tools:Shader programming Developing tools of GLSL:Pipeline of GPU processingShader programmingVertex shaderFragment shaderGeometry shaderRenderMan shading language Developed by Pixar has uncompromising imagequality as its fundamental goal Light shader Displacement shader Surface shader Volume shader Imager shaderVertex shader Fragment shader
2010/2/254Streaming of fragment shader Stream processing is a computer programming paradigm,related to SIMD, that allows some applications to moreeasily exploit a limited form of parallel processing. Suchapplications can use multiple computational units, suchas the floating point units on a GPU, without explicitlymanaging allocation, synchronization, or communicationamong those units.Branch of fragment shaderConception of GPGPU Textures => Computing arrays Vertex Coordinates => Computational range Fragment programs => Computation Read from framebuffer => Get resultCase study:Computation of normal vector Normal(V0) =[ normal(F401) +normal(F102) +normal(F203) +normal(F304) ] / 4 Normal(F102) =cross(v1v0, v2v0)Prepare:Choose graphic cardPrepare:Test the graphic cardneed
2010/2/255Use GLSL in BCB environment:Call GLee library Other choice: GLewInstall shader:Run-time buildingTexture:Computing arrayVertex coordinate:Computational rangeFragment program:ComputationRead from framebuffer:Get resultFameBuffer Object is a better choice
2010/2/256Trivia:Ghost in numerical computingReview the resultImage resolution: 640 x 480CPU: 625 clock timeGPU: 125 clock timeImage resolution: 1280 x 1024CPU: 2500 clock timeGPU: 172 clock timeReference GPU Gems 2 OpenGL Shading Language OpenGL Programming Guide Dominik Göddeke-- GPGPU::Basic Math Tutorial(website) GPGPU: SIGGRAPH 2004 course Batch, batch, batch:what does it really meansThx.