Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
melsman committed Nov 21, 2016
1 parent f005830 commit fc0b986
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,15 @@ \section{Structure of the Book}
backend and the parallel GPU backend. In Chapter~\ref{chap:costmodel}, we introduce
an ``ideal'' cost model for the Futhark language based on the notions
of work and span. In Chapter~\ref{chap:soac-algebra}, we present to
the reader the underlying algebraic reasoning principles that lye
the reader the underlying algebraic reasoning principles that lie
behind the Futhark internal fusion technology. In particular, we
introduce the reader to the list-homorphism theorem, which forms the
basis of map-reduce reasoning and which turns out to play an important
role in the fusion engine of Futhark.

In Part~2 of the book, ...
In Part~2 of the book, we present a number of parallel algorithms that
can be used as building blocks for programming more complex parallel
programs.

\chapter{The Futhark Language}
\label{chap:futlang}
Expand Down Expand Up @@ -642,8 +644,8 @@ \section{Array Operations}
integers:

\begin{lstlisting}
fun dotProd (xs: []int) (ys: []int): []int =
reduce (+) 0 (zipWith (+) xs ys)
fun dotProd (xs: []int) (ys: []int): int =
reduce (+) 0 (zipWith (*) xs ys)
\end{lstlisting}

A close cousin of \texttt{reduce} is \texttt{scan}, often called
Expand All @@ -655,10 +657,10 @@ \section{Array Operations}
scan (+) 0 [1,2,3] == [0+1, 0+1+2, 0+1+2+3] == [1, 3, 6]
\end{lstlisting}

Intuitively, the result of \texttt{scan} is an array of calling
Intuitively, the result of \texttt{scan} is an array of the results of calling
\texttt{reduce} on increasing prefixes of the input array. The last
element of the returned array is equivalent to the result of calling
\texttt{reduce} Like with \texttt{reduce}, the operator given to
\texttt{reduce}. Like with \texttt{reduce}, the operator given to
\texttt{scan} must be associative and have a neutral element.

There are two main ways to compute scans: \textit{exclusive} and
Expand Down

0 comments on commit fc0b986

Please sign in to comment.