Moving computations out of Nasal and C++ onto the GPU is particularly intriguing as code running on the GPU is by design inherently concurrent, while code running inside Nasal (but also C++) space must be made concurrent explicitly, which is often very much complicated and tedious due to FlightGear's architecture.
FlightGear's support for effects and shaders makes it possible to offload certain graphics-related computations onto the GPU, so that the CPU becomes more responsive and also more available for other computations. This is a good thing for FlightGear, because it basically means that the FlightGear main loop can run at higher update rates.
Unfortunately, shaders are not suitable for all sorts of computations, such as computations that may be complex but not directly related to graphics or the runtime model employed by shaders. That means for example that certain computations may be done inefficiently (redundantly) because of the way shaders are invoked for each pixel, vertex or fragment.
However, OpenCL provides support for offloading even more (non-graphics related) computations onto the GPU, so that general purpose computing becomes possible using the GPU, but also other processors in general.
This is done by providing standalone "kernels" written in C-like language, pretty much similar to how shader programming works already in FlightGear (i.e. plain text source code files, transparently compiled by GPU drivers):
http://www.khronos.org/opencl/
OpenCL™ is the first open, royalty-free standard for cross-platform, parallel programming of modern processors found in personal computers, servers and handheld/embedded devices. OpenCL (Open Computing Language) greatly improves speed and responsiveness for a wide spectrum of applications in numerous market categories from gaming and entertainment to scientific and medical software.
http://en.wikipedia.org/wiki/OpenCL
OpenCL (Open Computing Language) is a framework for writing programs that execute across heterogeneous platforms consisting of CPUs, GPUs, and other processors. OpenCL includes a language (based on C99) for writing kernels (functions that execute on OpenCL devices), plus APIs that are used to define and then control the platforms. OpenCL provides parallel computing using task-based and data-based parallelism. It has been adopted by Intel, AMD, ATI, and ARM. OpenCL is an open standard defined by the Khronos Group.
OpenCL gives any application access to the graphics processing unit for non-graphical computing. Thus, OpenCL extends the power of the Graphics Processing Unit beyond graphics (general-purpose computing on graphics processing units).
OpenCL is analogous to the open industry standards OpenGL and OpenAL, for 3D graphics and computer audio, respectively.
Overview:
- http://www.multicoreinfo.com/research/s ... y_SC08.pdf
- http://www.prace-project.eu/hpc-trainin ... aining.pdf
- http://www.khronos.org/developers/libra ... _Aug09.pdf
- http://www.khronos.org/developers/libra ... _Aug09.pdf
- http://www.khronos.org/developers/libra ... _Aug09.pdf
- http://www.khronos.org/developers/libra ... _Aug09.pdf
- http://images.apple.com/euro/macosx/tec ... 090608.pdf
- http://www.cs.tut.fi/~pk/seminaarit/gpu-2009/OpenCL.pdf
Tutorials
- http://www.macresearch.org/opencl
- http://opencl.codeplex.com/wikipage?tit ... ls%20-%201
- http://www.codeproject.com/KB/GPU-Progr ... penCL.aspx
- http://www.codeproject.com/KB/showcase/ ... elism.aspx
- http://www.codeproject.com/KB/showcase/ ... paces.aspx
- http://www.codeproject.com/KB/showcase/ ... -Sync.aspx
- http://enja.org/2010/07/13/adventures-i ... g-started/
- http://developer.amd.com/SDKS/AMDAPPSDK ... penCL.aspx
- http://developer.download.nvidia.com/Op ... _Guide.pdf
- http://developer.download.nvidia.com/CU ... amming.pdf
- http://developer.download.nvidia.com/CU ... OpenCL.wmv
- http://www.nvidia.com/content/cudazone/ ... sGuide.pdf
- http://developer.download.nvidia.com/CU ... vance_.wmv
- http://developer.amd.com/zones/OpenCLZo ... -2010.aspx
- http://developer.amd.com/sdks/amdappsdk ... penCL.aspx
- http://enja.org/category/opencl/
Specs:
- http://www.khronos.org/registry/cl/spec ... 1.0.33.pdf
- http://www.multicoreinfo.com/research/s ... slides.pdf
Reference:
http://www.khronos.org/registry/cl/sdk/ ... man/xhtml/
http://www.khronos.org/developers//opencl/
More videos:
http://www.multicoreinfo.com/2011/03/parprog-part-9u/
Also see: viewtopic.php?f=6&t=17034&p=162483#p162415