Changes

Jump to: navigation, search

GPU

2,227 bytes added, 19:43, 7 August 2019
GPGPU
=GPGPU=
There are various frameworks for [https://en.wikipedia.org/wiki/General-purpose_computing_on_graphics_processing_units GPGPU], General Purpose computing on Graphics Processing Unit. Despite language wrappers and mobile devices with special APIs, there are in main three ways to make use of GPGPU.
The traditional job of a GPU is to take the x,y,z coordinates of triangles, and map these triangles to screen-space through a matrix multiplication. And as the number of triangles and polygons grew to make more sophisticated models, GPUs would create massively parallel architectures capable of performing hundreds of millions of transformations hundreds of times per second. These lists of triangles (as well as their colors, textures, reflectivity, and other attributes), were traditionally specified in a graphical language such as DirectX or OpenGL. But video game programmers demanded more and more flexibility from their hardware: such as lighting, transparency, reflections, and particles. GPUs began to provide general purpose computational abilities to allow the graphics programmer the ability to tweak effects and customize them. Eventually, the graphics languages DirectX and OpenGL looked more like a normal programming language, albeit with weird SIMD-behavior and an odd underlying hardware architecture. Still, the graphics languages were not designed for general purpose compute: relying upon "vertex shaders", or "pixel shaders" and "geometry" shaders to get the job done. While programming pixel-shaders to get compute is possible, it is far easier to have a dedicated language where the programmer can purely think in terms of SIMD Parallel compute. The general purpose GPU (GPGPU) languages all have the same goal. To expose the SIMD-style architecture to the programmer as directly as possible. Different languages have been developed by different groups to handle this job. ==Mapping to an APIKhronos OpenCL ==  The Khronos group is a standardization committee formed to oversee the OpenGL, OpenCL, and Vulkan standards. Although compute shaders exist in all languages, OpenCL is the designated general purpose compute language. OpenCL 1.2 is widely supported by AMD, NVidia, and Intel. OpenCL 2.0, although specified in 2013, has had a slow rollout, and the specific features aren't necessarily widespread in modern GPUs yet. AMD continues to target OpenCL 2.0 support in their ROCm environment, while NVidia has implemented some OpenCL 2.0 features. * [OpenCL 1.2 Specification: https://enwww.wikipediakhronos.org/wikiregistry/OpenCL/specs/BrookGPU BrookGPU] (translates to [opencl-1.2.pdf* OpenCL 1.2 Reference: https://enwww.wikipediakhronos.org/wikiregistry/OpenCL//sdk/1.2/docs/man/xhtml/OpenGL OpenGL] and [ * OpenCL 2.0 Specification: https://enwww.wikipediakhronos.org/wikiregistry/OpenCL/specs/DirectX DirectX])opencl-2.0.pdf* [OpenCL 2.0 C Language Specification: https://enwww.wikipediakhronos.org/wikiregistry/OpenCL/specs/2.2/pdf/OpenCL_C.pdf* OpenCL 2.0 Reference: http://www.khronos.org/registry/OpenCL//sdk/2.0/docs/man/C%2B%2B_AMP xhtml/ == NVidia CUDA == NVidia CUDA is their general purpose compute framework. CUDA has a C++ AMP] compiler based on LLVM / clang, which compiles into an assembly-like language called PTX. NVidia device drivers take PTX and compile that down to the final machine code (Open standard by [[Microsoft|Microsoft]] that extends [[Cpp|Ccalled NVidia SASS). NVidia keeps PTX portable between its GPUs, while its SASS assembly language may change from year-to-year as NVidia releases new GPUs. * NVidia CUDA Zone: https://developer.nvidia.com/cuda-zone* NVidia PTX ISA: https://docs.nvidia.com/cuda/parallel-thread-execution/index.html* NVidia CUDA Toolkit Documentation: https://docs.nvidia.com/cuda/index.html == AMD Software Overview == ROCm ++]])AMDGPU Pro discussion TBD == Other 3rd party tools ==  
* [https://en.wikipedia.org/wiki/DirectCompute DirectCompute] (GPGPU API by Microsoft)
==Native Compilers== * [https://enOpenMP 4.wikipedia.org/wiki/CUDA CUDA] (GPGPU framework by [https://en.wikipedia.org/wiki/Nvidia Nvidia])* [https://en.wikipedia.org/wiki/OpenCL OpenCL] (Open Compute Language specified by [https://en.wikipedia.org/wiki/Khronos_Group Khronos Group])==Intermediate Languages== * [https://en.wikipedia.org/wiki/Heterogeneous_System_Architecture#HSA_Intermediate_Layer HSAIL]* [https://en.wikipedia.org/wiki/Parallel_Thread_Execution PTX]* [https://en.wikipedia.org/wiki/Standard_Portable_Intermediate_Representation SPIR]5 Device Offload
=Inside=

Navigation menu