Lecture 12: Executing Alpha

Similar documents
Lecture 11: Alpha (contd)

Semantics and Verification of Software

Polyhedral Operations. Algorithms needed for automation. Logistics

Towards a Memory-Efficient Knapsack DP Algorithm

Pointers. Chapter 8. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Introduction to Mathematical Programming IE406. Lecture 4. Dr. Ted Ralphs

CS671 Parallel Programming in the Many-Core Era

EE/ACM Applications of Convex Optimization in Signal Processing and Communications Lecture 6

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #13. Loops: Do - While

CMSC Introduction to Algorithms Spring 2012 Lecture 7

Concepts of Programming Languages

MidTerm Papers Solved MCQS with Reference (1 to 22 lectures)

Lecture 4: Linear Programming

9/5/15. n Class objectives, goals. n Why Fine grain parallelism? n Equational Programming (intro) Sanjay Rajopadhye Colorado State University

7 Control Structures, Logical Statements

Algorithms. Ch.15 Dynamic Programming

Principles of Programming Languages

CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11

A. Incorrect! You rounded to the nearest ten instead of the nearest tenth. B. Incorrect! Review how to round decimal numbers and try again.

Main approach: always make the choice that looks best at the moment.

Course Overview. Arrays. Static Arrays. Static Arrays. Static Arrays with different lower bound. Static Arrays. PART I: overview material

Sanjay Rajopadhye Colorado State University

Lexical Analysis. Introduction

CS 380 ALGORITHM DESIGN AND ANALYSIS

Today's Topics. CISC 458 Winter J.R. Cordy

Variables. Substitution

Run-time Environments -Part 1

Formal semantics of loosely typed languages. Joep Verkoelen Vincent Driessen

Investigating Mixed-Integer Hulls using a MIP-Solver

Tiling: A Data Locality Optimizing Algorithm

Lecture Notes on Dynamic Programming

Sardar Vallabhbhai Patel Institute of Technology (SVIT), Vasad M.C.A. Department COSMOS LECTURE SERIES ( ) (ODD) Code Optimization

Clipping and Scan Conversion

EECS 477: Introduction to algorithms. Lecture 7

Implementation of Relational Operations

Programming Languages Third Edition. Chapter 10 Control II Procedures and Environments

Compiler Code Generation COMP360

A simple syntax-directed

CSE-321 Programming Languages 2011 Final

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Foundations of Preference-based Queries

Lexical and Syntax Analysis. Abstract Syntax

Syntax-Directed Translation. Lecture 14

7. Introduction to Denotational Semantics. Oscar Nierstrasz

Computing the Integer Points of a Polyhedron

Abstract Syntax Trees & Top-Down Parsing

Abstract Syntax Trees & Top-Down Parsing

Lecture 7: The Untyped Lambda Calculus

Iterative Program Analysis Abstract Interpretation

CS452/552; EE465/505. Clipping & Scan Conversion

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

COP5621 Exam 4 - Spring 2005

Streams, Delayed Evaluation and a Normal Order Interpreter. CS 550 Programming Languages Jeremy Johnson

MIDTERM EXAMINATION - CS130 - Spring 2005

Linear Programming in Small Dimensions

Multi-agent and Semantic Web Systems: Querying

Note that in this definition, n + m denotes the syntactic expression with three symbols n, +, and m, not to the number that is the sum of n and m.

Programming Languages: Lecture 12

Data Dependences and Parallelization

Dynamic Data Structures. John Ross Wallrabenstein

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Abstract Syntax Trees & Top-Down Parsing

Last class. CS Principles of Programming Languages. Introduction. Outline

Optimal ILP and Register Tiling: Analytical Model and Optimization Framework

COMP-421 Compiler Design. Presented by Dr Ioanna Dionysiou

Hutton, Graham and Bahr, Patrick (2016) Cutting out continuations. In: WadlerFest, April 2016, Edinburgh, Scotland.

2. Discovery of Association Rules

MANY signal processing systems, particularly in the multimedia

02157 Functional Programming. Michael R. Ha. Lecture 2: Functions, Types and Lists. Michael R. Hansen

Faculty of Electrical Engineering, Mathematics, and Computer Science Delft University of Technology

CS558 Programming Languages

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy!

Chapter 4 Concepts from Geometry

Hoare triples. Floyd-Hoare Logic, Separation Logic

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007

Comp 204: Computer Systems and Their Implementation. Lecture 22: Code Generation and Optimisation

CS 4110 Programming Languages & Logics. Lecture 17 Programming in the λ-calculus

Review. Loop Fusion Example

3.7 Denotational Semantics

Line Drawing Week 6, Lecture 9

CSE-321 Programming Languages 2010 Final

8/5/10 TODAY'S OUTLINE. Recursion COMP 10 EXPLORING COMPUTER SCIENCE. Revisit search and sorting using recursion. Recursion WHAT DOES THIS CODE DO?

Overview. A normal-order language. Strictness. Recursion. Infinite data structures. Direct denotational semantics. Transition semantics

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

10/18/18. Outline. Semantic Analysis. Two types of semantic rules. Syntax vs. Semantics. Static Semantics. Static Semantics.

Overview. Elements of Programming Languages. Evaluation order. Evaluation order

Object-Oriented Principles and Practice / C++

G Programming Languages - Fall 2012

Writing Evaluators MIF08. Laure Gonnord

RYERSON POLYTECHNIC UNIVERSITY DEPARTMENT OF MATH, PHYSICS, AND COMPUTER SCIENCE CPS 710 FINAL EXAM FALL 97 INSTRUCTIONS

Today. Assignments. Lecture Notes CPSC 326 (Spring 2019) Quiz 2. Lexer design. Syntax Analysis: Context-Free Grammars. HW2 (out, due Tues)

Advanced Compiler Construction Theory And Practice

CSE 311 Lecture 21: Context-Free Grammars. Emina Torlak and Kevin Zatloukal

CMPS 277 Principles of Database Systems. Lecture #11

Parser: SQL parse tree

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Module 02 Lecture - 45 Memoization

5. Semantic Analysis!

Contents. Chapter 1 SPECIFYING SYNTAX 1

G Programming Languages - Fall 2012

Transcription:

High-Performance Embedded Systems-on-a-Chip Lecture 12: Executing Alpha Sanjay Rajopadhye Computer Science, Colorado State University High-Performance Embedded Systems-on-a-Chip p.1/10

Outline Operational Semantics High-Performance Embedded Systems-on-a-Chip p.2/10

Outline Operational Semantics Scanning polyhedra High-Performance Embedded Systems-on-a-Chip p.2/10

Outline Operational Semantics Scanning polyhedra Horrendously inefficient code generation High-Performance Embedded Systems-on-a-Chip p.2/10

Outline Operational Semantics Scanning polyhedra Horrendously inefficient code generation (In)efficient code: allocation memory for domains High-Performance Embedded Systems-on-a-Chip p.2/10

Outline Operational Semantics Scanning polyhedra Horrendously inefficient code generation (In)efficient code: allocation memory for domains Efficient code generation High-Performance Embedded Systems-on-a-Chip p.2/10

Operational Semantics of Alpha (expressions) Expressions denote mappings from indices to values Define a function Type that actually (operationally) computes this mapping. is defined recursively Six syntax rules six cases if otherwise High-Performance Embedded Systems-on-a-Chip p.3/10

"! The function High-Performance Embedded Systems-on-a-Chip p.4/10

" function The! $ &% # $ # High-Performance Embedded Systems-on-a-Chip p.4/10

" )) function The! $ &% # $ # + ' ( '( *) ). +, -.-/- -/-.-/0 if +. High-Performance Embedded Systems-on-a-Chip p.4/10

" )) function The! $ &% # $ # + ' ( '( *) ). +, -.-/- -/-.-/0 if +. 21 High-Performance Embedded Systems-on-a-Chip p.4/10

" )) 3 ) function The! $ &% # $ # + ' ( '( *) ). +, -.-/- -/-.-/0 if +. 21 3 High-Performance Embedded Systems-on-a-Chip p.4/10

" )) 3 ) function The! $ &% # $ # + ' ( '( *) ). +, -.-/- -/-.-/0 if +. 21 3 Var 6 245( High-Performance Embedded Systems-on-a-Chip p.4/10

Semantics of Equations Equations do not denote mappings from indices to values High-Performance Embedded Systems-on-a-Chip p.5/10

Semantics of Equations Equations do not denote mappings from indices to values Denotational Semantics: Equations denote additions to a store of definitions High-Performance Embedded Systems-on-a-Chip p.5/10

Semantics of Equations Equations do not denote mappings from indices to values Denotational Semantics: Equations denote additions to a store of definitions Operational Semantics: High-Performance Embedded Systems-on-a-Chip p.5/10

6 Semantics of Equations Equations do not denote mappings from indices to values Denotational Semantics: Equations denote additions to a store of definitions Operational Semantics: 245( = defun Var High-Performance Embedded Systems-on-a-Chip p.5/10

Semantics of programs (systems) Denotational Semantics: programs denote mappings from input variables to output variables (strict) Operational Semantics: 1. Read Input Variables 2. Compute (Local) and Output Variables 3. Write Output Variables High-Performance Embedded Systems-on-a-Chip p.6/10

7 7 Scanning Polyhedra Given a polyhedron Problem: (generate code to) visit (in lexicographic order) all the integer points in High-Performance Embedded Systems-on-a-Chip p.7/10

Nonstrict Operational Semantics 1. Read Input Variables 2. Write Output Variables (computing only those local variables that are necessary) High-Performance Embedded Systems-on-a-Chip p.8/10

Nonstrict Operational Semantics 1. Read Input Variables 2. Write Output Variables (computing only those local variables that are necessary) this will yield horribly inefficient code High-Performance Embedded Systems-on-a-Chip p.8/10

Improvement Use memoization to avoid recomputation Allocate memory, store previously computed values, and evaluate only (at most) once High-Performance Embedded Systems-on-a-Chip p.9/10

Drawbacks and Improvements Main Drawback: Too many context switches factor of 5 to 8 for simple examples High-Performance Embedded Systems-on-a-Chip p.10/10

Drawbacks and Improvements Main Drawback: Too many context switches factor of 5 to 8 for simple examples Solution: Determine a schedule, and visit the points in the domains of the variables in that order High-Performance Embedded Systems-on-a-Chip p.10/10

Drawbacks and Improvements Main Drawback: Too many context switches factor of 5 to 8 for simple examples Solution: Determine a schedule, and visit the points in the domains of the variables in that order Key issues: How to determine a schedule How to exploit this to generate code (scanning unions of polyhedra) High-Performance Embedded Systems-on-a-Chip p.10/10