-
Notifications
You must be signed in to change notification settings - Fork 3
/
examples.html
158 lines (153 loc) · 9.29 KB
/
examples.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta name="generator" content="pandoc">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="/style.css">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Raleway:600,800|Open+Sans">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://use.fontawesome.com/c754f00c7e.js"></script>
<!-- <script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script> -->
<title>Accelerate: Examples</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
div.sourceCode { overflow-x: auto; }
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
code > span.dt { color: #902000; } /* DataType */
code > span.dv { color: #40a070; } /* DecVal */
code > span.bn { color: #40a070; } /* BaseN */
code > span.fl { color: #40a070; } /* Float */
code > span.ch { color: #4070a0; } /* Char */
code > span.st { color: #4070a0; } /* String */
code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
code > span.ot { color: #007020; } /* Other */
code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
code > span.fu { color: #06287e; } /* Function */
code > span.er { color: #ff0000; font-weight: bold; } /* Error */
code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
code > span.cn { color: #880000; } /* Constant */
code > span.sc { color: #4070a0; } /* SpecialChar */
code > span.vs { color: #4070a0; } /* VerbatimString */
code > span.ss { color: #bb6688; } /* SpecialString */
code > span.im { } /* Import */
code > span.va { color: #19177c; } /* Variable */
code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code > span.op { color: #666666; } /* Operator */
code > span.bu { } /* BuiltIn */
code > span.ex { } /* Extension */
code > span.pp { color: #bc7a00; } /* Preprocessor */
code > span.at { color: #7d9029; } /* Attribute */
code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
</style>
</head>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/index.html" style="font-family: 'Raleway'; font-weight: 600;">AccelerateHS</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="/get-started.html">Get Started</a></li>
<li><a href="/documentation.html">Documentation</a></li>
<li><a href="/libraries.html">Libraries</a></li>
<li class="active"><a href="/examples.html">Examples</a></li>
<li><a href="/community.html">Community</a></li>
<li><a href="/publications.html">Publications</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="https://github.com/AccelerateHS/accelerate"><i class="fa fa-github fa-lg" aria-hidden="true"></i></a></li>
<li><a href="http://groups.google.com/group/accelerate-haskell"><i class="fa fa-envelope-o fa-lg" aria-hidden="true"></i></a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<body>
<div class="container">
<div class="row">
<div id="TOC" class="well">
<!-- <ul> -->
<!-- <li class="nav-header" id="toctitle">Table of Contents</il> -->
<!-- </ul> -->
<ul>
<li><a href="#examples">Examples</a><ul>
<li><a href="#tutorials">Tutorials</a></li>
<li><a href="#larger-programs">Larger programs</a></li>
</ul></li>
</ul>
</div>
<div class="container">
<h1 id="examples">Examples</h1>
<p>The <a href="https://hackage.haskell.org/package/accelerate-examples">accelerate-examples</a> package demonstrates a range of computational kernels and a few complete (albeit small) applications, as well as a regression test suite. To install it:</p>
<div class="sourceCode"><pre class="sourceCode sh"><code class="sourceCode bash"><span class="ex">cabal</span> install accelerate-examples -fllvm-cpu</code></pre></div>
<p>(Optional) If you have a CUDA capable NVIDIA GPU, add the flag <code>-fllvm-ptx</code> to the above command line in order to enable the <code>accelerate-llvm-ptx</code> backend.</p>
<p>This package includes the regression test suite for Accelerate: <code>accelerate-nofib</code>. In future we would also like to expand this to include benchmarks in order to track performance regressions as well. If you are experiencing problems with Accelerate, try running the test suite (it will take some time) to hopefully narrow down the problem then open a ticket on the <a href="https://github.com/AccelerateHS/accelerate/issues">issue tracker</a>.</p>
<p>Following are a few short example programs demonstrating language features and <a href="/libraries.html">extra libraries</a>.</p>
<h2 id="tutorials">Tutorials</h2>
<p>Short example programs demonstrating particular language operations or libraries.</p>
<ul>
<li><p><a href="/examples/mandelbrot.html">Mandelbrot set</a>: Generation of the classic Mandelbrot set fractal. Topics include:</p>
<ul>
<li>Complex numbers</li>
<li>Creating arrays with the <code>generate</code> operator</li>
<li>Scalar iteration with <code>while</code></li>
<li>Working with colours with the <a href="">colour-accelerate</a> library</li>
<li>Writing BMP images to disk with the <a href="">accelerate-io</a> library</li>
</ul></li>
<li><p><a href="/examples/canny.html">Canny edge detector</a>: Implementation of the Canny edge detection technique to extract edges from images. Topics include:</p>
<ul>
<li>Image processing kernels using the <code>stencil</code> operator</li>
<li>Converting between Accelerate and Repa array representations using the <a href="">accelerate-io</a> library</li>
</ul></li>
<li><p><a href="/examples/fluid.html">Fluid simulation</a>: A simple, interactive, particle-based fluid simulation. Topics include:</p>
<ul>
<li>The <code>stencil</code> operator</li>
<li>Using Haskell as a meta-programming language to help generate the Accelerate program</li>
</ul></li>
<li><p><a href="/examples/nbody.html">N-body simulation</a>: <em>N</em>-body simulation of a group of bodies undergoing gravitational interaction. Demonstrates:</p>
<ul>
<li>Use of <a href="">linear-accelerate</a> library for small vector quantities</li>
<li>Use of <a href="">lens-accelerate</a> library</li>
</ul></li>
<li><p><a href="/examples/ray.html">Ray-tracer</a>: A simple real-time ray-tracer. Demonstrates:</p>
<ul>
<li>Use of <a href="">linear-accelerate</a> library</li>
<li>Defining new data types for use within Accelerate programs</li>
</ul></li>
</ul>
<h2 id="larger-programs">Larger programs</h2>
<ul>
<li><a href="/examples/lulesh.html">LULESH</a>: Implementation of the Livermore Unstructured Lagrangian Explicit Shock Hydrodynamics proxy application.</li>
</ul>
</div>
</div>
</div>
<footer class="footer">
<div class="container text-center">
<p class="text-muted">
<a href="https://github.com/AccelerateHS/accelerate">GitHub Project</a> ·
<a href="https://github.com/AccelerateHS/accelerate/issues">Issue Tracker</a> ·
<a href="http://groups.google.com/group/accelerate-haskell">Mailing List</a>
</p>
</div>
</footer>
</body>
</html>