69 lines
5.4 KiB
HTML
Executable File
69 lines
5.4 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<title>MPI On Cell (Documentation): src/spu/system/moc_wtick_spu.c Source File</title>
|
|
<link href="../../doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="../../tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.5.6 -->
|
|
<div class="navigation" id="top">
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="../../main.html"><span>Main Page</span></a></li>
|
|
<li><a href="../../modules.html"><span>Modules</span></a></li>
|
|
<li><a href="../../annotated.html"><span>Data Structures</span></a></li>
|
|
<li class="current"><a href="../../files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<h1>src/spu/system/moc_wtick_spu.c</h1><a href="../../df/d50/moc__wtick__spu_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
|
|
<a name="l00002"></a>00002 <span class="preprocessor">#include <<a class="code" href="../../d0/d3a/spu_2moc_8h.html">moc.h</a>></span>
|
|
<a name="l00003"></a>00003
|
|
<a name="l00004"></a>00004 <span class="comment">// if Time-Source is "gettimeofday()" from sys/time.h</span>
|
|
<a name="l00005"></a>00005 <span class="comment">// surprisingly this works out of the box. and it seems to be a</span>
|
|
<a name="l00006"></a>00006 <span class="comment">// global synchronized time. no internal information how it is</span>
|
|
<a name="l00007"></a>00007 <span class="comment">// implemented was found so far, but I think its communicating</span>
|
|
<a name="l00008"></a>00008 <span class="comment">// with the PPU because there is no known instance on the SPU</span>
|
|
<a name="l00009"></a>00009 <span class="comment">// capable of handling this except the SPU timer library.</span>
|
|
<a name="l00010"></a>00010 <span class="comment">// so be carefull using this.</span>
|
|
<a name="l00011"></a>00011 <span class="preprocessor">#if defined(MOC_SPU_TIMESOURCE_TIMEOFDAY)</span>
|
|
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#undef MOC_SPU_TIMESOURCE_SPUTIME</span>
|
|
<a name="l00013"></a>00013 <span class="preprocessor"></span>
|
|
<a name="l00014"></a>00014 <span class="preprocessor">#include <time.h></span>
|
|
<a name="l00015"></a>00015 <span class="preprocessor">#include <sys/time.h></span>
|
|
<a name="l00016"></a>00016
|
|
<a name="l00017"></a>00017 <span class="keywordtype">double</span> <a class="code" href="../../d8/da6/group__environment__timer.html#gc846a7a21aeafdc5e960e91cb7d602be" title="Returns the resolution of Moc_Wtime in seconds.">MOC_Wtick</a>(<span class="keywordtype">void</span>)
|
|
<a name="l00018"></a>00018 {
|
|
<a name="l00019"></a>00019 <span class="keywordflow">return</span> 1.0 / ((double) CLOCKS_PER_SEC);
|
|
<a name="l00020"></a>00020 }
|
|
<a name="l00021"></a>00021
|
|
<a name="l00022"></a>00022 <span class="comment">// if Time-Source is the SPU timer library</span>
|
|
<a name="l00023"></a>00023 <span class="comment">// this library seems to have prototype-status and its path isn't</span>
|
|
<a name="l00024"></a>00024 <span class="comment">// the default. therefore the sputimer-library needs to be explicitly</span>
|
|
<a name="l00025"></a>00025 <span class="comment">// linked to any MOC-application.</span>
|
|
<a name="l00026"></a>00026 <span class="preprocessor">#elif defined(MOC_SPU_TIMESOURCE_SPUTIME)</span>
|
|
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#undef MOC_SPU_TIMESOURCE_TIMEOFDAY</span>
|
|
<a name="l00028"></a>00028 <span class="preprocessor"></span>
|
|
<a name="l00029"></a>00029 <span class="preprocessor">#define IMOC_TIMEBASE 79800000</span>
|
|
<a name="l00030"></a>00030 <span class="preprocessor"></span>
|
|
<a name="l00031"></a>00031 <span class="keywordtype">double</span> <a class="code" href="../../d8/da6/group__environment__timer.html#gc846a7a21aeafdc5e960e91cb7d602be" title="Returns the resolution of Moc_Wtime in seconds.">MOC_Wtick</a>(<span class="keywordtype">void</span>)
|
|
<a name="l00032"></a>00032 {
|
|
<a name="l00033"></a>00033 <span class="keywordflow">return</span> 1.0/((double)IMOC_TIMEBASE);
|
|
<a name="l00034"></a>00034 }
|
|
<a name="l00035"></a>00035
|
|
<a name="l00036"></a>00036 <span class="comment">// if no time-source</span>
|
|
<a name="l00037"></a>00037 <span class="comment">// some dummy-functions</span>
|
|
<a name="l00038"></a>00038 <span class="preprocessor">#else</span>
|
|
<a name="l00039"></a>00039 <span class="preprocessor"></span>
|
|
<a name="l00040"></a><a class="code" href="../../d8/da6/group__environment__timer.html#gc846a7a21aeafdc5e960e91cb7d602be">00040</a> <span class="keywordtype">double</span> <a class="code" href="../../d8/da6/group__environment__timer.html#gc846a7a21aeafdc5e960e91cb7d602be" title="Returns the resolution of Moc_Wtime in seconds.">MOC_Wtick</a>(<span class="keywordtype">void</span>)
|
|
<a name="l00041"></a>00041 {
|
|
<a name="l00042"></a>00042 <span class="keywordflow">return</span> 0;
|
|
<a name="l00043"></a>00043 }
|
|
<a name="l00044"></a>00044
|
|
<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
|
|
<a name="l00046"></a>00046 <span class="preprocessor"></span>
|
|
</pre></div></div>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Feb 12 13:49:47 2009 for MPI On Cell (Documentation) by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="../../doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
|
|
</body>
|
|
</html>
|