Source-To-Source Automatic Program Transformations for GPU-Like Hardware Accelerators Mehdi Amini
Total Page:16
File Type:pdf, Size:1020Kb
Load more
Recommended publications
-
When Is a Microprocessor Not a Microprocessor? the Industrial Construction of Semiconductor Innovation I
Ross Bassett When is a Microprocessor not a Microprocessor? The Industrial Construction of Semiconductor Innovation I In the early 1990s an integrated circuit first made in 1969 and thus ante dating by two years the chip typically seen as the first microprocessor (Intel's 4004), became a microprocessor for the first time. The stimulus for this piece ofindustrial alchemy was a patent fight. A microprocessor patent had been issued to Texas Instruments, and companies faced with patent infringement lawsuits were looking for prior art with which to challenge it. 2 This old integrated circuit, but new microprocessor, was the ALl, designed by Lee Boysel and used in computers built by his start-up, Four-Phase Systems, established in 1968. In its 1990s reincarnation a demonstration system was built showing that the ALI could have oper ated according to the classic microprocessor model, with ROM (Read Only Memory), RAM (Random Access Memory), and I/O (Input/ Output) forming a basic computer. The operative words here are could have, for it was never used in that configuration during its normal life time. Instead it was used as one-third of a 24-bit CPU (Central Processing Unit) for a series ofcomputers built by Four-Phase.3 Examining the ALl through the lenses of the history of technology and business history puts Intel's microprocessor work into a different per spective. The differences between Four-Phase's and Intel's work were industrially constructed; they owed much to the different industries each saw itselfin.4 While putting a substantial part ofa central processing unit on a chip was not a discrete invention for Four-Phase or the computer industry, it was in the semiconductor industry. -
Pattern Matching
Functional Programming Steven Lau March 2015 before function programming... https://www.youtube.com/watch?v=92WHN-pAFCs Models of computation ● Turing machine ○ invented by Alan Turing in 1936 ● Lambda calculus ○ invented by Alonzo Church in 1930 ● more... Turing machine ● A machine operates on an infinite tape (memory) and execute a program stored ● It may ○ read a symbol ○ write a symbol ○ move to the left cell ○ move to the right cell ○ change the machine’s state ○ halt Turing machine Have some fun http://www.google.com/logos/2012/turing-doodle-static.html http://www.ioi2012.org/wp-content/uploads/2011/12/Odometer.pdf http://wcipeg.com/problems/desc/ioi1211 Turing machine incrementer state symbol action next_state _____ state 0 __1__ state 1 0 _ or 0 write 1 1 _10__ state 2 __1__ state 1 0 1 write 0 2 _10__ state 0 __1__ state 0 _00__ state 2 1 _ left 0 __0__ state 2 _00__ state 0 __0__ state 0 1 0 or 1 right 1 100__ state 1 _10__ state 1 2 0 left 0 100__ state 1 _10__ state 1 100__ state 1 _10__ state 1 100__ state 1 _10__ state 0 100__ state 0 _11__ state 1 101__ state 1 _11__ state 1 101__ state 1 _11__ state 0 101__ state 0 λ-calculus Beware! ● think mathematical, not C++/Pascal ● (parentheses) are for grouping ● variables cannot be mutated ○ x = 1 OK ○ x = 2 NO ○ x = x + 1 NO λ-calculus Simplification 1 of 2: ● Only anonymous functions are used ○ f(x) = x2+1 f(1) = 12+1 = 2 is written as ○ (λx.x2+1)(1) = 12+1 = 2 note that f = λx.x2+1 λ-calculus Simplification 2 of 2: ● Only unary functions are used ○ a binary function can be written as a unary function that return another unary function ○ (λ(x,y).x+y)(1,2) = 1+2 = 3 is written as [(λx.(λy.x+y))(1)](2) = [(λy.1+y)](2) = 1+2 = 3 ○ this technique is known as Currying Haskell Curry λ-calculus ● A lambda term has 3 forms: ○ x ○ λx.A ○ AB where x is a variable, A and B are lambda terms. -
Lambda Calculus and Functional Programming
Global Journal of Researches in Engineering Vol. 10 Issue 2 (Ver 1.0) June 2010 P a g e | 47 Lambda Calculus and Functional Programming Anahid Bassiri1Mohammad Reza. Malek2 GJRE Classification (FOR) 080299, 010199, 010203, Pouria Amirian3 010109 Abstract-The lambda calculus can be thought of as an idealized, Basis concept of a Turing machine is the present day Von minimalistic programming language. It is capable of expressing Neumann computers. Conceptually these are Turing any algorithm, and it is this fact that makes the model of machines with random access registers. Imperative functional programming an important one. This paper is programming languages such as FORTRAN, Pascal etcetera focused on introducing lambda calculus and its application. As as well as all the assembler languages are based on the way an application dikjestra algorithm is implemented using a Turing machine is instructed by a sequence of statements. lambda calculus. As program shows algorithm is more understandable using lambda calculus in comparison with In addition functional programming languages, like other imperative languages. Miranda, ML etcetera, are based on the lambda calculus. Functional programming is a programming paradigm that I. INTRODUCTION treats computation as the evaluation of mathematical ambda calculus (λ-calculus) is a useful device to make functions and avoids state and mutable data. It emphasizes L the theories realizable. Lambda calculus, introduced by the application of functions, in contrast with the imperative Alonzo Church and Stephen Cole Kleene in the 1930s is a programming style that emphasizes changes in state. formal system designed to investigate function definition, Lambda calculus provides a theoretical framework for function application and recursion in mathematical logic and describing functions and their evaluation. -
Purity in Erlang
Purity in Erlang Mihalis Pitidis1 and Konstantinos Sagonas1,2 1 School of Electrical and Computer Engineering, National Technical University of Athens, Greece 2 Department of Information Technology, Uppsala University, Sweden [email protected], [email protected] Abstract. Motivated by a concrete goal, namely to extend Erlang with the abil- ity to employ user-defined guards, we developed a parameterized static analysis tool called PURITY, that classifies functions as referentially transparent (i.e., side- effect free with no dependency on the execution environment and never raising an exception), side-effect free with no dependencies but possibly raising excep- tions, or side-effect free but with possible dependencies and possibly raising ex- ceptions. We have applied PURITY on a large corpus of Erlang code bases and report experimental results showing the percentage of functions that the analysis definitely classifies in each category. Moreover, we discuss how our analysis has been incorporated on a development branch of the Erlang/OTP compiler in order to allow extending the language with user-defined guards. 1 Introduction Purity plays an important role in functional programming languages as it is a corner- stone of referential transparency, namely that the same language expression produces the same value when evaluated twice. Referential transparency helps in writing easy to test, robust and comprehensible code, makes equational reasoning possible, and aids program analysis and optimisation. In pure functional languages like Clean or Haskell, any side-effect or dependency on the state is captured by the type system and is reflected in the types of functions. In a language like ERLANG, which has been developed pri- marily with concurrency in mind, pure functions are not the norm and impure functions can freely be used interchangeably with pure ones. -
(February 2 , 2015) If You Know Someone Who You Think Would
(February 2nd, 2015) If you know someone who you think would benefit from being an Insider, feel free to forward this PDF to them so they can sign up here. Quick Tips for our Insider friends! Hey Insiders, It’s the 100th newsletter!! I’ve been producing these newsletters since March 2011 – wow! To celebrate this milestone, I’ve put together some cool stuff for you: A Pluralsight giveaway. The first 100 people to respond to the newsletter email asking for a Pluralsight code will get 30-days of access to all 120+ hours of SQLskills online training for free. No catches, no credit cards. Go! My top-ten books of all time as well as my regular book review 100 SQL Server (and career) hints, tips, and tricks from the SQLskills team in my Paul’s Ponderings section. And the usual demo video, by me for a change. This newsletter is *looooong* this time! Grab a cup of coffee and settle in for a great ride. We’ve done eleven remote and in-person user group presentations this year already, to a combined audience of more than 1,100 people in the SQL community, and Glenn’s presenting remotely in Israel as this newsletter is hitting your inbox. Go community! I recently won the “Person You’d Most Like to be Mentored By” community award in the annual Redgate Tribal Awards. Thanks! To celebrate, I’m offering to mentor 3 men and 3 women through March and April. See this post for how to enter to be considered. I made it to the fantastic Living Computer Museum in Seattle over the weekend, which has a ton of cool old computers, many from DEC where I worked before Microsoft. -
Silicon Valley's Hi-Tech Heritage: Apple Park Visitor Center And
Silicon Valley’s Hi-Tech Heritage: Apple Park Visitor Center and Three Great Museums Tell the Computer and Technology Story By Lee Foster Author’s Note: This article “Silicon Valley’s Hi-Tech Heritage: Apple Park Visitor Center and Three Great Museums Tell the Computer and Technology Story” is a chapter in my new book/ebook Northern California History Travel Adventures: 35 Suggested Trips. The subject is also covered in my book/ebook Northern California Travel: The Best Options. That book is available in English as a book/ebook and also as an ebook in Chinese. Several of my books on California can be seen on my Amazon Author Page. In Brief In California’s Silicon Valley, you can learn about the computer and technology revolution that is affecting the world today. For instance, the story comes alive at the new Apple Park Visitor Center in Cupertino. In addition you can visit three great museums located, appropriately, in this Northern California epicenter of innovation. These high-tech revolutions have altered the face of San Jose and the Silicon Valley. You find the area, which is 30-50 miles south of San Francisco. It stretches along the western and southern edge of San Francisco Bay. My Osborne Computer, 1980, a copy of which can be seen at the Computer History Museum Originally a bucolic ranching region, San Jose began as a small pueblo and Spanish mission in the 18th century. In the 19th and early 20th centuries, the valley developed as one of the most important fruit-growing areas in the United States. -
Everything Matters
Everything intel.com/go/responsibility Matters Global Citizenship Report 2003 Contents Executive Summary 3 Everything Adds Up Corporate Performance 4 Organizational Profile 6 Everywhere Matters 8 Stakeholder Relationships 10 Performance Summary 11 Goals & Targets 12 Ethics & Compliance 13 Economic Performance Environment, Health & Safety 14 Every Effort Contributes 16 Performance Indicators 18 Inspections & Compliance 19 Workplace Health & Safety 20 Environmental Footprint 22 Product Ecology 23 EHS Around the World Social Programs & Performance 24 Everyone Counts 26 Workplace Environment 31 Everyone Has a Say 32 Diversity 34 Education 36 Technology in the Community 37 Contributing to the Community 38 External Recognition 39 Intel: 35 Years of Innovation GRI Content Table Section # GRI Section Intel Report Reference Page # 1.1 Vision & Strategy Executive Summary 3 1.2 CEO Statement Executive Summary 3 2.1– 2.9 Organizational Profile Organizational Profile, Stakeholder Relationships 4–9 2.10– 2.16 Report Scope Report Scope & Profile 2 2.17– 2.22 Report Profile Report Scope & Profile 2 3.1– 3.8 Structure & Governance Ethics & Compliance 12 3.9– 3.12 Stakeholder Engagement Stakeholder Relationships 8–9 3.13– 3.20 Overarching Policies & Management Systems Ethics & Compliance, For More Information 12, 40 4.1 GRI Content Index GRI Content Table 2 Performance Summary 2003 Performance, 2004 Goals & Targets 10–11 5.0 Economic Performance Indicators Economic Performance 13 5.0 Environmental Performance Indicators Environment, Health & Safety 14– 23 5.0 Social Performance Indicators Social Programs & Performance 24–37 Report Scope and Profile: This report, addressing Intel’s worldwide operations, was published in May 2004. The report contains data from 2001 through 2003. -
Computer Architectures an Overview
Computer Architectures An Overview PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sat, 25 Feb 2012 22:35:32 UTC Contents Articles Microarchitecture 1 x86 7 PowerPC 23 IBM POWER 33 MIPS architecture 39 SPARC 57 ARM architecture 65 DEC Alpha 80 AlphaStation 92 AlphaServer 95 Very long instruction word 103 Instruction-level parallelism 107 Explicitly parallel instruction computing 108 References Article Sources and Contributors 111 Image Sources, Licenses and Contributors 113 Article Licenses License 114 Microarchitecture 1 Microarchitecture In computer engineering, microarchitecture (sometimes abbreviated to µarch or uarch), also called computer organization, is the way a given instruction set architecture (ISA) is implemented on a processor. A given ISA may be implemented with different microarchitectures.[1] Implementations might vary due to different goals of a given design or due to shifts in technology.[2] Computer architecture is the combination of microarchitecture and instruction set design. Relation to instruction set architecture The ISA is roughly the same as the programming model of a processor as seen by an assembly language programmer or compiler writer. The ISA includes the execution model, processor registers, address and data formats among other things. The Intel Core microarchitecture microarchitecture includes the constituent parts of the processor and how these interconnect and interoperate to implement the ISA. The microarchitecture of a machine is usually represented as (more or less detailed) diagrams that describe the interconnections of the various microarchitectural elements of the machine, which may be everything from single gates and registers, to complete arithmetic logic units (ALU)s and even larger elements. -
Deep Dive Into Programming with CAPS HMPP Dev-Deck
Introduction to HMPP Hybrid Manycore Parallel Programming Московский государственный университет, Лоран Морен, 30 август 2011 Hybrid Software for Hybrid Hardware • The application should stay hardware resilient o New architectures / languages to master o Hybrid solutions evolve: we don‟t want to redo the work each time • Kernel optimizations are the key to get performance o An hybrid application must get the best of its hardware resources 30 август 2011 Москва - Лоран Морен 2 Methodology to Port Applications Methodology to Port Applications Hotspots Parallelization •Optimize CPU code •Performance goal •Exhibit Parallelism •Validation process •Move kernels to GPU •Hotspots selection •Continuous integration Define your Port your Hours to Days parallel application Days to Weeks project on GPU GPGPU operational Phase 1 application with known potential Phase 2 Tuning Optimize your GPGPU •Exploit CPU and GPU application •Optimize kernel execution •Reduce CPU-GPU data transfers Weeks to Months 30 август 2011 Москва - Лоран Морен 4 Take a decision • Go • Dense hotspot • Fast GPU kernels • Low CPU-GPU data transfers • Midterm perspective: Prepare to manycore parallelism • No Go o Flat profile o GPU results not accurate enough • cannot validate the computation o Slow GPU kernels • i.e. no speedup to be expected o Complex data structures o Big memory space requirement 30 август 2011 Москва - Лоран Морен 5 Tools in the Methodology Hotspots Parallelization • Profiling tools Gprof, Kachegrind, Vampir, Acumem, ThreadSpotter •HMPP Workbench •Debugging -
The Quantum IO Monad Thorsten Altenkirch and Alexander S
1 The Quantum IO Monad Thorsten Altenkirch and Alexander S. Green School of Computer Science, The University of Nottingham Abstract The Quantum IO monad is a purely functional interface to quantum programming implemented as a Haskell library. At the same time it provides a constructive semantics of quantum programming. The QIO monad separates reversible (i.e. unitary) and irreversible (i.e. prob- abilistic) computations and provides a reversible let operation (ulet), allowing us to use ancillas (auxiliary qubits) in a modular fashion. QIO programs can be simulated either by calculating a probability distribu- tion or by embedding it into the IO monad using the random number generator. As an example we present a complete implementation of Shor’s algorithm. 1.1 Introduction We present an interface from a pure functional programming language, Haskell, to quantum programming: the Quantum IO monad, and use it to implement Shor’s factorisation algorithm. The implementation of the QIO monad provides a constructive semantics for quantum programming, i.e. a functional program which can also be understood as a mathematical model of quantum computing. Actually, the Haskell QIO library is only a first approximation of such a semantics, we would like to move to a more expressive language which is also logically sound. Here we are thinking of a language like Agda (Norell (2007)), which is based on Martin L¨of’s Type Theory. We have already investigated this approach of functional specifications of effects in a classical context (Swierstra and Altenkirch (2007, 2008); Swierstra (2008)). At the same 1 2 Thorsten Altenkirch and Alexander S. -
Why Functional Programming Is Good … …When You Like Math - Examples with Haskell
Why functional programming is good … …when you like math - examples with Haskell . Jochen Schulz Georg-August Universität Göttingen 1/18 Table of contents 1. Introduction 2. Functional programming with Haskell 3. Summary 1/18 Programming paradigm imperative (e.g. C) object-oriented (e.g. C++) functional (e.g. Haskell) (logic) (symbolc) some languages have multiple paradigm 2/18 Side effects/pure functions . side effect . Besides the return value of a function it has one or more of the following modifies state. has observable interaction with outside world. pure function . A pure function always returns the same results on the same input. has no side-effect. .also refered to as referential transparency pure functions resemble mathematical functions. 3/18 Functional programming emphasizes pure functions higher order functions (partial function evaluation, currying) avoids state and mutable data (Haskell uses Monads) recursion is mostly used for loops algebraic type system strict/lazy evaluation (often lazy, as Haskell) describes more what is instead what you have to do 4/18 Table of contents 1. Introduction 2. Functional programming with Haskell 3. Summary 5/18 List comprehensions Some Math: S = fx2jx 2 N; x2 < 20g > [ x^2 | x <- [1..10] , x^2 < 20 ] [1,4,9,16] Ranges (and infinite ranges (don’t do this now) ) > a = [1..5], [1,3..8], ['a'..'z'], [1..] [1,2,3,4,5], [1,3,5,7], "abcdefghijklmnopqrstuvwxyz" usually no direct indexing (needed) > (head a, tail a, take 2 a, a !! 2) (1,[2,3,4,5],[1,2],3) 6/18 Functions: Types and Typeclasses Types removeNonUppercase :: [Char] -> [Char] removeNonUppercase st = [ c | c <- st, c `elem ` ['A'..'Z']] Typeclasses factorial :: (Integral a) => a -> a factorial n = product [1..n] We also can define types and typeclasses and such form spaces. -
Function Programming in Python
Functional Programming in Python David Mertz Additional Resources 4 Easy Ways to Learn More and Stay Current Programming Newsletter Get programming related news and content delivered weekly to your inbox. oreilly.com/programming/newsletter Free Webcast Series Learn about popular programming topics from experts live, online. webcasts.oreilly.com O’Reilly Radar Read more insight and analysis about emerging technologies. radar.oreilly.com Conferences Immerse yourself in learning at an upcoming O’Reilly conference. conferences.oreilly.com ©2015 O’Reilly Media, Inc. The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. #15305 Functional Programming in Python David Mertz Functional Programming in Python by David Mertz Copyright © 2015 O’Reilly Media, Inc. All rights reserved. Attribution-ShareAlike 4.0 International (CC BY-SA 4.0). See: http://creativecommons.org/licenses/by-sa/4.0/ Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safaribooksonline.com). For more information, contact our corporate/institutional sales department: 800-998-9938 or [email protected]. Editor: Meghan Blanchette Interior Designer: David Futato Production Editor: Shiny Kalapurakkel Cover Designer: Karen Montgomery Proofreader: Charles Roumeliotis May 2015: First Edition Revision History for the First Edition 2015-05-27: First Release The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Functional Pro‐ gramming in Python, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc.