3,462 research outputs found

    C Language Extensions for Hybrid CPU/GPU Programming with StarPU

    Get PDF
    Modern platforms used for high-performance computing (HPC) include machines with both general-purpose CPUs, and "accelerators", often in the form of graphical processing units (GPUs). StarPU is a C library to exploit such platforms. It provides users with ways to define "tasks" to be executed on CPUs or GPUs, along with the dependencies among them, and by automatically scheduling them over all the available processing units. In doing so, it also relieves programmers from the need to know the underlying architecture details: it adapts to the available CPUs and GPUs, and automatically transfers data between main memory and GPUs as needed. While StarPU's approach is successful at addressing run-time scheduling issues, being a C library makes for a poor and error-prone programming interface. This paper presents an effort started in 2011 to promote some of the concepts exported by the library as C language constructs, by means of an extension of the GCC compiler suite. Our main contribution is the design and implementation of language extensions that map to StarPU's task programming paradigm. We argue that the proposed extensions make it easier to get started with StarPU,eliminate errors that can occur when using the C library, and help diagnose possible mistakes. We conclude on future work

    Common Subexpression Elimination in a Lazy Functional Language

    Get PDF
    Common subexpression elimination is a well-known compiler optimisation that saves time by avoiding the repetition of the same computation. To our knowledge it has not yet been applied to lazy functional programming languages, although there are several advantages. First, the referential transparency of these languages makes the identification of common subexpressions very simple. Second, more common subexpressions can be recognised because they can be of arbitrary type whereas standard common subexpression elimination only shares primitive values. However, because lazy functional languages decouple program structure from data space allocation and control flow, analysing its effects and deciding under which conditions the elimination of a common subexpression is beneficial proves to be quite difficult. We developed and implemented the transformation for the language Haskell by extending the Glasgow Haskell compiler and measured its effectiveness on real-world programs

    Certifying cost annotations in compilers

    Get PDF
    We discuss the problem of building a compiler which can lift in a provably correct way pieces of information on the execution cost of the object code to cost annotations on the source code. To this end, we need a clear and flexible picture of: (i) the meaning of cost annotations, (ii) the method to prove them sound and precise, and (iii) the way such proofs can be composed. We propose a so-called labelling approach to these three questions. As a first step, we examine its application to a toy compiler. This formal study suggests that the labelling approach has good compositionality and scalability properties. In order to provide further evidence for this claim, we report our successful experience in implementing and testing the labelling approach on top of a prototype compiler written in OCAML for (a large fragment of) the C language

    Description and Optimization of Abstract Machines in a Dialect of Prolog

    Full text link
    In order to achieve competitive performance, abstract machines for Prolog and related languages end up being large and intricate, and incorporate sophisticated optimizations, both at the design and at the implementation levels. At the same time, efficiency considerations make it necessary to use low-level languages in their implementation. This makes them laborious to code, optimize, and, especially, maintain and extend. Writing the abstract machine (and ancillary code) in a higher-level language can help tame this inherent complexity. We show how the semantics of most basic components of an efficient virtual machine for Prolog can be described using (a variant of) Prolog. These descriptions are then compiled to C and assembled to build a complete bytecode emulator. Thanks to the high level of the language used and its closeness to Prolog, the abstract machine description can be manipulated using standard Prolog compilation and optimization techniques with relative ease. We also show how, by applying program transformations selectively, we obtain abstract machine implementations whose performance can match and even exceed that of state-of-the-art, highly-tuned, hand-crafted emulators.Comment: 56 pages, 46 figures, 5 tables, To appear in Theory and Practice of Logic Programming (TPLP

    The GCC Monetary Union: Choice of Exchange Rate Regime

    Get PDF
    The creation of a monetary union has been the primary objective of the Gulf Cooperation Council (GCC) members since the early 1980s. Significant progress has already been made in regional economic integration: The GCC countries have largely unrestricted intraregional mobility of goods, labor, and capital; regulation of the banking sector is being harmonized; and in 2008 the countries established a common market. Further, most of the convergence criteria established for entry into a monetary union have already been achieved. In establishing a monetary union, however, the GCC countries must decide on the exchange rate regime for the single currency. The countries’ use of a US dollar peg as an external anchor for monetary policy has so far served them well, but rising inflation and differing economic cycles from the United States in recent years has raised the question of whether the dollar peg remains the best policy. Mohsin Khan considers the costs and benefits of alternative exchange rate regimes for the GCC. These include continued use of a dollar peg, a peg to a basket of currencies such as the SDR or simply the dollar and euro, a peg to the export price of oil, and a managed floating exchange rate. In light of the structural characteristics of the GCC countries, Khan considers the dollar peg the best option following the establishment of a GCC monetary union. The peg has proved credible and is easy to administer. If further international integration in trade, services, and asset markets makes a higher degree of exchange rate flexibility desirable in the future, implementing a basket peg could provide this flexibility. Regardless, the choice of exchange rate regime for the GCC countries need not be permanent: The countries could initially peg the single GCC currency to the US dollar and then move to a more flexible regime as their policy needs and institutions develop.Exchange rate regimes, monetary unions, Gulf Cooperation Council
    corecore