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
paradigm belonging
the data type concept
expressions and operators
control structures
structuring possibilities
input and output
application areas
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.
if its an architecture only then why it is mentioned as a “language” across different articles on the internet as i mentioned in the first post? Is it a misunderstanding ?
@PTX
PTX = Parallel Thread Execution
as it says :
"This document describes PTX, a low-level parallel thread execution virtual machine and
instruction set architecture (ISA). PTX exposes the GPU as a data-parallel computing device."
Later in chapter 4 it defines the syntax of language … is it the language with no name or can i call it PTXL (Parallel Thread Execution Language) ???
From Wikipedia PTX: “an intermediary assembler language between high level code and that which is sent to the GPU (in Nvidia’s CUDA programming model)”
Is this the programming guide you are referring to ?
Yup, that’s it. If you read that thoroughly, it should answer most of your questions. If not, at least you’ll have more background information to base your research decisions on.
This misunderstanding is because of a proxy marketing war against nvidia.
Rivals say CUDA is difficult language to learn… Thats y NVIDIA was forced to market CUDA as “CUDA - A C like language”. In fact, it is never a language as profquail pointed out. It is an architecture.
from [url=“http://www.nvidia.com/object/cuda_what_is.html”]http://www.nvidia.com/object/cuda_what_is.html[/url] :
“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).