<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-410844370589841835</id><updated>2024-10-25T00:58:11.563-07:00</updated><category term="GObject-Learning"/><category term="compiler"/><category term="OpenEmbedded"/><category term="gitorious"/><category term="llvm"/><category term="ruby"/><category term="server"/><category term="tutorial"/><category term="ubuntu"/><title type='text'>e l p a M</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.maple.tw/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-7254516833881945261</id><published>2016-09-21T00:13:00.002-07:00</published><updated>2016-09-21T00:13:52.615-07:00</updated><title type='text'>LAB - Understand FPGA OpenCL</title><content type='html'>&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Goals &lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Patrice the emulation development environment&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Understand Task (Single Work-Item) v.s. NDRange&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Understand Loop Pipeline&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;* Understand Coalescing&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;b id=&quot;docs-internal-guid-c1b88317-4b97-830c-06f3-be3063f420b9&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Prerequisite&lt;/span&gt;&lt;/h2&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;a.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;PC requirement:&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;64Bit CPU / &amp;gt;4G DDR&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Win7 or Ubuntu 16.04 or other version&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;b.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;About install PC environment&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: red; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Obtain Licenses for Quartus , Altera SDK for OpenCL and PR (Partial Reconfiguration), set LM_LICENSE_FILE environment variable to the license&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Install the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Quartus II software v. &lt;/span&gt;&lt;span style=&quot;background-color: white; color: red; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;16.0 &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;standard edition&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; (including &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Arria10 , Stratix V and Cyclone V&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; device families) &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Please install at &lt;/span&gt;&lt;span style=&quot;background-color: white; color: red; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;c:\altera\16.0 &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(for run script later, otherwise you need modify the .bat in the test project)&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;https://www.altera.com/downloads/download-center.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://www.altera.com/downloads/download-center.html#&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;289&quot; src=&quot;https://lh6.googleusercontent.com/-DkICLd5Eptapk5TIJytnRao8U9ueg5keUSM5rP3wNOtRX9jp3dJflI5qvadTEjRMlxDud-Ae-trb4wJzXau75k0LEjHAf-P1B1IQMfwxpRW0rKDJ3KjEhaB0sMCK8u1SJPUxXeH&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;503&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;3&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Download and install the Altera SDK for OpenCL version &lt;/span&gt;&lt;span style=&quot;background-color: white; color: red; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;16.0&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://www.altera.com/downloads/download-center.html&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://www.altera.com/downloads/download-center.html&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Times New Roman&#39;; font-size: 9.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;276&quot; src=&quot;https://lh6.googleusercontent.com/Sts7JAoJTBvRIOy7UpMmKHNB3pwvoOa331NW4wt568SwadRzuEXdREPjwnFLnZAmFD49sezDwBEdBp7aPdIVY_0cSYMTNOePs3iqYW-cYE6NMKMIu1H1wogqH6bJiR-XPlhfJC-o&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;484&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol start=&quot;4&quot; style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Compiler Environment &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Windows : Install the &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Visual C++ 2010 Express&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; version of Microsoft Visual Studio with support for C++ from&lt;/span&gt;&lt;a href=&quot;http://www.microsoft.com/visualstudio/eng/downloads&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.microsoft.com/visualstudio/eng/downloads&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Professional version is OK if you have a license for that.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Linux :&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: square; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Use “apt-get install build-essential” to prepare build environment&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/ol&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;If you do NOT have Visual C++ Professional&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Open the Programs &amp;amp; Features control panel in Windows 7. &amp;nbsp;Manually uninstall all Microsoft Visual C++ 2010 programs that have the word “Redistributable” in them, both x64 and x86 versions&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Download and install &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Microsoft Windows SDK Version 7.1&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; from &lt;/span&gt;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=8279&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=8279&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; . This software allows the compilation of 64-bit executables that are needed for the Altera OpenCL solution&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Also, you do &lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; need Intel SDK for OpenCL anymore&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Before start the Lab day. Please make sure can understand PSG OpenCL emulator mode&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: white; color: #222222; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;https://www.altera.com/en_US/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: white; color: #1155cc; font-family: Arial; font-size: 12.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://www.altera.com/en_US/pdfs/literature/hb/opencl-sdk/aocl_programming_guide.pdf&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/opencl-sdk/aocl_getting_started.pdf&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/opencl-sdk/aocl_getting_started.pdf&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/ol&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Introduction&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;OpenCL allows developers to write portable, high-performance code that can target all varieties of parallel processing platforms, including Intel CPUs, FPGAs and GPUs. Programming OpenCL on FPGA is much different in Programming OpenCL on GPUs. By leveraging loop-pipeline features, Sequential execution is accepted in many cases to get simple performance improvement. &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;This article discusses simple reductions. A reduction is a very simple operation that takes an array of data and reduces it down to a single element, for example – by summing all the elements in the array. Consider this simple CPU-C code, which sums all the elements in an array:&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 7pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;float reduce_cpu_sum(float* input, int length) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;float accumulator = input[0];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;for(int i = 1; i &amp;lt; length; i++) &lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;accumulator += input[i];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;return accumulator;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;This code is completely sequential! There’s no way to parallelize the loop, since every iteration of the loop depends on the iteration before it. How can we loop-pipeline it? How can we parallelize this code? &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Hope all attendee can understand NDRange and Task implementation through this hands-on.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Lab1 - Task and Loop-pipelined Version&lt;/span&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Verdana; font-size: 13.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;CPU version&lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 7pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;float reduce_cpu_sum(float* input, int length) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;float accumulator = input[0];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;for(int i = 1; i &amp;lt; length; i++) &lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;accumulator += input[i];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;return accumulator;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;Idea - in the above code, length is undetermined variable so compiler can’t unroll the for-loop correctly. We can divide DATA into const-M parts. And wrap the original for-loop by another for-loop with const-M. Each iteration handle length/const-M data, accumulate them and save it into local memory. After that, we can accumulate the local memory again.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Since compiler knows the const-M in compiler times, Compiler can unroll this wrapper for-loop automatically (or manually).&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;307&quot; src=&quot;https://docs.google.com/drawings/d/sIRX1BWgRDWvMwl7LBMu5ng/image?w=602&amp;amp;h=307&amp;amp;rev=408&amp;amp;ac=1&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; Advanced Topics - Running on the real device.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;To speed up the simulation time, we let DATA_N be a small number 1000. Please increase this number to 1000000 and test the total performance.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Hands-on -&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; implement above algorithm &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Advanced Topics -&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Running on the real device.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Compare the performance with Lab1.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Lab2 - Loop-pipelined Version and Memory access patterns&lt;/span&gt;&lt;/h2&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;In the previous code. To speed-up the performance, we unroll the level-1 for-loop in previous code. Since we have 0….M accumulator and global memory read instructions. The memory access pattern is shown below :&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;195&quot; src=&quot;https://docs.google.com/drawings/d/sAAbibzOhi28BVFZMYwz4uw/image?w=602&amp;amp;h=195&amp;amp;rev=1&amp;amp;ac=1&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; The access pattern is interleave and not continuous. It will cause cache penalty. &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;175&quot; src=&quot;https://docs.google.com/drawings/d/sAALOsOyoweW8iS3RnK5YAw/image?w=602&amp;amp;h=175&amp;amp;rev=197&amp;amp;ac=1&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; To improve cache performance and hit rate. We can change the access pattern from above to below - &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;175&quot; src=&quot;https://docs.google.com/drawings/d/sd3e-Gs755_3GmHWWS9CVNg/image?w=602&amp;amp;h=175&amp;amp;rev=36&amp;amp;ac=1&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Hands-on -&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; implement above algorithm &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Advanced Topics -&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Running on the real device.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Compare the performance with Lab1.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Lab3 - NDrange Version (Optional)&lt;/span&gt;&lt;/h2&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; At the OpenCL work-group level. We’ll take advantage of associativity to break the vector into small chunks, each of which we’ll build independent reduction trees for each chunk, and execute them independently, in parallel. We’ll make sure each of the chunks is small enough that it fits in local memory, and then we’ll assign one work-item per element.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 11pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; At each stage of the reduction tree, we’ll be loading and storing partial reductions as we compute, so it’s crucial to use local memory to communicate between work-items in the work group. We’ll then execute the reduction tree by using a for loop in conjunction with OpenCL barriers. For example, see the following figure, which performs a min reduction to find the smallest element in a vector:&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img height=&quot;312&quot; src=&quot;https://lh5.googleusercontent.com/eUgIR2rqUVbkC-kjoRBKowkBTB6EGlqyEN7nOVga9s7TFe3nwF2Y38mBBBdJ4SQ4vxkN8mCu1Cqp5lbur1TvkPlQimda1kpmlxk0dGXjZNShIHcPFvR1WuG0rDBIuj7MubhoCMVY&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;602&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 7pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;__kernel&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;void reduce(&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__global float* buffer,&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__local float* scratch,&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__const int length,&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;__global float* result) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;int global_index = get_global_id(0);&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;int local_index = get_local_id(0);&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;// Load data into local memory&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;if (global_index &amp;lt; length) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;scratch[local_index] = buffer[global_index];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;} else {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;// Infinity is the identity element for the min operation&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;scratch[local_index] = INFINITY;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;barrier(CLK_LOCAL_MEM_FENCE);&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;for(int offset = get_local_size(0) / 2;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;offset &amp;gt; 0;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;offset &amp;gt;&amp;gt;= 1) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if (local_index &amp;lt; offset) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;float other = scratch[local_index + offset];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;float mine = scratch[local_index];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;scratch[local_index] = (mine &amp;lt; other) ? mine : other;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;barrier(CLK_LOCAL_MEM_FENCE);&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.7999999999999998; margin-bottom: 7pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;if (local_index == 0) {&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;result[get_group_id(0)] = scratch[0];&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br class=&quot;kix-line-break&quot; /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: whitesmoke; color: #333333; font-family: &#39;Courier New&#39;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;LAB - modify host code (opencl_main.cpp) and execute above code correctly.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/h2&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Hint for LABs&lt;/span&gt;&lt;/h2&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 21.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Naive, serial-based and task based solution is included in the lab-material. Please modify reduce.cl, follow the document and implement your version&lt;/span&gt;&lt;/h2&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When attendee use Linux environment, Makefile is ready. And attende can use &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;“make run_emulator”&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; to compile, execute and monitor the result.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;When attendee modify the .cl file. All .cpp and .c file don’t required to recompile&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;hr /&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: Arial; font-size: 22px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Reference&lt;/span&gt;&lt;/h2&gt;
&lt;ul style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; [OpenCL™ Optimization Case Study: Simple Reductions]&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;a href=&quot;https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/opencl-sdk/aocl_optimization_guide.pdf&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/opencl-sdk/aocl_optimization_guide.pdf&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/7254516833881945261/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2016/09/lab-understand-fpga-opencl.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/7254516833881945261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/7254516833881945261'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2016/09/lab-understand-fpga-opencl.html' title='LAB - Understand FPGA OpenCL'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh6.googleusercontent.com/-DkICLd5Eptapk5TIJytnRao8U9ueg5keUSM5rP3wNOtRX9jp3dJflI5qvadTEjRMlxDud-Ae-trb4wJzXau75k0LEjHAf-P1B1IQMfwxpRW0rKDJ3KjEhaB0sMCK8u1SJPUxXeH=s72-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-391381133033169224</id><published>2011-02-04T09:39:00.000-08:00</published><updated>2011-02-04T09:39:58.455-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="compiler"/><category scheme="http://www.blogger.com/atom/ns#" term="llvm"/><title type='text'>notices for using llvm bitcode</title><content type='html'>If someone use ANTLR3 and LLVM 2.7 to construct a compiler, I believe some of my notices/hints written here will be very very useful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;1. function&#39;s parameter is read only. you should use &quot;alloca&quot; to create a &quot;local variable&quot; to make function parameter writable.&lt;/li&gt;
&lt;li&gt;each &quot;basic block&quot; should have a &quot;terminate&quot; instruction. -&amp;gt; br and ret&lt;/li&gt;
&lt;li&gt;each &quot;function module&quot; should have only one &quot;ret&quot; instruction. only one!!!!!!!!!!&lt;/li&gt;
&lt;blockquote&gt;here&#39;s my solution： create a &quot;entry block&quot; and &quot;return block&quot;. puts every &quot;alloca&quot; to &quot;entry block&quot; and create a &quot;alloca&quot; for return variable. Puts &quot;ret&quot; instruction in &quot;return block&quot;. If other statement need to return different return value, I just store &quot;return variable&quot; and &quot;br&quot; to &quot;return block&quot;.&lt;/blockquote&gt;&lt;li&gt;ANTLR3&#39;s tree walker is great to write &quot;multiple pass&quot; symbol table constructor. But it&#39;s a little&amp;nbsp;inconvenient&amp;nbsp;for LLVM IR generator.&lt;/li&gt;
&lt;blockquote&gt;&amp;nbsp;EX) conditional block, if() ：I need to use IR Builder to create a conditional jump before it&#39;s&amp;nbsp;successor not created. &amp;nbsp;When antlr3 walk to this point, my program still don&#39;t know how many elsif and else success behind me.&lt;/blockquote&gt;My Solution：Create your own IR to present statement structure. (only statement)&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;b&gt;LLVM is ssa system&lt;/b&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&amp;nbsp;But it&#39;s impossible to let all of your expression be ssa form (just my experience).&amp;nbsp;&lt;/li&gt;
&lt;li&gt;I just using alloca to present cross-statement variable, store these variable to &quot;stack&quot; instead SSA is much good choice for me.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;If you want to fully utilize SSA&#39;s&amp;nbsp;benefit, you should write your own IR to&amp;nbsp;present an expression. Using ANTLR3&#39;s grammar tree, you don&#39;t need to worry about your IR&#39;s operator priority. Just be careful for assignment&#39;s LHF and RHS.&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/391381133033169224/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2011/02/notices-for-using-llvm-bitcode.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/391381133033169224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/391381133033169224'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2011/02/notices-for-using-llvm-bitcode.html' title='notices for using llvm bitcode'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-2402089452100647290</id><published>2011-02-03T07:43:00.000-08:00</published><updated>2011-02-03T07:43:23.389-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="compiler"/><title type='text'>symbol mangling (compiler)</title><content type='html'>in the past year (2010), I&#39;m working for a &quot;action script&quot; like language compiler.&lt;br /&gt;
Integrate with LLVM and ANTLR3, It&#39;s really easy to come out a &quot;worked and lots of buggies&quot; compiler. My target code is not just execute on a hardware, and it&#39;s not designed for general purpose. According to above situation, design a GOOD enough environment to verify my works. &lt;br /&gt;
&lt;br /&gt;
 1. there&#39;s no entry point for these program. (main function). I need to design another way to invoke my function. Either integrate with &quot;C/C++&quot; or just using cheat mangling to create a main function.&lt;br /&gt;
 2. Because our platform target is very specially, the function signatures are different between language level and &quot;llvm bitcode&quot; level. (for other purpose, will append function parameter and change parameter types). If I want to using C/C++ to call my llvm bitcode, I need to get correct script name mangling and invoke function with correct parameters.&lt;br /&gt;
&lt;br /&gt;
........mmmmm  just mumbling. After read NameMangling: http://en.wikipedia.org/wiki/Name_mangling#Complex_example .&lt;br /&gt;
&lt;br /&gt;
I think i need to change my old/stupid mangling design.</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/2402089452100647290/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2011/02/symbol-mangling-compiler.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/2402089452100647290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/2402089452100647290'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2011/02/symbol-mangling-compiler.html' title='symbol mangling (compiler)'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-74536223897204875</id><published>2011-01-22T01:30:00.000-08:00</published><updated>2011-01-22T01:30:38.630-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="gitorious"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="server"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><title type='text'>Hint for gitorious</title><content type='html'>2011, Jan.&lt;br /&gt;
&lt;br /&gt;
  If you want to install/construct your own gitorious server on your ubuntu 10.10LTS.&lt;br /&gt;
Please remember do not use ruby 1.9.1 &lt;br /&gt;
  &lt;br /&gt;
  There&#39;s too many compatiable issue need to be fixed.&lt;br /&gt;
If you just a newbie with RoR. just use 1.8, don&#39;t challenge it.</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/74536223897204875/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2011/01/hint-for-gitorious.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/74536223897204875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/74536223897204875'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2011/01/hint-for-gitorious.html' title='Hint for gitorious'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-4253309283685680852</id><published>2009-12-12T07:28:00.000-08:00</published><updated>2009-12-12T18:13:09.902-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><title type='text'>GObject - First Vala Programming</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;為達到最佳效果，請使用以上指令下載範例碼並與以下投影片一起服用。&lt;br /&gt;&lt;br /&gt;Coppy from &lt;a url=&quot;http://en.wikipedia.org/wiki/Vala_(programming_language)&quot;&gt;wiki:Vala &lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;lucida grande&#39;;&quot;&gt;&lt;b&gt;&lt;i&gt;&quot;Vala is a programming language that was created with the goal of bringing modern language features to C, without additional runtime requirements and with little overhead, by targeting the GObject object system. It was developed by Jürg Billeter and Raffaele Sandrini. The syntax borrows heavily from C#. Rather than being compiled directly to assembler or to an intermediate language, Vala is compiled to C which is then compiled with the platform&#39;s standard C compiler.&quot;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;According above description, any program written by Vala could translate to standard C code. So I add this topic between GObject tutorial. Because it really save our time for development.&lt;br /&gt;&lt;br /&gt;I rewrote the sample previous GObject example by using Vala. You will find those boring redundant code are no longer need to self-written.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Php&quot;&gt;&lt;br /&gt;/* 6-1 - maman-bar.vala */&lt;br /&gt;public class MamanBar : Object {&lt;br /&gt;public int a;&lt;br /&gt;public int b;&lt;br /&gt;&lt;br /&gt;public MamanBar(){&lt;br /&gt;      a = 1; b = 2;&lt;br /&gt;}&lt;br /&gt;public void dumpall() {&lt;br /&gt;      stdout.printf (&quot;a = %d b = %d\n&quot;,a,b);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Php&quot;&gt;&lt;br /&gt;#&gt; valac -o maman-bar-vala maman-bar.vala main.vala&lt;br /&gt;#&gt; ./maman-bar-vala&lt;br /&gt;a = 1 b = 2&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I would like to demo how to connect vala and c together. We use the same C code from previous sample.&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;int main (int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt; /* this function should be executed first. Before everything  */&lt;br /&gt; g_type_init();&lt;br /&gt;&lt;br /&gt; /* Create our object */&lt;br /&gt; MamanBar *bar = maman_bar_new();&lt;br /&gt; maman_bar_dumpall( bar );&lt;br /&gt;&lt;br /&gt; return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The only difference are compile commands.&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Php&quot;&gt;&lt;br /&gt;#&gt; valac -C -H maman-bar.h  maman-bar.vala&lt;br /&gt;#&gt; cc `pkg-config --cflags glib-2.0 gtk+-2.0`   -c -o main.o main.c&lt;br /&gt;#&gt; cc `pkg-config --cflags glib-2.0 gtk+-2.0`   -c -o maman-bar.o maman-bar.c&lt;br /&gt;#&gt; cc -o maman-bar-c main.o maman-bar.o `pkg-config --libs glib-2.0 gtk+-2.0`&lt;br /&gt;#&gt; ./maman-bar-c&lt;br /&gt;a = 1 b = 2&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/4253309283685680852/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/12/svn-checkout-httpgobject-learing.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/4253309283685680852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/4253309283685680852'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/12/svn-checkout-httpgobject-learing.html' title='GObject - First Vala Programming'/><author><name>elpam</name><uri>http://www.blogger.com/profile/14361720676691454795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-5882040692840128255</id><published>2009-12-11T07:38:00.000-08:00</published><updated>2009-12-11T20:35:22.198-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><title type='text'>GObject - Virtual Function</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;為達到最佳效果，請使用以上指令下載範例碼並與以下&lt;a href=&quot;http://docs.google.com/present/view?id=dcxwdrjr_0ddfkmfdr&quot;&gt;投影片&lt;/a&gt;一起服用。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- 以下是正文  --&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;= Member Function =&lt;br /&gt;&lt;/b&gt;&lt;/span&gt; : the functions which have a self parameter&lt;br /&gt;&lt;br /&gt;If you ever write python code to implement about CLASS. The class member function may look like bellow:&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;def f(self):&lt;br /&gt;    return &#39;hello world&#39;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can find out the first parameter always be class itself. And the function will use &#39;self&#39; to access the member value. The same principle we use in GObject programming.&lt;br /&gt;We always use thiz (instead this, because C++ syntax) for first parameter in each member functions. Whether public function or private function.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;= Public Member Function =&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;: What&#39;s different between &quot;Just Function&quot; and &quot;Public Member Function&quot;?&lt;br /&gt;&lt;br /&gt;Same as C++, in GObject programming, all the functions define in the class structure header with first self parameter are public member functions.&lt;br /&gt;In example 5-1 we use a public member function to replace what we done in main.c, dump all member value.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;void maman_bar_dump_all_value( MamanBar* thiz )&lt;br /&gt;{&lt;br /&gt;    printf(&quot; bar-&gt;a = (%d) bar-&gt;b = (%d)\n&quot;, thiz-&gt;a, thiz-&gt;b );&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;= Private Member Function =&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;: just simple rule, static functions (with first self parameter) are private&lt;br /&gt;&lt;br /&gt;It&#39;s too simple. I believe we don&#39;t need to explain this idea.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;&lt;br /&gt;= Member Function with Virtual Feature =&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;&lt;br /&gt;/* 5-2 */&lt;br /&gt;/* maman-bar.h */&lt;br /&gt;struct _MamanBarClass {&lt;br /&gt;    GObjectClass parent;&lt;br /&gt;    /* class members */&lt;br /&gt;&lt;br /&gt;    void (* incAll) ( MamanBar* );&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;/* maman-bar.c */&lt;br /&gt;static void maman_bar_class_init ( MamanBarClass* class)&lt;br /&gt;{&lt;br /&gt;    class-&gt;incAll = maman_bar_inc_all;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In this step, we need to explain what&#39;s different between MamanBar and MamanBarClass. We use g_object_new to allocate a memory size from heap, and g_object_new invoke function maman_bar_init to initialize this memory region. But different from MamanBar, MamanBarClass should only exists one copy during one time period.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;    maman_bar_dump_all_value( bar );&lt;br /&gt;    MAMAN_BAR_GET_CLASS( bar ) -&gt; incAll(bar);&lt;br /&gt;    maman_bar_dump_all_value( bar );&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In above sample code, you can see we use MAMAN_BAR_GET_CLASS to access CLASS structure, and use it to invoke the class member functions.&lt;br /&gt;The whole idea in virtual function is child class will use it&#39;s member function replace the parent class&#39;s member function pointer.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:large;&quot;&gt;&lt;b&gt;= Virtual Function =&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Base on example 4-2. We implement sub-bar class and replace the parent&#39;s class function pointer.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;/* 5-3 */&lt;br /&gt;/* sub-bar.c */&lt;br /&gt;static void sub_bar_class_init ( SubBarClass* class)&lt;br /&gt;{&lt;br /&gt;    MamanBarClass* parent_class = class;&lt;br /&gt;    parent_class-&gt;incAll = sub_bar_inc_all;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;After constructor invoke (base_init and class_init ...), we can invoke child function by using parent&#39;s fp. It&#39;s simple and easy to use.&lt;br /&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;/* main.c */&lt;br /&gt;    SubBar *subbar = g_object_new (SUB_BAR_TYPE, NULL);&lt;br /&gt;    sub_bar_dump_all_value( subbar );&lt;br /&gt;    MAMAN_BAR_GET_CLASS( subbar ) -&gt; incAll( subbar );&lt;br /&gt;    sub_bar_dump_all_value( subbar );&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/5882040692840128255/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/12/gobject-virtual-function.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/5882040692840128255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/5882040692840128255'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/12/gobject-virtual-function.html' title='GObject - Virtual Function'/><author><name>elpam</name><uri>http://www.blogger.com/profile/14361720676691454795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-4248774452563217695</id><published>2009-11-30T21:30:00.000-08:00</published><updated>2009-11-30T21:30:19.228-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><title type='text'>Gobject - Inherit (Chinese)</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only 
&lt;/pre&gt;&lt;br /&gt;
Of course, you can download the source by using above command.&lt;br /&gt;
I found there&#39;s some different between GLIB v2.0 and v2.2.&lt;br /&gt;
So I rewrote the example code. and separated the &quot;STEPS&quot; more detail.&lt;br /&gt;
&lt;br /&gt;
I believe it will be helpfull for someone(?) who wanna study GObject in dummy. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_2619149&quot;&gt;&lt;a style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam/gobject-inherit-chinese&quot; title=&quot;Gobject - Inherit (Chinese)&quot;&gt;Gobject - Inherit (Chinese)&lt;/a&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-4-cht-091130203637-phpapp01&amp;stripped_title=gobject-inherit-chinese&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-4-cht-091130203637-phpapp01&amp;stripped_title=gobject-inherit-chinese&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam&quot;&gt;Kai-Feng Chou&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
* BTW. i give up Google Doc in this time. because it can&#39;t not upload odf file. and i don&#39;t want to twit the slide every time :( .</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/4248774452563217695/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/gobject-inherit-chinese.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/4248774452563217695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/4248774452563217695'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/gobject-inherit-chinese.html' title='Gobject - Inherit (Chinese)'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-785771598556952383</id><published>2009-11-25T18:07:00.000-08:00</published><updated>2009-11-25T18:07:55.530-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OpenEmbedded"/><title type='text'>OpenEmbedded Build Process</title><content type='html'>I Just draw a diagram to explain the OpenEmbedded build process for internal project. If it&#39;s useful for someone else, just take it.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Google Docs --&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;559&quot; src=&quot;http://docs.google.com/present/embed?id=dcxwdrjr_90gwtnk3fq&amp;amp;size=l&quot; width=&quot;700&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Slide Share --&gt;&lt;br /&gt;
&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_2586808&quot;&gt;&lt;a style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam/open-embedded-build-process-one-page&quot; title=&quot;Open Embedded Build Process (One Page)&quot;&gt;Open Embedded Build Process (One Page)&lt;/a&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=openembeddedbuildprocessonepage-091125200543-phpapp02&amp;stripped_title=open-embedded-build-process-one-page&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=openembeddedbuildprocessonepage-091125200543-phpapp02&amp;stripped_title=open-embedded-build-process-one-page&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam&quot;&gt;Kai-Feng Chou&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/785771598556952383/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/openembedded-build-process.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/785771598556952383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/785771598556952383'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/openembedded-build-process.html' title='OpenEmbedded Build Process'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-9028650044447381541</id><published>2009-11-23T20:01:00.000-08:00</published><updated>2009-11-25T19:52:20.021-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><title type='text'>OOP in C - Before GObject</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only 
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
為達到最佳效果，請使用以上指令下載範例碼並與以下&lt;a href=&quot;http://docs.google.com/present/view?id=dcxwdrjr_48d9s4tdhb&quot;&gt;投影片&lt;/a&gt;一起服用。&lt;br /&gt;
&lt;br /&gt;
we need to try write something before GObject programming. It let us understand more for &quot;WHY USING GOBJECT&quot;. I write some example file, you can try to rewrite them after you read the slide and sample code.&lt;br /&gt;
&lt;br /&gt;
Enjoy It.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Google Docs --&gt;&lt;br /&gt;
&lt;iframe src=&quot;http://docs.google.com/present/embed?id=dcxwdrjr_71fbmffqdn&amp;size=m&quot; frameborder=&quot;0&quot; width=&quot;555&quot; height=&quot;451&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Slide Share --&gt;&lt;br /&gt;
&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_2587200&quot;&gt;&lt;a style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam/oop-in-c-before-gobject-2587200&quot; title=&quot;OOP in C - Before GObject&quot;&gt;OOP in C - Before GObject&lt;/a&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-3-cht-091125215033-phpapp02&amp;stripped_title=oop-in-c-before-gobject-2587200&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-3-cht-091125215033-phpapp02&amp;stripped_title=oop-in-c-before-gobject-2587200&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/&quot;&gt;presentations&lt;/a&gt; from &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam&quot;&gt;Kai-Feng Chou&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/9028650044447381541/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/oop-in-c-before-gobject.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/9028650044447381541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/9028650044447381541'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/oop-in-c-before-gobject.html' title='OOP in C - Before GObject'/><author><name>elpam</name><uri>http://www.blogger.com/profile/14361720676691454795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-6671537557873535269</id><published>2009-11-22T05:38:00.000-08:00</published><updated>2009-11-23T17:59:34.180-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><title type='text'>OOP in C - Virtual Function</title><content type='html'>&lt;pre class=&quot;php&quot; name=&quot;code&quot;&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only 
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
為達到最佳效果，請使用以上指令下載範例碼並與以下&lt;a href=&quot;http://docs.google.com/present/view?id=dcxwdrjr_48d9s4tdhb&quot;&gt;投影片&lt;/a&gt;一起服用。&lt;br /&gt;
&lt;br /&gt;
OO的Member Function 其實是可以使用Function Pointer及Structure來描述 (廢話)&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;Cpp&quot; name=&quot;code&quot;&gt;struct A 
{
int a;
FP  method_a;
};
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
再加上一點技巧, 就可以完成Virtual Function的實作 :) &lt;br /&gt;
Enjoy It.&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Google Docs Presentation --&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;451&quot; src=&quot;http://docs.google.com/present/embed?id=dcxwdrjr_48d9s4tdhb&amp;amp;size=m&quot; width=&quot;555&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- Slide Share --&gt;&lt;br /&gt;
&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_2569771&quot;&gt;&lt;a style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam/oop-in-c-virtual-function&quot; title=&quot;OOP in C - Virtual Function&quot;&gt;OOP in C - Virtual Function&lt;/a&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-2-cht-091123194931-phpapp01&amp;stripped_title=oop-in-c-virtual-function&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-2-cht-091123194931-phpapp01&amp;stripped_title=oop-in-c-virtual-function&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam&quot;&gt;elpam&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/6671537557873535269/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/svn-checkout-httpgobject-learing.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6671537557873535269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6671537557873535269'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/svn-checkout-httpgobject-learing.html' title='OOP in C - Virtual Function'/><author><name>elpam</name><uri>http://www.blogger.com/profile/14361720676691454795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-6148529213586128040</id><published>2009-11-21T08:08:00.000-08:00</published><updated>2009-11-23T18:12:30.758-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GObject-Learning"/><title type='text'>OOP in C - Inherit</title><content type='html'>&lt;pre name=&quot;code&quot; class=&quot;php&quot;&gt;&lt;br /&gt;svn checkout http://gobject-learing.googlecode.com/svn/trunk/ gobject-learing-read-only  &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;為達到最佳效果，請使用以上指令下載範例碼並與以下&lt;a href=&quot;http://docs.google.com/present/view?id=dcxwdrjr_0ddfkmfdr&quot;&gt;投影片&lt;/a&gt;一起服用。&lt;br /&gt;&lt;br /&gt;其實說穿了，整個概念就是以下的程式碼。&lt;br /&gt;&lt;!-- 科科 就是這樣 以下為1-4程式碼--&gt;&lt;br /&gt;&lt;pre name=&quot;code&quot; class=&quot;Cpp&quot;&gt;&lt;br /&gt;/* 1-4.h */&lt;br /&gt;&lt;br /&gt;struct A{&lt;br /&gt;&lt;br /&gt;int a;&lt;br /&gt;&lt;br /&gt;int b;&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;struct B{&lt;br /&gt;&lt;br /&gt;struct A parent;&lt;br /&gt;&lt;br /&gt;int c;&lt;br /&gt;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- Google Docs --&gt;&lt;br /&gt;&lt;iframe src=&quot;http://docs.google.com/present/embed?id=dcxwdrjr_48d9s4tdhb&amp;size=m&quot; frameborder=&quot;0&quot; width=&quot;555&quot; height=&quot;451&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- Slide Sahre --&gt;&lt;br /&gt;&lt;div style=&quot;width:425px;text-align:left&quot; id=&quot;__ss_2565960&quot;&gt;&lt;a style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam/g-object-learning-class-1-cht-2565960&quot; title=&quot;OOP in C - Inherit&quot;&gt;OOP in C - Inherit&lt;/a&gt;&lt;object style=&quot;margin:0px&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-1-cht-091123102430-phpapp01&amp;stripped_title=g-object-learning-class-1-cht-2565960&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;/&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot;/&gt;&lt;embed src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gobject-learning-class-1-cht-091123102430-phpapp01&amp;stripped_title=g-object-learning-class-1-cht-2565960&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/&quot;&gt;documents&lt;/a&gt; from &lt;a style=&quot;text-decoration:underline;&quot; href=&quot;http://www.slideshare.net/elpam&quot;&gt;elpam&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/6148529213586128040/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/oop-in-c-inherit.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6148529213586128040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6148529213586128040'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/oop-in-c-inherit.html' title='OOP in C - Inherit'/><author><name>elpam</name><uri>http://www.blogger.com/profile/14361720676691454795</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-410844370589841835.post-6530520132375591685</id><published>2009-11-20T11:17:00.000-08:00</published><updated>2009-11-20T11:24:05.981-08:00</updated><title type='text'>another half</title><content type='html'>well, let&#39;s start to sort out what i done before.&lt;div&gt;GObject learning for first. After that i plan to post out the real-mode programming tutorial.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.maple.tw/feeds/6530520132375591685/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://blog.maple.tw/2009/11/another-half.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6530520132375591685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/410844370589841835/posts/default/6530520132375591685'/><link rel='alternate' type='text/html' href='http://blog.maple.tw/2009/11/another-half.html' title='another half'/><author><name>maple</name><uri>http://www.blogger.com/profile/16184517246768873107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>