Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Section | ||||||||
---|---|---|---|---|---|---|---|---|
The Hetrogeneous Habanero-C (HC) language under development in the Habanero project at Rice University provides and implementation of the Habanero execution model for modern heterogeneous (CPU + GPU) architectures.
OverviewThe Heterogeneous Habanero-C (H2C) language, compiler and runtime framework is specifically desgined to achieve portability, productivity and performance on modern heterogeneous (CPU+ GPU) architectures. The main goal is take a machine indpendent program written in H2C and generate a machine specific executable. Some highlights of H2C include:
H2C requires the underlying platform to support OpenCL. The H2C compiler uses a Machine Description(MDes) file provided by an user or automatically generated by an auto-tuner to generate a target specific executable. H2C uses an offload model wherein the CPU is the host and both CPU and GPU are devices. A short summary of the H2C framework is included below. Details on the underlying implementation technologies can be found in the Habanero publications web page. The H2C implementation is still evolving at an early stage. If you would like to try out H2C, please contact one of the following people: Deepak Majeti, or Vivek Sarkar. H2C Language SummaryThe language constructs are classified into communication, computation and computation constructssynchronization constructs. Constructs forCommunication ConstructsHeterogeneous Habanero-C extends the Habanero asyncconstructs to target modern heterogeneous architectures. The async construct, async, is used to asynchronously transfer the data among multiple devices. One can easily overlap computation with the asynchronous data transfers. The finish statement, finish <stmt>, ensures all the data transfers within <stmt> have completed.
Computation Constructsfor Computationsize Body
-- The semantics of the in clause is the same as in the async case. -- Loop indices in each dimension are specified by the point clause. -- The number of iterations in each dimension is specified by the size clause. -- The tile size is specified by the seq
forasync is lowered and implemented for CPUs in two different ways as follows.
forasync targets heterogeneous platforms by automatically generating host code and OpenCL device code. Note: The semantics of forasync does not include a barrier. An explicit finish must enclose the forasync to synchronize all the iterations.
H2C Compiler and Runtime FrameworkH2C uses a two-step compilation.
Current H2C limitationsThere are some limitations and pitfalls in the current implementation of the HC programming model. These limitations are not inherent to the programming model, but rather are a result of incompleteness in the current compiler or runtime implementation. 1) Pointers to stack variables (including stack-allocated arrays) cannot be reused across "suspendable" points. A suspendable function is a function that can directly or indirectly call a function containing an async statement or a finish statement. A suspendable point is an async statement, the end of a finish statement, or a call to a suspendable function. Work-around: copy these stack variables to the heap. There is no limitation on the reuse of heap pointers across suspendable points. 2) Pointers to HC functions (functions that contain HC constructs or call other HC functions) are not supported in HC. Work-around: only use pointers to C functions. 3) const modifiers are not supported for function parameters or local variables in HC programs. Work-around: remove these 'const' modifiers. The semantics of a correct program will remain unchanged, since the only purpose of the 'const' modifiers is to enforce additional compiler checking. 4) The number of tasks registered on a phaser cannot be larger than the number of worker threads specified with the -nproc option when an HC program is invoked. Otherwise, a deadlock may occur. 5) HC function calls must be in canonical form; either being a statement or being the right hand-side of an assignment.
AcknowledgementPartial support for Habanero-C was provided through the CDSC program of the National Science Foundation with an award in the 2009 Expedition in Computing Program. |
Page Tree |
---|