<?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>Parallelcoding.com &#187; HPC</title>
	<atom:link href="http://www.parallelcoding.com/category/hpc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parallelcoding.com</link>
	<description>Intelligent, Efficient, Parallel, and Sustainable Code</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:17:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Calling CUDA Kernels from C++</title>
		<link>http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/</link>
		<comments>http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 15:17:23 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GPU]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=841</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/" title="Calling CUDA Kernels from C++"></a>I had a need to call a CUDA kernel from inside a C++ class. When I went looking through the NVIDIA examples and the wealth of information on the internet, I could not find a clear solution to my problem. &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/" title="Calling CUDA Kernels from C++"></a><p>I had a need to call a CUDA kernel from inside a C++ class. When I went looking through the NVIDIA examples and the wealth of information on the internet, I could not find a clear solution to my problem. So, let me state plainly how to accomplish this:</p>
<ol>
<li>Create a ".cu" file for your kernels;</li>
<li>For each kernel you would like to call from C++, create a wrapper that can be called from inside your class;</li>
<li>Inside this wrapper, call your kernel function;</li>
<li>Include the prototype for your wrapper in the header file of your class, but not inside the class definition.
</ol>
<p>An example of the ".cu" file and the class header are shown below. One thing you apparently do not need to do (particularly in Visual Studio 2010) is include the ".cu" file in your class. As long as it is part of your project, everything should work just fine.</p>
<pre class="brush: cpp; title: ; notranslate">
#ifndef _PROJECT_KERNELS
#define _PROJECT_KERNELS

__global__ void kernel(double Param1, double Param2){
    // Do Kernel Stuff here
}
extern &quot;C&quot; void functionName(double Param1, double Param2){

    kernel&lt;&lt;&lt;Nb, Nt&gt;&gt;kernel(Param1, Param2);
}
#endif
</pre>
<pre class="brush: cpp; title: ; notranslate">
#ifndef MYCLASS_H_
#define MYCLASS_H_

#include &lt;cuda.h&gt;
#include &quot;cuda_runtime.h&quot;

extern &quot;C&quot; void functionName(double Param1, double Param2);

class myClass{
    myClass();
}
#endif
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2012/02/02/calling-cuda-kernels-from-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the MATLAB plug-in for CUDA in Ubuntu 10.04</title>
		<link>http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/</link>
		<comments>http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 14:00:21 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[CUDA]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Matlab]]></category>
		<category><![CDATA[Parallel / Distributed]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=625</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/" title="Installing the MATLAB plug-in for CUDA in Ubuntu 10.04"></a>I had previously installed CUDA and CUDA SDK on my computer running Ubuntu 10.04. Matlab is also installed on the computer, and some of the students are currently using libSVM for data classification research. One of the major problems that &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/" title="Installing the MATLAB plug-in for CUDA in Ubuntu 10.04"></a><p>I had previously installed CUDA and CUDA SDK on my computer running Ubuntu 10.04. Matlab is also installed on the computer, and some of the students are currently using libSVM for data classification research. One of the major problems that we are having is that the data sets are so large that libSVM is simply too slow to use. The solution - let's add cuSVM to the installation so they can speed up their code easily.</p>
<p>I planned on following the instructions <a href="http://www.google.com/url?sa=t&amp;source=web&amp;cd=1&amp;ved=0CBIQFjAA&amp;url=http%3A%2F%2Fwww.ece.nmsu.edu%2F~pdeleon%2FSoftware%2FcuSVM%2FcuSVM_Linux64_Info.pdf&amp;rct=j&amp;q=cuSVM%20matlab&amp;ei=9LO1TJbsCMnPnAeV0MyADQ&amp;usg=AFQjCNFakY3hGqO2o0gRLwhbvSVmV-Yv4w&amp;sig2=rwGfg7ra_8MkpEekJNb-RQ&amp;cad=rja" target="_blank">here</a> where the first step is "Download Matlab plug-in for Cuda (Version 1.1) from <a href="http://developer.nvidia.com/object/matlab_cuda.html" target="_blank">http://developer.nvidia.com/object/matlab_cuda.html</a>". Along the way I decided that I would not only download the Matlab plug-in for Cuda, but that I would install and test it as well. Though, along the way I ran into a couple of issues. Here are the steps that I followed:</p>
<ol>
<li>Download the Matlab plug-in for CUDA and extract it</li>
<li>Open the Makefile for editing</li>
<li>Add a line at the very beginning of the file that specifies the current directory. In my example this is:
<pre class="brush: bash; title: ; notranslate">CWD=/path/to/my/home/directory/Matlab_Cuda_1.1</pre>
</li>
<li>If you are on a 64-bit system (as I am), make sure that line 6 reads as :
<pre class="brush: bash; title: ; notranslate">INCLUDELIB  = -L$(CUDAHOME)/lib64 -lcufft  -Wl,-rpath,$(CUDAHOME)/lib64</pre>
</li>
<li>Change line 11 (export Matlab=/usr/local/matlab) so that it matches your Matlab installation. In my case this was /opt/Matlab</li>
<li>On lines 38, 45, and 52 you will find references to a script called nvopts.sh. When I first ran this Makefile, I continually got errors telling me that nvopts.sh did not exist. How to fix this? Add the correct path to the nvopts.sh reference. I did this by following the instructions in step 3 and then I adjusted lines 39, 46, and 53 to read as follows:
<pre class="brush: bash; title: ; notranslate">$(NVMEX) -f $(CWD)/nvopts.sh $(INCLUDEDIR) $(INCLUDELIB)</pre>
</li>
<li>Save the Makefile</li>
<li>Open the file called nvmex</li>
<li>Comment out lines 1448-1454. Just in case I have the line numbers slightly wrong, these lines read like this:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$compile_only</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$gateway_lang</span>&quot;</span> = <span style="color: #ff0000;">&quot;C&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    	<span style="color: #007800;">files</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$files</span> <span style="color: #007800;">$MATLAB</span>/extern/src/mexversion.c&quot;</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #007800;">files</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$files</span> <span style="color: #007800;">$MATLAB</span>/extern/lib/<span style="color: #007800;">$Arch</span>/version4.o&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>and should now look like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#if [ &quot;$compile_only&quot; != &quot;1&quot; ]; then</span>
<span style="color: #666666; font-style: italic;">#    if [ &quot;$gateway_lang&quot; = &quot;C&quot; ]; then</span>
<span style="color: #666666; font-style: italic;">#    	files=&quot;$files $MATLAB/extern/src/mexversion.c&quot;</span>
<span style="color: #666666; font-style: italic;">#    else</span>
<span style="color: #666666; font-style: italic;">#        files=&quot;$files $MATLAB/extern/lib/$Arch/version4.o&quot;</span>
<span style="color: #666666; font-style: italic;">#    fi</span>
<span style="color: #666666; font-style: italic;">#fi</span></pre></div></div>

</li>
<li>Save nvmex</li>
<li>In the case that your paths are not set properly (mine are not) open up nvopts.sh. Make sure that the call to nvcc on lines 56, 87 and 164 are set correctly. I changed these from
<pre class="brush: bash; title: ; notranslate">CC='nvcc'</pre>
<p>to</p>
<pre class="brush: bash; title: ; notranslate">CC='/usr/local/cuda/bin/nvcc'</pre>
</li>
<li>Save nvmex</li>
<li>Open the terminal in the directory where your Makefile is and type 'make all'. Enjoy!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2010/10/13/installing-the-matlab-plug-in-for-cuda-in-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NexiWave and the Future of Voice Search with Cuda</title>
		<link>http://www.parallelcoding.com/2010/06/22/nexiwave-and-the-future-of-voice-search-with-cuda/</link>
		<comments>http://www.parallelcoding.com/2010/06/22/nexiwave-and-the-future-of-voice-search-with-cuda/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 17:57:33 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[GPU]]></category>
		<category><![CDATA[HPC]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=565</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2010/06/22/nexiwave-and-the-future-of-voice-search-with-cuda/" title="NexiWave and the Future of Voice Search with Cuda"></a>http://blogs.nvidia.com/ntersect/2010/06/nexiwave-and-the-future-of-voice-search-cuda.html]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2010/06/22/nexiwave-and-the-future-of-voice-search-with-cuda/" title="NexiWave and the Future of Voice Search with Cuda"></a><p><a href="http://blogs.nvidia.com/ntersect/2010/06/nexiwave-and-the-future-of-voice-search-cuda.html">http://blogs.nvidia.com/ntersect/2010/06/nexiwave-and-the-future-of-voice-search-cuda.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2010/06/22/nexiwave-and-the-future-of-voice-search-with-cuda/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why is everyone talking about GPUs for HPC?</title>
		<link>http://www.parallelcoding.com/2010/06/07/557/</link>
		<comments>http://www.parallelcoding.com/2010/06/07/557/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 21:01:15 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[GPU]]></category>
		<category><![CDATA[HPC]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=557</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2010/06/07/557/" title="Why is everyone talking about GPUs for HPC?"></a>The Rich Report: Why is Everyone Talking About GPUs for HPC?]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2010/06/07/557/" title="Why is everyone talking about GPUs for HPC?"></a><p><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/0nKsJIDzN74&#038;hl=en_US&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/0nKsJIDzN74&#038;hl=en_US&#038;fs=1&#038;color1=0x006699&#038;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br />
<a href='http://www.youtube.com/watch?v=0nKsJIDzN74' >The Rich Report: Why is Everyone Talking About GPUs for HPC? </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2010/06/07/557/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>March Madness Multicore Style</title>
		<link>http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/</link>
		<comments>http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:57:34 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[HPC]]></category>
		<category><![CDATA[Parallel / Distributed]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=536</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/" title="March Madness Multicore Style"></a>An interesting article has been posted over at Linux Magazine. The article interests me mainly because it gets to the heart of an issue that I myself ponder over: As hardware overtakes software, how will software catch up? This is &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/" title="March Madness Multicore Style"></a><p>An interesting article has been posted over at Linux Magazine. The article interests me mainly because it gets to the heart of an issue that I myself ponder over: As hardware overtakes software, how will software catch up? This is a very important question, especially in the HPC world as there is no single language that elegantly translates across multiple architectures.<br />
<br/><br />
Read the rest of the article <a href="http://www.linux-mag.com/id/7722">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2010/03/04/march-madness-multicore-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

