![]() ![]() Code running on the host manages the memory on both the host and device, and also launches kernels which are subroutines executed on the device. In CUDA, the host refers to the CPU and its memory, while the device refers to the GPU and its memory. The CUDA programming model is a heterogeneous model in which both the CPU and GPU are used. (Those familiar with CUDA C or another interface to CUDA can jump to the next section). CUDA Programming Model Basicsīefore we jump into CUDA Fortran code, those new to CUDA will benefit from a basic description of the CUDA programming model and some of the terminology used. CUDA Fortran is essentially Fortran with a few extensions that allow one to execute subroutines on the GPU by many threads in parallel. If you are familiar with Fortran but new to CUDA, this series will cover the basic concepts of parallel computing on the CUDA platform. There are a few differences in how CUDA concepts are expressed using Fortran 90 constructs, but the programming model for both CUDA Fortran and CUDA C is the same. If you are familiar with CUDA C, then you are already well on your way to using CUDA Fortran as it is based on the CUDA C runtime API. This post is the first in a series on CUDA Fortran, which is the Fortran interface to the CUDA parallel computing platform. ![]() Although the examples can be compiled and run on any supported operating system in a variety of development environments, the examples in this document are compiled from the command line as one would do under Linux or Mac OS X.CUDA Fortran for Scientists and Engineers shows how high-performance application developers can leverage the power of GPUs using Fortran. This document makes use of the PGI 11.x compilers, which can be obtained from. The second part of this document is a collection of case studies that demonstrate how the principles in the fuirst section are applied to real-world examples. This document is divided into two main sections, the first is a tutorial on CUDA Fortran programming, from the basics of writing CUDA Fortran code to some tips on optimization. CUDA is a hybrid programming model, where both GPU and CPU are utilized, so CPU code can be incrementally ported to the GPU. Part of the appeal of parallel programming on GPUs using CUDA is that the programming model is simple and novices can get parallel code up and running very quickly. However, no experience with parallel programming (on the GPU or otherwise) is required. ![]() The reader of this book should be familiar with Fortran 90 concepts, such as modules, derived types, and array operations. ![]() CUDA Fortran is simply the Fortran analog to CUDA C. PGI’s CUDA Fortran should be distinguished from the PGI Accelerator product, which is a directive based approach to using the GPU. This document pertains to the latter approach. There are many ways to access the CUDA architecture from a programmer’s perspective, either through C/C++ from CUDA C and Open CL, or through Fortran using PGI’s CUDA Fortran. The CUDA architecture was developed by NVIDIA to allow use of the GPU for general purpose computing without requiring the programmer to have a background in graphics. The goal here is to provide the reader with the fundamentals of GPU programming using CUDA Fortran as well as some typical examples without having the task of developing CUDA Fortran code becoming an end in itself. This document in intended for scientists and engineers who develop or maintain computer simulations and applications in Fortran, and who would like to harness parallel processing power of graphics processing units (GPUs) to accelerate their code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |