<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ananth&#039;s very own website &#187; Brahma</title>
	<atom:link href="http://ananthonline.net/category/blog/brahma/feed" rel="self" type="application/rss+xml" />
	<link>http://ananthonline.net</link>
	<description>Nemo vir est qui mundum non reddat meliorem</description>
	<lastBuildDate>Sun, 29 Jan 2012 05:04:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Brahma and OpenCL</title>
		<link>http://ananthonline.net/2010/01/12/brahma-and-opencl/</link>
		<comments>http://ananthonline.net/2010/01/12/brahma-and-opencl/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 03:48:37 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[GPGPU]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[OpenCL]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=42</guid>
		<description><![CDATA[ Tweet <p>Despite the lack of updates on this site, I have been hard at work on a new provider, Brahma.OpenCL. I am very excited at all the possibilities that OpenCL brings to the table. I will try to summarize some of the new features that OpenCL will bring to Brahma.</p> Different memory pools &#8211; [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2010%2F01%2F12%2Fbrahma-and-opencl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2010/01/12/brahma-and-opencl/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2010/01/12/brahma-and-opencl/"  data-text="Brahma and OpenCL" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2010/01/12/brahma-and-opencl/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Despite the lack of updates on this site, I have been hard at work on a new provider, Brahma.OpenCL. I am very excited at all the possibilities that OpenCL brings to the table. I will try to summarize some of the new features that OpenCL will bring to Brahma.</p>
<ol>
<li><strong>Different memory pools</strong> &#8211; OpenCL supports the idea of host memory, device memory and host-addressable memory. Brahma will allow the creation of DataParallelArrays in these memory pools and will allow host-addressable memory (and host memory) to maintain only one copy of the data. </li>
<li><strong>Asynchronous operations</strong> &#8211; OpenCL supports the idea of asynchronous operations (data-transfers, concurrent kernel execution) and now so does Brahma. Brahma will also allow the user to introduce &#8220;fences&#8221; in any command queue for fork-join parallelism. </li>
<li><strong>Free memory-layout</strong> &#8211; Because memory layouts vary across applications (Morton coding, bricking, overlapped bricks or other index based arbitrary data-structures), DataParallelArrays will now be independent of layout (with a layout manager YOU provide &#8211; or use a stock one). This means Data-ParallelArrays will now have arbitrary dimensionality. </li>
<li><strong>Arbitrary data</strong> &#8211; This is perhaps very exciting. DataParallelArrays can now contain any kind of <a href="http://msdn.microsoft.com/en-us/library/75dwhxf7.aspx">blittable struct</a>. So, if you&#8217;re working with an equation that requires two floats and an int called a, b and factor; you can create a struct with those members and use them in your calculations! </li>
</ol>
<p>And, to whet your appetite; here&#8217;s what Brahma.OpenCL code will look like.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 138.74%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Create compiled, named query</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">CompiledQuery query = </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    _provider.Compile(<span style="color: #006080">&quot;q1&quot;</span>, (d1, d2) =&gt; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            from val1 <span style="color: #0000ff">in</span> d1</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            from val2 <span style="color: #0000ff">in</span> d2</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            select <span style="color: #0000ff">new</span> Coefficients </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            { </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">              a = val1.a + val2.a, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">              b = 0f,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">              factor = a.factor++</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Create a dataparallel array, and provide a</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// memory layout implementation, and a pool to use</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">var d1 = <span style="color: #0000ff">new</span> DataParallelArray&lt;Coefficients&gt;(</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    _provider, <span style="color: #0000ff">null</span>, length,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">new</span> LinearMemoryLayout(length), Pool.Shared);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Create a command that takes the array and </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// a GetValues lambda</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// but - don't do anything just yet</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">var transferd1 += Command.Transfer(d1, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    x =&gt; <span style="color: #0000ff">new</span> Coefficients</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">             {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 a = 0.0, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 b = 1.0, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 factor = 0</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">             });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Ditto for d2 - create ...</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">var d2 = <span style="color: #0000ff">new</span> DataParallelArray&lt;Coefficients&gt;(</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    _provider, <span style="color: #0000ff">null</span>, length,</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">new</span> LinearMemoryLayout(length), Pool.Shared);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// ... and create a transfer command</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">var transferd2 += Command.Transfer(d1, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    x =&gt; <span style="color: #0000ff">new</span> Coefficients</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">             {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 a = 0.0, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 b = 1.0, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                 factor = 0</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">             });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Queue 0 - add the transfer command</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">_provider.CommandQueues[0] += transferd1;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Queue 1 - add the transfer </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// and wait for transferd1</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">_provider.CommandQueues[1] += </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">new</span>[]</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            transferd2, </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            Command.Wait(transferd1)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        };</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Begin running commands on queues 0 and 1</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">ResultSet results = _provider.Run(0, 1);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">// Access results from the result-set <img src='http://ananthonline.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">foreach</span> (Coefficient coeff <span style="color: #0000ff">in</span> results[<span style="color: #006080">&quot;q1&quot;</span>])</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    ...</pre>
<p><!--CRLF--></div>
</div>
<p>Hope that got you excited . I would love to hear comments and suggestions from everyone!</p>
<p><em>For those of you who have written to me and not received a reply, please write to me again, these past few months have been terribly hectic; settling down in a new job in a new country.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2010/01/12/brahma-and-opencl/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Brahma on Wikipedia</title>
		<link>http://ananthonline.net/2009/10/21/brahma-on-wikipedia/</link>
		<comments>http://ananthonline.net/2009/10/21/brahma-on-wikipedia/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 14:33:00 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=41</guid>
		<description><![CDATA[ Tweet <p>I just found out this morning that a link to the Brahma website has made it into Wikipedia (under the topic GPGPU). Cool!</p> <p>The lack of updates on Brahma is because I have moved to the United States (early this month) and will be living and working here from now. It&#8217;s been crazy [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2009%2F10%2F21%2Fbrahma-on-wikipedia%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2009/10/21/brahma-on-wikipedia/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2009/10/21/brahma-on-wikipedia/"  data-text="Brahma on Wikipedia" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2009/10/21/brahma-on-wikipedia/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>I just found out this morning that a <a href="http://en.wikipedia.org/wiki/GPGPU#See_also">link</a> to the Brahma website has made it into Wikipedia (under the topic GPGPU). Cool!</p>
<p>The lack of updates on Brahma is because I have moved to the United States (early this month) and will be living and working here from now. It&#8217;s been crazy busy getting settled in. I have been working on Brahma in my spare time, though. DataParallelArray3D will probably be the first feature out. Stay tuned.</p>
<p>My sincere apologies to anyone who emailed me in this past month, I will get around to responding to you real soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2009/10/21/brahma-on-wikipedia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interview up on DotNetRocks!</title>
		<link>http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/</link>
		<comments>http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 13:50:00 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Brahma]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=40</guid>
		<description><![CDATA[ Tweet <p>My interview about Brahma is up on DotNetRocks, you can find it here. I hope this helps Brahma&#8217;s popularity and remember, contributions are most welcome (samples, help getting Brahma to run on Mono on Linux)!</p> <p>I&#8217;ve recently had a new idea, the concept of using user-defined types with Brahma. This should (hopefully) be [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2009%2F07%2F23%2Finterview-up-on-dotnetrocks%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/"  data-text="Interview up on DotNetRocks!" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>My interview about Brahma is up on DotNetRocks, you can find it <a href="http://www.dotnetrocks.com/default.aspx?showNum=466">here</a>. I hope this helps Brahma&#8217;s popularity and remember, contributions are most welcome (samples, help getting Brahma to run on Mono on Linux)!</p>
<p>I&#8217;ve recently had a new idea, the concept of using user-defined types with Brahma. This should (hopefully) be out soon! Look out!</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2009/07/23/interview-up-on-dotnetrocks/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Brahma on DotNetRocks</title>
		<link>http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/</link>
		<comments>http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 18:02:00 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=39</guid>
		<description><![CDATA[ Tweet <p>We all know .NET rocks. Apparently, the guys over at www.dotnetrocks.com thought Brahma rocks, too! Carl Franklin, Richard Campbell and I had an hour long conversation about Brahma; how it works and what the future for it is like.</p> <p>It&#8217;s going to be published on the 23rd of July 2009, so watch out [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2009%2F07%2F08%2Fbrahma-on-dotnetrocks%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/"  data-text="Brahma on DotNetRocks" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>We all know .NET rocks. Apparently, the guys over at <a href="http://www.dotnetrocks.com">www.dotnetrocks.com</a> thought Brahma rocks, too! Carl Franklin, Richard Campbell and I had an hour long conversation about Brahma; how it works and what the future for it is like.</p>
<p>It&#8217;s going to be published on the 23rd of July 2009, so watch out for it!</p>
<p>Awesome!</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2009/07/08/brahma-on-dotnetrocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brahma on Mono!</title>
		<link>http://ananthonline.net/2008/10/23/brahma-on-mono/</link>
		<comments>http://ananthonline.net/2008/10/23/brahma-on-mono/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 12:43:08 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Brahma]]></category>
		<category><![CDATA[GPGPU]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=25</guid>
		<description><![CDATA[ Tweet <p>Brahma now runs on Mono! Here is a screenshot of the Mandelbrot sample running under Mono (on Windows, at the moment). I&#8217;m trying to get it working on Linux, but I haven&#8217;t been able to get MonoDevelop up on my PCLinuxOS, so I&#8217;m stuck with an empty X11Context implementation.</p> <p>Any help working with [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2008%2F10%2F23%2Fbrahma-on-mono%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2008/10/23/brahma-on-mono/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2008/10/23/brahma-on-mono/"  data-text="Brahma on Mono!" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2008/10/23/brahma-on-mono/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Brahma now runs on Mono! Here is a screenshot of the Mandelbrot sample running under Mono (on Windows, at the moment). I&#8217;m trying to get it working on Linux, but I haven&#8217;t been able to get MonoDevelop up on my PCLinuxOS, so I&#8217;m stuck with an empty X11Context implementation.</p>
<p>Any help working with Mono on Linux would be appreciated, please give me a holler.</p>
<p>Yippeeeee!</p>
<p><a href="http://blog.ananthonline.net/wp-content/uploads/2008/10/mandelbrot-mono-windows.jpg" target="_blank"><img src="http://blog.ananthonline.net/wp-content/uploads/2008/10/mandelbrot-mono-windows-thumb.jpg" style="border: 0px none " alt="Mandelbrot-Mono-Windows" border="0" height="122" width="118" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2008/10/23/brahma-on-mono/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Brahma works with OpenGL!</title>
		<link>http://ananthonline.net/2008/10/22/brahma-works-with-opengl/</link>
		<comments>http://ananthonline.net/2008/10/22/brahma-works-with-opengl/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 07:18:11 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=22</guid>
		<description><![CDATA[ Tweet <p>I&#8217;ve finally sorted out all problems with Brahma and OpenGL, and I&#8217;m glad to announce that there will be a release of Brahma that runs on Mono (Windows + Linux, but not MacOS &#8211; I don&#8217;t have bindings for it) very soon. I&#8217;m going to be using my own method of initializing an [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2008%2F10%2F22%2Fbrahma-works-with-opengl%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2008/10/22/brahma-works-with-opengl/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2008/10/22/brahma-works-with-opengl/"  data-text="Brahma works with OpenGL!" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2008/10/22/brahma-works-with-opengl/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>I&#8217;ve finally sorted out all problems with Brahma and OpenGL, and I&#8217;m glad to announce that there will be a release of Brahma that runs on Mono (Windows + Linux, but not MacOS &#8211; I don&#8217;t have bindings for it) very soon. I&#8217;m going to be using my own method of initializing an OpenGL context on Windows and X11 using the Tao bindings for both. Stay tuned for screenshots of the samples running on Linux!</p>
<p>I&#8217;m really excited as I&#8217;ve never done any significant cross-platform coding, and it&#8217;s always nice to see write-once, run anywhere code!</p>
<p>Comments and suggestions are welcome as always.</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2008/10/22/brahma-works-with-opengl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OpenGL problem</title>
		<link>http://ananthonline.net/2008/09/18/opengl-problem/</link>
		<comments>http://ananthonline.net/2008/09/18/opengl-problem/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 11:23:49 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=21</guid>
		<description><![CDATA[ Tweet <p>I&#8217;ve been trying to get Brahma working with OpenGL, and although the code is complete to bring the OpenGL/GLSL provider on par to the DirectX provider (GLSL code is generated, compiles fine), I&#8217;m having problems getting results back from the GPU. I really wish OpenGL would DO something about the dreadful uncertainties across [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2008%2F09%2F18%2Fopengl-problem%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2008/09/18/opengl-problem/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2008/09/18/opengl-problem/"  data-text="OpenGL problem" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2008/09/18/opengl-problem/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>I&#8217;ve been trying to get Brahma working with OpenGL, and although the code is complete to bring the OpenGL/GLSL provider on par to the DirectX provider (GLSL code is generated, compiles fine), I&#8217;m having problems getting results back from the GPU. I really wish OpenGL would DO something about the dreadful uncertainties across versions, vendors and drivers. I got a whiff of something called <a href="http://en.wikipedia.org/wiki/OpenCL" target="_blank">OpenCL</a> that&#8217;s being cooked up. If delivered properly, it might be answer to a lot of woes. Anyway, I digress. There&#8217;s enough material there for a whole new post <img src='http://ananthonline.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;m having problems getting a proper data-round trip between the CPU and GPU (I&#8217;m using FBO&#8217;s). I&#8217;m not sure why that is, but it works if I don&#8217;t perform any renders, but just crashes the moment I do. Since I&#8217;m at a loss as to what&#8217;s going on, I though I&#8217;d give a holler to any OpenGL experts out there who can help me figure out what&#8217;s going on.</p>
<p>The two unit tests of relevance in this case are</p>
<ol>
<li>DataRoundTrip</li>
<li>IdentityTransform</li>
</ol>
<p>Weird. Hope someone can help me figure this out soon, I&#8217;d really like to get this baby running on Linux and Mono. Thanks in advance for any help!</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2008/09/18/opengl-problem/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Brahma released!</title>
		<link>http://ananthonline.net/2008/07/27/brahma-released/</link>
		<comments>http://ananthonline.net/2008/07/27/brahma-released/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 15:03:07 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[GPGPU]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=20</guid>
		<description><![CDATA[ Tweet <p>After a lot of stumbling blocks with SelectMany and Lets, Brahma is finally out and it supports both of them. The latest release is 0.3, and can be found over at Sourceforge. This release contains 3 samples.</p> A CPU vs GPU implementation of a the Odd-Even transposition sort. This shows comparable performance for [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2008%2F07%2F27%2Fbrahma-released%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2008/07/27/brahma-released/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2008/07/27/brahma-released/"  data-text="Brahma released!" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2008/07/27/brahma-released/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>After a lot of stumbling blocks with SelectMany and Lets, Brahma is finally out and it supports both of them. The latest release is 0.3, and can be found over at <a href="http://sourceforge.net/project/showfiles.php?group_id=171683" target="_blank">Sourceforge</a>. This release contains 3 samples.</p>
<ol>
<li>A CPU vs GPU implementation of a the <a href="http://en.wikipedia.org/wiki/Odd-even_sort" target="_blank">Odd-Even transposition</a> sort. This shows comparable performance for sorting floats (simple calculations), and the GPU version is as much as 5 times faster when sorting Vectors, where the length of each vector needs to be computed.</li>
<li><a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_blank">Conway&#8217;s Game of Life</a>. This sample shows how to express logic in a query. Here the &#8220;rules&#8221; for the game of life are written as a single query and simulates &#8220;life&#8221; on a 512&#215;512 grid.</li>
<li>This example visualizes the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set" target="_blank">Mandelbrot set</a> using the escape time algorithm. An iterative version of the algorithm is implemented since it works well with queries. This is a sightly complex example and uses more than one query to compute a result. This shows how multiple queries can be strung together with no loss of performance.</li>
</ol>
<p>I know a lot of you would like to see some sort of documentation, so I am working on a wiki which should be up soon. In the meantime, please direct all queries directly to me.</p>
<p>I would love your feedback, so if you have any comments or suggestions, drop me a line using the &#8220;Contact me&#8221; link.</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2008/07/27/brahma-released/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Dependent reads and more from LINQ</title>
		<link>http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/</link>
		<comments>http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 13:35:12 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[GPGPU]]></category>

		<guid isPermaLink="false">http://blog.ananthonline.net/?p=15</guid>
		<description><![CDATA[ Tweet <p>Despite the lack of updates on the main Brahma page, development is still on, and this morning saw the checking in of more code, with the following features for 1D and 2D data-parallel arrays.</p> Identity transforms (obviously!) Simple arithmetic operations (supported operators are +, -, * and /. One function call (at the [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2008%2F03%2F17%2Fdependent-reads-and-more-from-linq%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/"  data-text="Dependent reads and more from LINQ" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Despite the lack of updates on the main Brahma page, development is still on, and this morning saw the checking in of more code, with the following features for 1D and 2D data-parallel arrays.</p>
<ul>
<li>Identity transforms (obviously!)</li>
<li>Simple arithmetic operations (supported operators are +, -, * and /.</li>
<li>One function call (at the moment) to Math.Sqrt is supported. It&#8217;s quite simple to add more, so if there&#8217;s a HLSL intrinsic function you absolutely need, give me a holler.</li>
<li>Dependent reads &#8211; You can use a looked up value to index into a data-parallel array again.</li>
<li>Indexing &#8211; The &#8220;Current&#8221; property, &#8220;CurrentX&#8221; and &#8220;CurrentY&#8221; properties in DataParallelArray&lt;T&gt; and DataParallelArray2D&lt;T&gt; allow you to use adjacent elements in you computations.</li>
</ul>
<p>Coming up, I am working on conditionals (ternary).</p>
<p>I am also contemplating the use of a DataParallelArray &#8220;pool&#8221;, which can quickly be used to get new textures instead of the current method of creating them when required. I would appreciate any feedback on this method, and any suggestions for speedup or other improvements you may need.</p>
<p>Get the latest sources from SVN as usual, Brahma.DirectX.Tests contains the code to get you started.</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2008/03/17/dependent-reads-and-more-from-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brahma now works!</title>
		<link>http://ananthonline.net/2007/11/02/brahma-now-works/</link>
		<comments>http://ananthonline.net/2007/11/02/brahma-now-works/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 20:09:49 +0000</pubDate>
		<dc:creator>ananth</dc:creator>
				<category><![CDATA[Brahma]]></category>
		<category><![CDATA[GPGPU]]></category>

		<guid isPermaLink="false">http://www.ananthonline.net/?p=14</guid>
		<description><![CDATA[ Tweet <p>Earlier this evening, I got Brahma working, running an identity query.</p> <p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"> 1: var result = from value in data 2: select value; <p>Admitted, the query doesn&#8217;t really seem to do much, just copy [...]]]></description>
			<content:encoded><![CDATA[<div class="bottomcontainerBox" style="">
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fananthonline.net%2F2007%2F11%2F02%2Fbrahma-now-works%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<g:plusone size="medium" href="http://ananthonline.net/2007/11/02/brahma-now-works/"></g:plusone>
			</div>
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;">
			<a href="http://twitter.com/share" class="twitter-share-button" data-url="http://ananthonline.net/2007/11/02/brahma-now-works/"  data-text="Brahma now works!" data-count="horizontal" data-via="ananthonline">Tweet</a>
			</div>			
			<div style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"><script src="http://www.stumbleupon.com/hostedbadge.php?s=1&amp;r=http://ananthonline.net/2007/11/02/brahma-now-works/"></script></div>			
			</div><div style="clear:both"></div><div style="padding-bottom:4px;"></div><p>Earlier this evening, I got Brahma working, running an identity query.</p>
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   1:</span> var result = from <span style="color: #0000ff">value</span> <span style="color: #0000ff">in</span> data</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   2:</span>              select <span style="color: #0000ff">value</span>;</pre>
<p>Admitted, the query doesn&#8217;t really seem to do much, just copy the input to the output. But lets take a moment to dig a little deeper and see how it all comes together.</p>
<p>Since we&#8217;re going to run this on the GPU, we first create our graphics API-specific provider that sets up the basics. Since this DirectX, we first create a GPUComputationProvider.</p>
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   1:</span> _provider = <span style="color: #0000ff">new</span> GPUComputationProvider(_form.Handle, 256, 256);</pre>
<p>As you can see we need a form handle to create the provider. There&#8217;s no way we can get around that since we&#8217;re using graphics API. The 256, 256 there denotes the initial size of the provider. This is going to go away, since each time we perform a computation the back buffer is automagically resized.</p>
<p>We now need data to perform computations on. The earlier version of Brahma used images as data. However, since the new Brahma is purely GPGPU, I have tried hard to remove all traces of GPU or graphics API related baggage. To this end, DataParallelArray2D (DataParallelArray1D is coming real soon) allows us to specify a delegate that can fill in its values (or provider a single value that is used to fill the array). Here, I initialize one such array with a 1.0 diagonal, and all other elements to 0.3.</p>
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   1:</span> DataParallelArray2D&lt;<span style="color: #0000ff">float</span>&gt; data =</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   2:</span>     <span style="color: #0000ff">new</span> DataParallelArray2D&lt;<span style="color: #0000ff">float</span>&gt;(_provider, 256, 256,</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   3:</span>         (x,y) =&gt; (x == y) ? 1.0f: 0.3f);</pre>
<p>DataParallelArray2D is generic, and I&#8217;ve used float as its type argument. At this time, float is the only supported generic argument for DataParallelArray2D. I plan to support float, Vector2, Vector3 and Vector4 in the future.</p>
<p>A question for readers, here: <em>Should the data types I support be API specific, or should they be .NET data types? Supporting .NET data types would be good, since we&#8217;d have complete abstraction and switching API&#8217;s would only mean changing the provider. On the other hand, it would involve data transformation for each read or write, and this might prove expensive. Do let me know if you have any thoughts on the subject.</em></p>
<p>And finally, when all of this is done, we run our little query. In the background, this</p>
<ol>
<li>Creates a texture, fills it with the data you passed in</li>
<li>Processes the expression tree, and creates the following HLSL</li>
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   1:</span> sampler sampler0;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   2:</span> float4 main( float2 texCoord: TEXCOORD0 ): COLOR</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   3:</span> {</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   4:</span>     float4 value = tex2D(sampler0, texCoord);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">return</span> value;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   6:</span> }</pre>
<li>This HLSL is then run on our diagonal array, which produces the exact same output.</li>
<li>Since I still haven&#8217;t completed IQueryProvider.Execute, we access the values using DataParallelArray&#8217;s indexer. The moment we do this, Brahma fills it up with the values computed on the GPU.</li>
</ol>
<p>And a simple test later, we can see that the query did, indeed copy the contents exactly.</p>
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   1:</span> <span style="color: #008000">// We still can't enumerate through the results, so lets use the indexer</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   2:</span> DataParallelArray2D&lt;<span style="color: #0000ff">float</span>&gt; resultValues =</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   3:</span>     result <span style="color: #0000ff">as</span> DataParallelArray2D&lt;<span style="color: #0000ff">float</span>&gt;; <span style="color: #008000">// We need to cast this</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   4:</span> <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> x = 0; x &lt; 256; x++)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> y = 0; y &lt; 256; y++)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   6:</span>         Assert.AreEqual((x == y) ?</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #606060">   7:</span>             1.0f :</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #606060">   8:</span>             0.3f, resultValues[x, y]);</pre>
<p>All of this may sound like a horribly complicated way of copying something, but when we need to perform more complicated transformations on the data, executing them on the GPU will yield far better performance than executing them on the CPU. Stay tuned.</p>
<p><strong>Note</strong>: This version of Brahma has no releases. Use the <a href="https://brahma-fx.svn.sourceforge.net/svnroot/brahma-fx" target="_blank">Subversion repository</a> to access the current source.</p>
]]></content:encoded>
			<wfw:commentRss>http://ananthonline.net/2007/11/02/brahma-now-works/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

