<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>TraxNet - Blog</title>
	<atom:link href="http://traxnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://traxnet.wordpress.com</link>
	<description>Óscar Blasco Maestro - Software architecture</description>
	<lastBuildDate>Thu, 03 Nov 2011 21:58:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='traxnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>TraxNet - Blog</title>
		<link>http://traxnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://traxnet.wordpress.com/osd.xml" title="TraxNet - Blog" />
	<atom:link rel='hub' href='http://traxnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Android MediaRecorder with Camera</title>
		<link>http://traxnet.wordpress.com/2011/11/03/android-mediarecorder-with-camera/</link>
		<comments>http://traxnet.wordpress.com/2011/11/03/android-mediarecorder-with-camera/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 21:58:28 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=309</guid>
		<description><![CDATA[Our animated gif and stopmotion maker application (Gifagram) relays heavily on the Android camera support. Two good starting points for Camera and Video recording on android are: http://developer.android.com/reference/android/media/MediaRecorder.html http://www.codesend.com/view/73d3edc51302c0e6a2fa3075db6fa1ab/ The first link is the Android SDK MediaRecorder class and the second one is a lengthy example. Unfortunelly SDK information on camera and video is poor, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=309&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Our animated gif and stopmotion maker application (<a href="http://www.gifagram.com">Gifagram</a>) relays heavily on the Android camera support. Two good starting points for Camera and Video recording on android are:</p>
<p><a href="http://developer.android.com/reference/android/media/MediaRecorder.html">http://developer.android.com/reference/android/media/MediaRecorder.html</a><br />
<a href="http://www.codesend.com/view/73d3edc51302c0e6a2fa3075db6fa1ab/"> http://www.codesend.com/view/73d3edc51302c0e6a2fa3075db6fa1ab/</a></p>
<p>The first link is the Android SDK MediaRecorder class and the second one is a lengthy example.</p>
<p>Unfortunelly SDK information on camera and video is poor, and hidden behavior is quite undocumented.</p>
<p>For instance, MediaRecorder.setProfile(&#8216;HIGH&#8217;) sets an invalid video size in Samsung Galaxy SII (1080 height, instead of 1088 as hardware requires). The same code on HTC Wildfire throws an exception although on other HTC phones, everything works great. This is heavily hardware dependent which can run you crazy.</p>
<p><strong>Video recording using a Camera object</strong></p>
<p>The following code snipplet setups the camera:</p>
<pre>boolean setupVideoRecording(int use_profile){
    	boolean ret = true;
    	try{
    		if(recorder != null){
    			recorder.release();
    			recorder = null;
    		}

    		if(camera != null){
    			camera.reconnect();
    		} else{
    			camera = Camera.open();
        		//camera.lock();

    		}

    		CamcorderProfile profile;
    		if(use_profile == 0){
    			profile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
    		}else{
    			profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);
    		}

			Camera.Parameters params = camera.getParameters();
			List sizes = params.getSupportedPreviewSizes();

			//List formats = params.getSupportedPreviewFormats();
			Size optimalSize;
			optimalSize = getOptimalPreviewSize(sizes, profile.videoFrameWidth, profile.videoFrameHeight);

			params.setPreviewSize(optimalSize.width, optimalSize.height);
			params.setPreviewFrameRate(profile.videoFrameRate);

			params.setColorEffect(filter);
			camera.setParameters(params);
			setCameraDisplayOrientation((Activity)context, 0, camera);

			camera.setPreviewDisplay(holder);
			camera.startPreview();
			camera.unlock();

			recorder = new MediaRecorder();
			recorder.setCamera(camera);

			recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
			recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

			if(use_profile == 2){
				recorder.setOutputFormat(profile.fileFormat);
				recorder.setVideoSize(optimalSize.width, optimalSize.height);
				//recorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight);
				recorder.setVideoEncoder(profile.videoCodec);
				recorder.setAudioEncoder(profile.audioCodec);
			} else{
				recorder.setProfile(profile);
			}

    	} catch(Exception e){
    		String message = e.getMessage();
	    	e.printStackTrace();
	    	ret = false;
    	}

    	return ret;
    }</pre>
<p>We pass a use_profile integer to choose some hardware dependent code. But for almost everything the use_profile == 2 is the right one for you.</p>
<p>And the following prepares the media recorder. Both functions can be called one after the other to completely setup the camera for video recording.</p>
<pre>boolean initializeMediaRecorder(){
    	try{
    		recorder.setOutputFile(captureFile);
			recorder.setPreviewDisplay(holder.getSurface());
			recorder.prepare();
			return true;
    	} catch(Exception e){
    		String message = e.getMessage();
	    	return false;
    	}
    }</pre>
<p>This code is quite simple but I hope it can be the foundation of something more elaborated for someone. Please feel free to leave a comment if you have a tip that you would like to share with everyone.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=309&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/11/03/android-mediarecorder-with-camera/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Android development tips &#8211; Gifagram project</title>
		<link>http://traxnet.wordpress.com/2011/11/01/android-development-tips-gifagram-project/</link>
		<comments>http://traxnet.wordpress.com/2011/11/01/android-development-tips-gifagram-project/#comments</comments>
		<pubDate>Tue, 01 Nov 2011 09:22:24 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[animated gif]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[stopmotion]]></category>
		<category><![CDATA[stop-motion]]></category>
		<category><![CDATA[gifagram]]></category>
		<category><![CDATA[android sdk]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=296</guid>
		<description><![CDATA[For the past months I have been reading the Android SDK, trying out it&#8217;s OpenGL ES 2.0 capabilities (check my Github project ShadingZen) and was really impressed with the overall API quality. It&#8217;s easy to get things done, and its integration with Eclipse helps too. Current top devices are computing crunchers! I went thinking I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=296&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For the past months I have been reading the Android SDK, trying out it&#8217;s OpenGL ES 2.0 capabilities (check my Github project <a href="https://github.com/TraxNet/ShadingZen">ShadingZen</a>) and was really impressed with the overall API quality. It&#8217;s easy to get things done, and its integration with Eclipse helps too. Current top devices are computing crunchers!</p>
<p>I went thinking I could play a bit higher by developing some application for Android, and that&#8217;s how we came with the idea of <a href="http://www.gifagram.com">Gifagram</a> app.</p>
<div id="attachment_311" class="wp-caption aligncenter" style="width: 204px"><a href="http://www.gifagram.com"><img class="size-full wp-image-311 " title="Gifagram promo image" src="http://traxnet.files.wordpress.com/2011/11/phone.png?w=194&#038;h=300" alt="" width="194" height="300" /></a><p class="wp-caption-text">Gifagram.com promo image</p></div>
<p>The idea behind it is to enable the user to create stop-motion or animated GIFs directly from her Android device. GIFs are easy to share, doesn&#8217;t take much bandwidth and some very creative people manage to communicate really stunning stories in this format.</p>
<p>Not everything was easy tho. The camera API in android is really quite undocumented and its behaviour relies completely on the underlying hardware implementation. Retrieving useful information from the beta-tester devices was also cumbersome (to the point that was much easier to just take the terminal to the mac and just debug it directly than to take and read the logs).</p>
<p>Some tips on android development:</p>
<ul>
<li>Think the user workflow within the application and minimize user taps and input steps. Make it simple, vertical application vs &#8220;The killer app&#8221;.</li>
<li>Prototype the application with simple buttons and don&#8217;t waste time until the domain logic is really working.</li>
<li>Try your software on every android device you can get. This probably should go on top of your list.</li>
<li>If you plan to create a free and a paid version, develop with a single application and when you are ready to go to market, convert the project to library and reference it from your free and paid android projects (check this: <a href="http://developer.android.com/guide/developing/projects/projects-eclipse.html">http://developer.android.com/guide/developing/projects/projects-eclipse.html</a>).</li>
<li>Android market share is growing, but it&#8217;s fragment in devices and versions. Android 2.2 and 2.3 are currently in almost 90% of the devices out there, develop with this in mind.</li>
<li>Avoid NDK unless you are really sure about any performance boost that may gain. For gifagram we had to use it no matter what and was a bit tricky at some points.</li>
</ul>
<div>Side note: There are a lot of useful resources, for example stackoverflow.com is a great place to look.</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/296/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/296/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/296/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=296&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/11/01/android-development-tips-gifagram-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/11/phone.png" medium="image">
			<media:title type="html">Gifagram promo image</media:title>
		</media:content>
	</item>
		<item>
		<title>Delay</title>
		<link>http://traxnet.wordpress.com/2011/07/29/delay/</link>
		<comments>http://traxnet.wordpress.com/2011/07/29/delay/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 10:55:41 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=304</guid>
		<description><![CDATA[I have had a busy week and couldn&#8217;t find time to write the next post on GPUs. I expect two post only for the Stream Processors.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=304&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have had a busy week and couldn&#8217;t find time to write the next post on GPUs. I expect two post only for the Stream Processors.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=304&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/07/29/delay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding Modern GPUs (III): Command And Setup Logic</title>
		<link>http://traxnet.wordpress.com/2011/07/22/understanding-modern-gpus-3/</link>
		<comments>http://traxnet.wordpress.com/2011/07/22/understanding-modern-gpus-3/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 06:40:23 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[computer graphics engineer]]></category>
		<category><![CDATA[Computer graphics science]]></category>
		<category><![CDATA[GPU Computing]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[ati]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[high performance computing]]></category>
		<category><![CDATA[hpc]]></category>
		<category><![CDATA[nvidia]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=271</guid>
		<description><![CDATA[Up to this points we have reviewed the common APIs, the host side of the communication between the CPU and the GPU, and how they interact and synchronize. In this new post we will start by exploring the GPU&#8217;s citizen in charge of being its interface to the outside, the Command Processor (CP). &#160; THE [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=271&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Up to this points we have reviewed the common APIs, the host side of the communication between the CPU and the GPU, and how they interact and synchronize. In this new post we will start by exploring the GPU&#8217;s citizen in charge of being its interface to the outside, the Command Processor (CP).</p>
<p>&nbsp;</p>
<div id="attachment_298" class="wp-caption aligncenter" style="width: 640px"><a href="http://traxnet.files.wordpress.com/2011/07/barts-architecture-diagram.png"><img class="size-full wp-image-298" title="Barts (AMD) architecture diagram" src="http://traxnet.files.wordpress.com/2011/07/barts-architecture-diagram.png?w=630&#038;h=545" alt="" width="630" height="545" /></a><p class="wp-caption-text">Barts architecture diagram (AMD)</p></div>
<p><strong>THE COMMAND PROCESSOR </strong></p>
<p>We learnt how the CPU sends command to the CPU, with state changes, instructions and data, but this is codified somehow and must be interpreted. A CP keeps track of states within the GPU, updates host mapped registers and signals interrupts to inform the CPU.</p>
<p>In fact, CPs are (afaik) a micro-processors embedded into the GPU capable of doing most of the tasks traditionally handled by software at the driver. Contains an internal memory, can do complex logic, arithmetic operations and so on. Its capable of managing multiple command buffers, keep track of what is sent down into the GPU or update fences once the command stream has reached them.</p>
<p>Her first task is decoding the commands in order to feed other components. It&#8217;s also responsible of reading and writing host memory and managing device memory. Managing states is a complex task and in some cases, in order to maintain integrity, a partial pipeline flush is issued before proceeding. This is the worst case as it can serialize everything. This is a world itself and very vendor specific.</p>
<p><strong>SETUP STEP</strong></p>
<p>The Command Processor manages some dedicated fixed-function logic, a Vertex Assembler (VA), Tessellator, Geometry Assembler (GA), Rasterizer/Interpolator. These elements are responsible of feeding the processing cores with data, they talk with the Thread Scheduler (named GigaThread by NVIDIA) and issue computing tasks in blocks. <a href="http://www.nvidia.com/content/PDF/fermi_white_papers/P.Glaskowsky_NVIDIA's_Fermi-The_First_Complete_GPU_Architecture.pdf">Fermi architecture</a> seems to be a bit different as these fixed function logic blocks start to become more and more a bottleneck . NVIDIA has opted to duplicated some of these logic or rearrange them into their Stream Processors which would allow many concurrent operations.</p>
<p>Althought I would like to focus these posts for High Performance Computing, a simple explanation on these setup blocks is interesting. For each vertex in a stream there is a set of associated attributes (like normal, binormals&#8230;) that need to be fetched (besides the vertex position) and assembled into a block before further processing. This is the primary task for the Vertex Assembler. As the attribute list grows, the performance decreases as more and more data needs to be fetched from memory before it can be processed.</p>
<p>The Tesselator is a highly programable logic block which can perform patch tessellation and feed (back) the pipeline with new vertices and primitives. The Geometry Assembler fetches primitive information along with adjacency information and sends down all these information for further processing inside a Geometry Shader. The Rasterizer emits fragments to be processed by Fragment Shaders. Interpolation used to be a monolithic a operation done inside the rasterizer but nowadays most of the work is done directly inside the Fragment Shader. With the fragment barycentric coordinates you can easily interpolate each defined attribute directly inside the shader (via patching the user shader).</p>
<p>All these setup blocks feed the Stream Processors which are the core of the GPUs. We will review how they work in a few days.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/271/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/271/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/271/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=271&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/07/22/understanding-modern-gpus-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/barts-architecture-diagram.png" medium="image">
			<media:title type="html">Barts (AMD) architecture diagram</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding Modern GPUs (II): Drivers and Command Ring</title>
		<link>http://traxnet.wordpress.com/2011/07/18/understanding-modern-gpus-2/</link>
		<comments>http://traxnet.wordpress.com/2011/07/18/understanding-modern-gpus-2/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 11:42:26 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[Computer graphics science]]></category>
		<category><![CDATA[GPU Computing]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[ati]]></category>
		<category><![CDATA[drivers]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[modern gpu]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[opencl]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=221</guid>
		<description><![CDATA[This is the second post on Understanding Modern GPUs where we will review the driver, the data flow to the GPU and what modules are involved. In my previous post we talked about the software front end of the GPU, this post and the following ones are going to be more hardware related. USER SPACE AND KERNEL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=221&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is the second post on <em>Understanding Modern GPUs </em>where we will review the driver, the data flow to the GPU and what modules are involved. In my <a href="http://traxnet.wordpress.com/2011/07/16/understanding-modern-gpus-1/">previous post</a> we talked about the software front end of the GPU, this post and the following ones are going to be more hardware related.</p>
<p><strong>USER SPACE AND KERNEL SPACE COMMAND FLOW</strong></p>
<p>Pick any API of your choice, let it be OpenGL, DirectX, OpenCL any mix of these or other APIs (yes, you can mix OpenGL and OpenCL), they implement many functionality in user space. For example in Windows Vista/7 the Windows Display Driver Model (<a href="http://msdn.microsoft.com/en-us/library/ff570593.aspx">http://msdn.microsoft.com/en-us/library/ff570593.aspx</a>) you can find the following diagram very self explanatory:</p>
<div id="attachment_224" class="wp-caption aligncenter" style="width: 456px"><a href="http://traxnet.files.wordpress.com/2011/07/diagram-illustrating-the-windows-vista-and-later-display-driver-model-architecture1.png"><img class="size-full wp-image-224" title="Diagram illustrating the Windows Vista and later display driver model architecture" src="http://traxnet.files.wordpress.com/2011/07/diagram-illustrating-the-windows-vista-and-later-display-driver-model-architecture1.png?w=446&#038;h=266" alt="" width="446" height="266" /></a><p class="wp-caption-text">User space and kernel space display drivers model</p></div>
<p>Each application using a graphics API loads into their private process memory a set of driver/API functionality which is not shared among other processes. There you can find the command buffer, where all your APIs calls are transformed and stored sequentially before being transfered to the side of the driver residing in kernel model. The per process command buffer is vendor dependent and may contain the actual commands given  to the GPU. Also this is the point where shaders are compiled in runtime (in user space) and the driver may inject custom code (therefore patching the shader) to implement specific functionality that doesn&#8217;t translate directly to hardware. This part is very specific to the GPU being used.</p>
<p>Being the GPU a resource shared among different processes, there must be a mechanism to ensure not only that the commands are executed in order, but that the GPU can be used by all those processes and that there is no data corruption. This is done by the device driver executing in kernel model. There you can find the scheduler and the final Command Ring Buffer that is used to talk to the GPU. At the other side of the Command Ring Buffer is the Command Processor (CP) which reads from the stream, decodes the command and feeds the Threads/Stream Scheduler (we will talk about this in other post).</p>
<div id="attachment_250" class="wp-caption aligncenter" style="width: 383px"><a href="http://traxnet.files.wordpress.com/2011/07/cb.png"><img class="size-full wp-image-250" title="Simplified Ring Buffer (Command Buffer)" src="http://traxnet.files.wordpress.com/2011/07/cb.png?w=373&#038;h=483" alt="" width="373" height="483" /></a><p class="wp-caption-text">Simplified Ring Buffer (Command Buffer)</p></div>
<p>The kernel driver scheduler reads from each individual (process) command buffer and moves them to the DMA command buffer. In fact, that would be a waste of resources. Current GPUs contain a DMA controller and a MMU. The first one lets the GPU talk directly to host RAM to fetch and write data without CPU intervention. The MMU virtualizes GPU/host memory and offers some memory protection. For example the Fermi architecture contains 2 DMA engines to get a two-way simultaneous transfers. Another possibility is transferring data between GPUs without CPU intervention. It&#8217;s important to notice that those transfers are executed in parallel with the main command buffer, thus adding another level of parallelism to exploit.</p>
<p>We send a command to the GPU to fetch data from a memory region using its DMA engines, instead of transferring directly,this way we can create different command buffers, one for each user-space driver and let the GPU fetch them.</p>
<p><strong>COMMAND/RING BUFFER</strong></p>
<p>Settings a Command Buffer in DirectX: <a href="http://msdn.microsoft.com/en-us/library/ff569747(v=VS.85).aspx">http://msdn.microsoft.com/en-us/library/ff569747(v=VS.85).aspx</a></p>
<p>Basically through the command buffer you set some states in the GPU, set it to fetch data and issue execution orders. In older days user APIs had a big drawback, you had to specify you primitives by commands directly to the API, for example glBegin/glEnd. Those harmfull calls are now removed from OpenGL ES for example, as they performance killers on modern graphics cards. You can think of the CPU and the GPU as two threads that communicate through the Command Ring Buffer. Its a ring (FIFO) that is filled by the CPU and read by the GPU until its drained. If the ring is empty (write and read pointers are equal) the GPU stalls and waits until has something to do. In this case you are probably CPU bounded. If the CPU fills the entire buffer and has to wait for some free space, you are GPU bounded.</p>
<div id="attachment_273" class="wp-caption aligncenter" style="width: 635px"><a href="http://traxnet.files.wordpress.com/2011/07/cb1.png"><img class="size-full wp-image-273" title="Ring Buffer and its Control Structure. Source (AMD): http://developer.amd.com/gpu_assets/R5xx_Acceleration_v1.2.pdf" src="http://traxnet.files.wordpress.com/2011/07/cb1.png?w=625&#038;h=424" alt="" width="625" height="424" /></a><p class="wp-caption-text">Ring Buffer and its Control Structure. Source (AMD): http://developer.amd.com/gpu_assets/R5xx_Acceleration_v1.2.pdf</p></div>
<p>The above figure shows the Host and the Graphics Controller (Command Processor) connected through the Ring Buffer (RB). The RB is initialized with a fixed buffer size and both Write and Read Pointers are set to zero (empty buffer). The driver adds packets into the RB and updates the Write Pointer register inside the device. When the device reads packets, updates the Read Pointer. Updating both pointers incurs in some overhead that can be mitigated by only updating these register when some a block of data has been consumed (by grouping packets in blocks) instead of doing so for each packet. This also needs more logic in both sides to avoid writing when the RB is full (more info here <a href="http://developer.amd.com/gpu_assets/R5xx_Acceleration_v1.2.pdf">http://developer.amd.com/gpu_assets/R5xx_Acceleration_v1.2.pdf</a>  although a bit out-dated).</p>
<p>This command stream adds some other synchronization issues that must be taken care of. Imagine the following: you create a huge data array which is going to be processed, but once the GPU has finish fetching from the main memory region we would like to update it as soon as possible with new data. How does the CPU know that some commands have been processed so that we can update the array? Remember that this is implemented by a pointing the GPU to fetch it from memory but meanwhile, both the GPU and the CPU can work in parallel to this fetch. The solution is in fact very simple. There are some command types embedded into the command stream called <em>fences</em> (I found this patent by VIA about the matter <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  <a href="http://www.patentgenius.com/patent/7755632.html">http://www.patentgenius.com/patent/7755632.html</a>). Those fences are read by the GPU which updates some register so that the CPU knows that we are up to that point in the stream.</p>
<p>What happens to your OpenCL kernel or vertex shader up to this point? The kernel code was compiled to an intermediate language by the user-space driver (PTX for CUDA devices or AMD IL for AMD devices for example). The code is then compiled to the specific hardware by the driver and passed to the GPU. Since some GPUs may have missing functionality or needs different steps to compute some function, the code needs to be targeted to that hardware running on the computer. For example double floating poins operations may need additional passes to obtain the desired accuracy on hardware lacking a dedicated double precision float processor. Some GPU architectures sacrifice IEEE compliance while others lack double-precision altogether.</p>
<p>Some of those concepts we have been talking about can be seen in the OpenCL API (remember I told you there was some kind of direct mapping between this API and how the hardware actually works from a logical view). You create a command buffer using <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clCreateCommandQueue.html" target="pagedisplay">clCreateCommandQueue</a>, you enqueue a read from device memory using <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueReadBuffer.html" target="pagedisplay">clEnqueueReadBuffer</a>, you run a computing kernel using <a href="http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueNDRangeKernel.html" target="pagedisplay">clEnqueueNDRangeKernel</a> and so on.</p>
<p>On the next episode, we will talk about the Command Processor and some setup logic. Stay tunned!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=221&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/07/18/understanding-modern-gpus-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/diagram-illustrating-the-windows-vista-and-later-display-driver-model-architecture1.png" medium="image">
			<media:title type="html">Diagram illustrating the Windows Vista and later display driver model architecture</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/cb.png" medium="image">
			<media:title type="html">Simplified Ring Buffer (Command Buffer)</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/cb1.png" medium="image">
			<media:title type="html">Ring Buffer and its Control Structure. Source (AMD): http://developer.amd.com/gpu_assets/R5xx_Acceleration_v1.2.pdf</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding Modern GPUs (I): Introduction</title>
		<link>http://traxnet.wordpress.com/2011/07/16/understanding-modern-gpus-1/</link>
		<comments>http://traxnet.wordpress.com/2011/07/16/understanding-modern-gpus-1/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 10:10:30 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[computer graphics engineer]]></category>
		<category><![CDATA[Computer graphics science]]></category>
		<category><![CDATA[GPU Computing]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=262</guid>
		<description><![CDATA[PREFACE From time to time I&#8217;m asked if I could explain &#8220;how graphics work&#8221;, which is obviously a very broad question. Instead of answer the most known answer, that is, how to draw primitives using vertices, matrices, textures and so on, I would like to use my blog to write down all my current limited [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=262&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;"><strong>PREFACE</strong></p>
<p style="text-align:left;">From time to time I&#8217;m asked if I could explain &#8220;how graphics work&#8221;, which is obviously a very broad question. Instead of answer the most known answer, that is, how to draw primitives using vertices, matrices, textures and so on, I would like to use my blog to write down all my current limited knowledge about the low level side of computer graphics. How the API (OpenGL, DirectX, etc) talks to the hardware and how data is moved around to and from these computing monsters (GPUs). I said the word &#8220;computing&#8221; on purpose, today GPUs are designed to handle massive amounts of vector processing which makes them suitable for High Performance Computing (HPC) besides drawing your current AAA title.</p>
<div class="wp-caption aligncenter" style="width: 310px"><a href="http://traxnet.files.wordpress.com/2011/07/nvidia-fermi-gf100-graphics-processor-high-resolution.jpeg"><img title="nVidia Fermi GF100 Graphics Processor" src="http://traxnet.files.wordpress.com/2011/07/nvidia-fermi-gf100-graphics-processor-high-resolution.jpeg?w=300&#038;h=296" alt="" width="300" height="296" /></a><p class="wp-caption-text">nVidia Fermi GF100 Graphics Processor</p></div>
<p style="text-align:left;">Btw, I have found another blogs explaining similar stuff here: <a href="http://fgiesen.wordpress.com/2011/07/01/a-trip-through-the-graphics-pipeline-2011-part-1/">http://fgiesen.wordpress.com/2011/07/01/a-trip-through-the-graphics-pipeline-2011-part-1/</a></p>
<p style="text-align:left;">Some explanations given are very speculative thoughts or things I have read in the past which may not be totally correct or are completely wrong. Vendors don&#8217;t want to expose their architecture but lot of things can be learnt reading their APIs, documents and third-party investigations (<a href="http://www.icare3d.org/GPU/CN08">http://www.icare3d.org/GPU/CN08</a>). OpenCL is a good start as many concepts through the API seem to map directly on how the hardware implements those operations. You may want to check Intel, AMD and NVIDIA documents on their sites. I recommend reading the following papers to get more in-depth information about GPUs:</p>
<p style="text-align:left;"><a href="http://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIAFermiComputeArchitectureWhitepaper.pdf">http://www.nvidia.com/content/PDF/fermi_white_papers/NVIDIAFermiComputeArchitectureWhitepaper.pdf</a></p>
<p style="text-align:left;"><a href="http://developer.amd.com/sdks/AMDAPPSDK/assets/AMD_Evergreen-Family_Instruction_Set_Architecture.pdf">http://developer.amd.com/SDKS/AMDAPPSDK/documentation/Pages/default.aspx</a></p>
<p style="text-align:left;"><strong>3D GRAPHICS PIPELINE INTRODUCTION</strong></p>
<p style="text-align:left;">Before anything, I want to make a dirty introduction to a common 3d graphics pipeline and I will later make a short introduction to OpenCL/HPC. If you need more information, the concepts explained in this section may help you direct your question to Google more easily.</p>
<p style="text-align:left;">Before the age of current highly programmable GPUs there was a set of APIs with fixed pipelines. Those pipelines had some stages that are still present somehow in current 3D engines but it&#8217;s up to the user to implement/port such functionality or ignore it altogether. A common set of stages of a modern graphics pipeline (very simplified) can be found in the following figure:</p>
<div class="wp-caption aligncenter" style="width: 640px"><a href="http://traxnet.files.wordpress.com/2011/07/pipeline.png"><img title="Graphics Pipeline" src="http://traxnet.files.wordpress.com/2011/07/pipeline.png?w=630&#038;h=358" alt="" width="630" height="358" /></a><p class="wp-caption-text">Simplified Graphics Pipeline</p></div>
<p style="text-align:left;">You start with an stream of vertices and a set of  <em><a href="http://en.wikipedia.org/wiki/Shader">shaders</a>, </em>small program that run inside the GPU and transform those vertices (for example by applying some space transformations and a projection to obtain their position in screen space). This is quite oversimplified, modern APIs add more stages after the Programmable Vertex Processor which let you emit new vertices or primitives but all these falls outside the scope of this writing. With the vertices stream the pipeline builds some primitives (points, lines and vertices) and moved into the rasterization stage where the user can define a Fragment Shader to run for each emitted fragment. Those fragments may after some z-test and some final decisions end written into the image buffer. This logic is highly programmable through the use of different shaders.</p>
<div class="wp-caption aligncenter" style="width: 640px"><a href="http://traxnet.files.wordpress.com/2011/07/shader_full.jpeg"><img title="The full Shader Model 5.0 pipeline found in DIrectX" src="http://traxnet.files.wordpress.com/2011/07/shader_full.jpeg?w=630&#038;h=268" alt="" width="630" height="268" /></a><p class="wp-caption-text">The full Shader Model 5.0 pipeline found in DIrectX</p></div>
<p style="text-align:left;">The point behind all is how the GPU architecture exploits the fact that the input and output data can be isolated from other packets inside the data stream, that is, GPUs exploit data level parallelism. For us, those data packets are vertices and pixeles. If you enforce this in your design you can operate with hundreds of vertices and pixels in parallel.</p>
<p style="text-align:left;"><strong>OPENCL INTRODUCTION</strong></p>
<p style="text-align:left;">This paradigm shift, from sequential processing into parallel SIMD processing can be exploited to do any kind of repetitive computation besides transforming vertices and calculating pixel values. <a href="http://www.khronos.org/opencl/">OpenCL</a> is an API to access the GPU as a computational device which runs small programs (kernels) that operates over some data. The idea behing OpenCL is to run a kernel over a point in a problem  domain assuming that each point is highly isolated from others points and thus can be executed in parallel (like the vertices and pixeles in our Graphics Pipeline introduction). The API defines an execution model and a memory model that maps to the imposed contrains found in the GPUs. A running program operating over a point in a domain is called work-item (<em>like</em> a thread) . You must define a N-dimension domain space of work-items and group a set of work-items into work-groups. Those work-groups can share a common memory region private to that work-group.</p>
<div class="wp-caption aligncenter" style="width: 373px"><a href="http://traxnet.files.wordpress.com/2011/07/openclmem.png"><img title="OpenCL memory model" src="http://traxnet.files.wordpress.com/2011/07/openclmem.png?w=363&#038;h=359" alt="" width="363" height="359" /></a><p class="wp-caption-text">OpenCL memory model</p></div>
<p style="text-align:left;">To maximize throughput you want to load all stream processor inside the GPU and fully utilize other areas of the die, like the texture units/memory fetcher because they work in parallel with the ALU. Furthermore, round-trips to host memory  are slow and must be minimized. We will see this in more details in future posts.</p>
<p style="text-align:left;">The reader can find a nice introduction to OpenCL here: <a href="http://www.amd.com/us/products/technologies/stream-technology/opencl/pages/opencl-intro.aspx">http://www.amd.com/us/products/technologies/stream-technology/opencl/pages/opencl-intro.aspx</a></p>
<p style="text-align:left;">In my next post (which is almost ready) we will talk about more low level stuff: how the APIs talk to the driver an the hardware, and how a GPU is orchestrated to run in parallel with the CPU.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/262/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/262/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/262/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=262&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/07/16/understanding-modern-gpus-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/nvidia-fermi-gf100-graphics-processor-high-resolution.jpeg?w=300" medium="image">
			<media:title type="html">nVidia Fermi GF100 Graphics Processor</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/pipeline.png" medium="image">
			<media:title type="html">Graphics Pipeline</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/shader_full.jpeg" medium="image">
			<media:title type="html">The full Shader Model 5.0 pipeline found in DIrectX</media:title>
		</media:content>

		<media:content url="http://traxnet.files.wordpress.com/2011/07/openclmem.png" medium="image">
			<media:title type="html">OpenCL memory model</media:title>
		</media:content>
	</item>
		<item>
		<title>Interesting comparison Thrift vs Protocol Buffers</title>
		<link>http://traxnet.wordpress.com/2011/07/14/interesting-comparison-thrift-vs-protocol-buffers/</link>
		<comments>http://traxnet.wordpress.com/2011/07/14/interesting-comparison-thrift-vs-protocol-buffers/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 11:29:05 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=242</guid>
		<description><![CDATA[There you go: http://floatingsun.net/articles/thrift-vs-protocol-buffers/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=242&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There you go:<a href="http://floatingsun.net/articles/thrift-vs-protocol-buffers/"> http://floatingsun.net/articles/thrift-vs-protocol-buffers/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=242&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/07/14/interesting-comparison-thrift-vs-protocol-buffers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Domain-Specific Languages</title>
		<link>http://traxnet.wordpress.com/2011/05/17/domain-specific-languages/</link>
		<comments>http://traxnet.wordpress.com/2011/05/17/domain-specific-languages/#comments</comments>
		<pubDate>Tue, 17 May 2011 19:39:29 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Boo]]></category>
		<category><![CDATA[clr]]></category>
		<category><![CDATA[common language runtime]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[DSLs]]></category>
		<category><![CDATA[Software Architecture]]></category>
		<category><![CDATA[Workflows]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=176</guid>
		<description><![CDATA[Half the work I&#8217;m currently doing here at Video Stream Networks is to design a DSL runtime engine as the agent which drives all the flow of data through our services. In fact, our current implementation is not in heart a true DSL as it donesn&#8217;t complete move you away from more mundane tasks like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=176&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Boo" src="http://media.xircles.codehaus.org/_projects/boo/_logos/medium.png" alt="Boo " width="561" height="100" /></p>
<p>Half the work I&#8217;m currently doing here at <a href="http://www.vsn-tv.com/">Video Stream Networks</a> is to design a DSL runtime engine as the agent which drives all the flow of data through our services. In fact, our current implementation is not in heart a true DSL as it donesn&#8217;t complete move you away from more mundane tasks like parsing data or having to solve some library/infrastructure matters (we are always trying to improve this point tho).</p>
<p>That was a response to our needs to provide the customers (and us)  a tool to deliver custom solutions, as often our customers are in need of an specific workflow which always requiered modifications to our &#8220;traditional&#8221; software. Building a server-side scripting system allows this and also lets thridparty enterprises join the game and develop custom tools that operate on top of our solution, further improving integration.</p>
<p>Our scripting language of choice is Boo, a dynamically typed programming language for the <a href="http://www.google.es/url?sa=t&amp;source=web&amp;ct=res&amp;cd=6&amp;ved=0CDcQFjAF&amp;url=http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FCommon_Language_Runtime&amp;ei=JnPtS8LxC8r5-Qbex6GXDw&amp;usg=AFQjCNFAIyvSCs38tGLNQGP39WFTDbZixQ&amp;sig2=42DZzz0KNY3GQ1fZSzL5dg">CLR</a>, which has some interesting extensibility capabilities. By using macros, some code behind and time, one could develop some kind of DSL that may help the user concentrate on solving domain problems instead of wasting time solving technical problems related to the architecture of choice.</p>
<p>The source of inspiration was <a href="http://www.manning.com/rahien/">DSLs in Boo: Domain-Specific Languages in .Net</a><strong>, </strong>a not so structured book which guides the reader to each step involved on implementing a DSL based in Boo and RhinoDSL (his own dsl scripts factory library), it&#8217;s worth reading tho.</p>
<p>Our implementation has various key features:</p>
<ul>
<li>Persitence through a well defined persistence points. Flow can be later resumed.</li>
<li>Wait for external events.</li>
<li>Not tied to any specific domain object.</li>
<li>Not tied to any specific domain object.</li>
<li>Parallel execution of scripts.</li>
<li>Service Oriented Architecture.</li>
</ul>
<p>The script flow is moved from step to step (stages) which are the main code block within an script. These stages also define where the flow is persisted and subsequent runs won&#8217;t enter already executed stages.</p>
<p>The input of the script is open. It is defined by the script itself and its clients, which are responsible of feeding the correct data. To improve data handling we share a set of libraries to clients and server, where the input is defined for both parties.</p>
<p>Our runtime is capable of handling concurrent execution of scripts using the same (shared) underlying servicies (like persistence, tracking or any service that we want to publish to the script side).</p>
<p>We call this scripts &#8220;workflows&#8221;, being the script runtime one service of the new SOA platform we have built to deliver a product that can be easily modified to our customer needs.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=176&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2011/05/17/domain-specific-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>

		<media:content url="http://media.xircles.codehaus.org/_projects/boo/_logos/medium.png" medium="image">
			<media:title type="html">Boo</media:title>
		</media:content>
	</item>
		<item>
		<title>Rest back-end and UIs</title>
		<link>http://traxnet.wordpress.com/2010/06/17/rest-back-end-and-uis/</link>
		<comments>http://traxnet.wordpress.com/2010/06/17/rest-back-end-and-uis/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 15:46:58 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Architecture Patterns]]></category>
		<category><![CDATA[Monobjc]]></category>
		<category><![CDATA[Software Architecture]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=200</guid>
		<description><![CDATA[We have been spending the last four months moving our Win32 stand-alone applications to a more service oriented architecture. This new back-end  can be scaled to handle a wide variety of  TV Broadcasting enterprises. It has been a major movement from us, as many domain logic that was previously hardcoded into the desktop applications is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=200&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We have been spending the last four months moving our Win32 stand-alone applications to a more service oriented architecture. This new back-end  can be scaled to handle a wide variety of  TV Broadcasting enterprises. It has been a major movement from us, as many domain logic that was previously hardcoded into the desktop applications is now implemented into this back-end and shared among all clients. The logic is customizable per client basis through an scripting system.</p>
<p>We have targeted two desktop operating systems, MacOSX 10.6 and WindowsXP+ (in this order). These led to a new problem: developing a front-end that would offer the most user-friendly experience to the end user. Cocoa and WPF were the best choices and Monobjc provided a nice bridge to handle the Cocoa interface through Net/Mono. Silverlight was the third choice to those interfaces that could be also used from the web. The RESTful back-end allows us to easily develop and deploy any user interface while maintaining full compatibility within the installation with other clients.</p>
<p>Compared to AJAX and HTML5, Silverlight was the most cost-effective technology for us as we are used to write .Net code and we could use a large .net library we have already developed. So we have software (desktop applications for video editing, video review and cataloging) that share a common back-end and offer a native interface through Cocoa and WPF and some Web applications using Silverlight that also target MacOSX and Win32 clients but are more suited for the Web.</p>
<p>This huge project has been fun and having the chance to take part in almost any part of the new architecture (I have designed and implemented  part of our back-end and also being in charge of evaluating and teaching  Cocoa/Monobjc).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/200/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/200/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/200/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=200&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2010/06/17/rest-back-end-and-uis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>
	</item>
		<item>
		<title>Twitter and future microblogging</title>
		<link>http://traxnet.wordpress.com/2010/05/16/twitter-and-future-microbilogging/</link>
		<comments>http://traxnet.wordpress.com/2010/05/16/twitter-and-future-microbilogging/#comments</comments>
		<pubDate>Sun, 16 May 2010 18:41:24 +0000</pubDate>
		<dc:creator>traxnet</dc:creator>
				<category><![CDATA[marketing]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://traxnet.wordpress.com/?p=194</guid>
		<description><![CDATA[Everything seems to move around twitter or facebook nowadays. Twitter offers a simple service yet a vast amount of people has joint it and the trend seems to be increasing. I was reading an article on The Twitter Platform and was wondering what is going to be the future of microblogging. I can only think [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=194&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Everything seems to move around twitter or facebook nowadays. Twitter offers a simple service yet a vast amount of people has joint it and the trend seems to be increasing. I was reading an article on <a href="http://www.readwriteweb.com/enterprise/2009/03/the-twitter-platform-3-years-old-and-ready-to-change-the-world.php">The Twitter Platform</a> and was wondering what is going to be the future of microblogging. I can only think in one thing: Data-mining. Yes, but you may be wondering why something is doing already could be its future. The fact is that twitter offers a nice playground for data mining, transforming how companies are seeing internet and also making easier to target their products to the correct audience. But as more third party products are integrated into the twitter platform, more data is injected into the system. You can no longer stop analyzing the data that is posted directly in twitter, these other products are also a source of information, they, by the nature of the service itself, mark the interests of its users.</p>
<p>Twitter may also offer more tools for tagging data and vertically splitting the service, like groups or by letting the user tag the data. Would be interesting to tag the graph of relations within the platform. And the users will also be happy to do so, for you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/traxnet.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/traxnet.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/traxnet.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=traxnet.wordpress.com&amp;blog=9327871&amp;post=194&amp;subd=traxnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://traxnet.wordpress.com/2010/05/16/twitter-and-future-microbilogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/14a67510ad94d173823403dd18953e2d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">traxnet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
