Graphical Processing Units (GPUs) are used further and more as external accelerators to make haste-up workloads normally running on CPUs. The cardinal programming languages allowing to program GPUs are CUDA from NVIDIA and OpenCL from the Khronos consortium and in that place are both based on the C99 programming speech. Beside those programming languages there are more APIs allowing to configure the in the way that called computation kernels: setting parameters, transferring memorial to and from the target symbol, starting the computation. Multiple approaches last to support GPU programming in Java: true API wrappers, parallelizing Just-In-Time (JIT) compilers and prominent-level language integrations.
The wrapper be nearly equal already allows to get some useful performance improvements when offloading algorithms that marry properly the GPU philosophy (data parallelism, humane ratio instruction/memory accesses). However, season they allow to control GPU devices from Java, they again require to write native CUDA or OpenCL digest to implement the so called computational kernels. And in the same manner with this step can be quite unwieldy, especially for Java developers, this draw nigh can limits the productivity of developers whereas trying to port large scale applications up~ GPUs.
The second technology relies adhering the ability of a JIT compiler to automatically take out from the Java byte-code the nature of parallel computations that could be efficiently executed on a massively allied Java GPUarchitecture. This approach is highly convenient for the developer as the rise code does not require any modify, but as automatic generation of cause parallel code is a very perplexing problem, it is quite tricky to be informed why the parallelization does not occur in more cases and debugging performance related delivery is also difficult as the compiler is the merely one to decide where, when and in what plight to generate GPU kernels.
The after all the rest approach consists in injecting some GPU especial concepts (memory transfers, memory hierarchy, parallelism, vector types) into the Java power in order to present a unified programming environment to the Java developer. This in the usual course of things means using some annotations or keywords to tig pieces of Java code that should suit kernels, re-targeting parallel constructs or aperture iterators to define on which alphabetical table of references space a kernel should be executed and relying attached nested syntactical scopes or dedicated shifting qualifiers to define how variables should be mapped to the private, local or global monumental record hierarchies available on a GPU. This draw nigh has the advantage of giving in addition control to the user while not requiring to learn a of recent origin programming language, thus making GPU programming in Java bare and productive.
No comments:
Post a Comment