-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
251 lines (193 loc) · 11.6 KB
/
index.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<link rel="stylesheet" type="text/css" media="screen" href="stylesheets/stylesheet.css">
<meta name="description" content="This project implements the Intel Cilk Plus language extensions in the Clang frontend for LLVM">
<title>Cilk Plus/LLVM</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-17808594-5']);
_gaq.push(['_setDomainName', 'cilkplus.github.io']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!-- HEADER -->
<div id="header_wrap" class="outer">
<div class="inner">
<a id="forkme_banner" href="https://github.com/cilkplus?tab=repositories">View on GitHub</a>
<h1 id="project_title">Cilk Plus/LLVM</h1>
<h2 id="project_tagline">An implementation of the Intel® Cilk™ Plus C/C++ language extensions in LLVM</h2>
<div id="downloads">
<a class="nav_link" href="#try">Try it!</a>
<a class="nav_link" href="#status">Status</a>
<a class="nav_link" href="https://github.com/cilkplus/clang/wiki/Porting-to-other-architectures">Porting</a>
<a class="nav_link" href="#license">License</a>
<a class="nav_link" href="#contact">Contact</a>
</div>
</div>
</div>
<!-- MAIN CONTENT -->
<div id="main_content_wrap" class="outer">
<div id="main_content" class="inner">
<p>Intel® Cilk™ Plus is an extension to the C and C++ languages to support data and task parallelism. It is one of the easiest, quickest way to harness the power of both multicore and vector processing. Visit <a href="http://cilkplus.org">cilkplus.org</a> for details.</p>
<p>This project implements the Intel® Cilk™ Plus language extensions in the <a href="http://clang.llvm.org">Clang</a> frontend for <a href="http://llvm.org">LLVM</a>. There are two other implementations available. A commercial version of Cilk Plus is available as part of the <a href="http://software.intel.com/en-us/intel-composer-xe/">Intel® C++ Composer XE compiler</a>. There is also an open source version available in the "cilkplus" branch of the GCC C/C++ compiler. More information is available on <a href="http://cilkplus.org/which-license">cilkplus.org</a>.</p>
<h1>News</h1>
<p>February 4, 2016</p>
<ul><li>Update to clang/llvm trunk (as of Feb 3 2016)</li>
<li>CMake based build supported for both compiler and CilkPlus runtime (see _build.sh)</li>
<p>December 29, 2015 - Big new update, including:</p>
<ul><li>Update to clang/llvm trunk (as of Dec 2015)</li>
<li>Windows support</li>
<li>Miscalleneous bug fixes</li></ul>
<p>September 17, 2014 - Binary images of the compiler added for both <a href="#downloading">Linux and Mac</a>.<br>
September 05, 2014 - CilkPlus runtime is building directly from CilkPlus runtime site.<br>
June 26, 2014 - re-base to Clang 3.4 done;<br>
Extended Array Notation is fully supported now;<br>
Some bugs fixed.<br>
October 9, 2013 - #pragma simd and SIMD-enabled functions are now supported.<br>
June 7, 2013 - All known exception handling issues have been resolved.<br>
May 7, 2013 - cilk_for is now supported, including #pragma grainsize. The runtime was updated to the <a href="http://cilkplus.org/download#runtime-sources">latest version</a>.</p>
<p><a name="try"></a></p>
<h1>Try Cilk Plus/LLVM</h1>
<p><em>Note: Cilk Plus/LLVM does not yet support all of the Intel® Cilk™ Plus extensions. See <a href="#status">Status</a>.</em></p>
<h3>Requirements</h3>
<p>Most software and hardware requirements are the same as for <a href="http://llvm.org/docs/GettingStarted.html#requirements">LLVM</a>. However, support is currently limited to 64 bit Linux and Mac OS X - see <a href="#status">status</a> for details on supported configurations and known issues.</p>
<p>CMake <em>version 2.8.8 or greater</em> is required to compile compiler-rt when using the recommended build process. Alternatively, it is also possible to use configure/make by following the directions at <a href="http://clang.llvm.org/get_started.html">http://clang.llvm.org/get_started.html</a>.</p>
<h3>Getting the source code</h3>
<pre><code>$ cd where-you-want-llvm-to-live
$ git clone -b cilkplus https://github.com/cilkplus/llvm llvm
$ git clone -b cilkplus https://github.com/cilkplus/clang llvm/tools/clang
$ git clone -b cilkplus https://github.com/cilkplus/compiler-rt llvm/projects/compiler-rt
</code></pre>
<p>The source code structure follows Clang/LLVM: <a href="http://llvm.org/docs/GettingStarted.html">http://llvm.org/docs/GettingStarted.html</a>.</p>
<h3>Building</h3>
<p>The recommended way to build Cilk Plus/LLVM is using CMake. Detailed instructions on how to build Clang/LLVM/Compiler-rt with CMake can be found in the following page: <a href="http://llvm.org/docs/CMake.html">http://llvm.org/docs/CMake.html</a>. In the following command, make sure to replace <code>/install/prefix</code> with the location where you would like to install the binaries.</p>
<pre><code>$ cd llvm
$ mkdir build && cd build
$ cmake -G "Unix Makefiles" -DINTEL_SPECIFIC_CILKPLUS=1 -DCMAKE_INSTALL_PREFIX=/install/prefix -DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD=X86 ..
$ make && make install
</code></pre>
<p>The most important thing here is -DINTEL_SPECIFIC_CILKPLUS=1. Without this define you won't be able to build anything (later we'll change it).</p>
<p>Attention: To run (rather than just compile) code you need to get or build an <a href="https://[email protected]/intelcilkruntime/intel-cilk-runtime">Intel Cilk Runtime</a>.<br>
You can build the runtime using our new script where-you-want-llvm-to-live/llvm/_build.sh. This script intends to help you to configure and build the whole stuff related to the compiler on Linux.</p>
<p><em>Mac OS X</em></p>
<p>The basic steps are the same as above. However, on Mac OS X it is recommended to build with the Clang compiler shipped with the OS. Add the following definitions to the cmake command above.</p>
<pre><code>-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
</code></pre>
<p><em>Windows</em></p>
Follow instructions described on Clang web site:
<li>Use something like -G "Visual Studio 12" to generate MS Studio project files</li>
<li>Use Studio to open file "LLVM.sln" and build project "clang"</li>
Attention: this is preliminary solution for Windows and it will be updated soon.
<h3><a name="downloading"></a>Downloading</h3>
<p>Instead of building from sources you're able simply to download the precompiled image of our compiler related to your OS: <a href="binaries/archive-linux.tar.gz">Linux</a> or <a href="binaries/archive-mac.tar.gz">Mac</a>.<br>
<p>Attention: these images were not updated for the latest sources. We're planning to updatem the images soon and to add Windows image as well.</p>
<h3>Using</h3>
<p>To use the newly installed compiler, add the following to your environment. On Mac OS X, replace LD_LIBRARY_PATH with DYLD_LIBRARY_PATH.</p>
<pre><code>export PATH=/install/prefix/bin:$PATH
export C_INCLUDE_PATH=/install/prefix/include:$C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH=/install/prefix/include:$CPLUS_INCLUDE_PATH
export LIBRARY_PATH=/install/prefix/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=/install/prefix/lib:$LD_LIBRARY_PATH
</code></pre>
<p>When you build a program that uses Intel® Cilk™ Plus extensions, add the following option to enable Cilk Plus support and link to the runtime library.</p>
<pre><code>-fcilkplus
</code></pre>
<h3>A simple program</h3>
<pre><code>#include <cilk/cilk.h>
#include <assert.h>
int fib(int n) {
if (n < 2)
return n;
int a = cilk_spawn fib(n-1);
int b = fib(n-2);
cilk_sync;
return a + b;
}
int main() {
int result = fib(30);
assert(result == 832040);
return 0;
}
</code></pre>
<p>Confirm that the compiler is working correctly by saving the above code code to a file.</p>
<pre><code>$ clang -fcilkplus test.c -o test
$ ./test
</code></pre>
<p>You can check that the code is executing in parallel by using the time command and CILK_NWORKERS environment variable to control the number of workers.</p>
<pre><code>$ CILK_NWORKERS=1 time ./test
$ CILK_NWORKERS=2 time ./test
$ CILK_NWORKERS=4 time ./test
</code></pre>
<p><a name="status"></a></p>
<h1>Status</h1>
<h3>What works right now</h3>
<table>
<thead><tr>
<th>Feature</th>
<th align="center">Supported?</th>
</tr></thead>
<tbody>
<tr>
<td>cilk_spawn, cilk_sync</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
<tr>
<td>cilk_for</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
<tr>
<td>hyperobjects</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
<tr>
<td>#pragma simd</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
<tr>
<td>simd-enabled functions</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
<tr>
<td>array notation</td>
<td align="center"><a href="images/green_check.png" target="_blank"><img src="images/green_check.png" alt="check" title="Yes" style="max-width:100%;"></a></td>
</tr>
</tbody>
</table><h3>Known issues</h3>
<ul>
<li>SIMD-enabled functions and #pragma simd loops are currently not well-vectorized by LLVM.</li>
<li>Cilk_spawn and Windows EH can't be mixed inside one function</li>
</ul><h3>Supported platforms</h3>
<p>OS: Linux, Windows or OS X<br>
Architecture: x86-64</p>
<p><a name="license"></a></p>
<h1>License</h1>
<p>LLVM, Clang, and Compiler-rt are distributed under LLVM's <a href="http://llvm.org/docs/DeveloperPolicy.html#license">"UIUC" BSD-Style license</a>. For details, including information about third-party components, see LICENSE.txt in the code repositories.</p>
<p>The Intel® Cilk™ Plus runtime library is distributed under a <a href="http://opensource.org/licenses/BSD-3-Clause">BSD 3-Clause license</a>.</p>
<p><a name="contact"></a></p>
<h1>Contact</h1>
<p>If you would like to report a bug, or make a feature request, you can submit an issue in Github <a href="https://github.com/cilkplus/clang/issues">here</a>.</p> </div>
</div>
<!-- FOOTER -->
<div id="footer_wrap" class="outer">
<div class="inner">
<p class="inline">© 2012-2013 Intel Corporation.</p>
<ul class="footer_list">
<li class="footer_li"><a href="http://software.intel.com/en-us/articles/optimization-notice">Optimization Notice</a></li>
<li class="footer_li"><a href="http://www.intel.com/sites/corporate/tradmarx.htm">Legal Information</a></li>
<li class="footer_li"><a href="http://www.intel.com/content/www/us/en/privacy/intel-online-privacy-notice-summary.html">Privacy</a></li>
</ul>
<p>Intel and Cilk are trademarks of Intel Corporation in the U.S. and/or other countries.</p>
<p>Slate theme maintained by <a href="https://github.com/jsncostello">Jason Costello</a></p>
</div>
</div>
</body>
</html>