I have been studying a course of Programming Language Constructs and i have to write
a language report on any chosen programming language. I chose CUDA as a
language as described at the link below: Can CUDA language open up parallel processing?
But after reading some tutorials about the language i am a little confused as
according to my understanding CUDA is an architecture built for programming
massively parallel devices (i.e. GPUs) and CUDA itself provides the environments
and libraries required to develop CUDA programs … but i think that CUDA is not
a Programming language as it does not introduce any new programming constructs
to C language (I can be wrong here) as i have only observed that it provides some
API extensions to the basic C language. So i need your guidance whether CUDA can
be regarded as a programming language and if it does what are the new basic constructs
that it includes other than API extensions to C.
I have to focus my report on the following aspects:
design goals and a brief background history
the data type concept
expressions and operators
input and output
implementations and other aspects
a simple program example
Any guidance and useful links regarding the information related to the aspects of CUDA
given above would be help for me to understand CUDA and compile my report. THANX :)
CUDA is an architecture, not a programming language. However, an intermediate language called PTX has been developed for use with the CUDA system that may be useful for you to research. There are constructs such as thread barriers included in PTX (and the API extensions in C) that are not available in ANSI C, and are specific to the parallel nature of the architecture.
EDIT: Take some time to sit down and read through the first few chapters of the programming guide (available in the CUDA SDK or Toolkit, I can’t remember which). That should give you most or all of the information you need.
from http://www.nvidia.com/object/cuda_what_is.html :
“NVIDIAÂ® CUDAâ„¢ is a general purpose parallel computing architecture that leverages the parallel compute engine in NVIDIA graphics processing units (GPUs) to solve many complex computational problems in a fraction of the time required on a CPU. It includes the CUDA Instruction Set Architecture (ISA) and the parallel compute engine in the GPU. To program to the CUDAâ„¢ architecture, developers can, today, use C, one of the most widely used high-level programming languages, which can then be run at great performance on a CUDAâ„¢ enabled processor. Other languages will be supported in the future, including FORTRAN and C++.”
To me, CUDA is an architecture that is implemented on NVIDIA’s GPUs. But in everyday use when I say “CUDA” I might mean the language (extended C) or even the entire environment (language, architecture, GPU, compiler, all of it). It seems to me that this inconsistency in semantics carries through to the official documentation, publications, university classes and other places when one might encounter the word “CUDA”. This might be a good thing for people who demonstrate it, for example at tech conferences or marketing meetings - they can say “CUDA this” and “CUDA that” without being too anal about what’s what. Just covering the whole concept of programming NVIVIDA cards. It can be a pain for people who want to be precise in, for example, their scientific papers.
No, it’s the other way around. NVIDIA claims it is NOT a new language, just C, while others point out that the Runtime API obviously constitutes a new language (which is a good thing).
However, the “CUDA Language” is not interesting. It is C++ with a few simple extensions that tie into the GPU programming model. From what you posted of your assignment, you should find a truly interesting language. I suggest Boo, Nemerle, or D. These are the most advanced practical languages out right now, I would say.
I vote for NESL. Then again, I always vote for NESL.
Also, I would argue that the language component of CUDA is uninteresting (C plus like 10 keywords or whatever, only a few of which you’ll use 99% of the time), but the execution model of CUDA is pretty interesting (especially its relation with computer architecture and how the architecture and the model have influenced one another over the years).