Files
pj2/doc/edu/rit/gpu/GpuArray.html
2016-04-27 01:07:35 -04:00

433 lines
20 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Apr 06 13:11:03 EDT 2016 -->
<title>GpuArray (Parallel Java 2 Library Documentation)</title>
<meta name="date" content="2016-04-06">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="GpuArray (Parallel Java 2 Library Documentation)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/GpuArray.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/gpu/Gpu.html" title="class in edu.rit.gpu"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/gpu/GpuByteArray.html" title="class in edu.rit.gpu"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/gpu/GpuArray.html" target="_top">Frames</a></li>
<li><a href="GpuArray.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">edu.rit.gpu</div>
<h2 title="Class GpuArray" class="title">Class GpuArray</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../edu/rit/gpu/GpuVbl.html" title="class in edu.rit.gpu">edu.rit.gpu.GpuVbl</a></li>
<li>
<ul class="inheritance">
<li>edu.rit.gpu.GpuArray</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../edu/rit/gpu/GpuByteArray.html" title="class in edu.rit.gpu">GpuByteArray</a>, <a href="../../../edu/rit/gpu/GpuDoubleArray.html" title="class in edu.rit.gpu">GpuDoubleArray</a>, <a href="../../../edu/rit/gpu/GpuFloatArray.html" title="class in edu.rit.gpu">GpuFloatArray</a>, <a href="../../../edu/rit/gpu/GpuIntArray.html" title="class in edu.rit.gpu">GpuIntArray</a>, <a href="../../../edu/rit/gpu/GpuLongArray.html" title="class in edu.rit.gpu">GpuLongArray</a>, <a href="../../../edu/rit/gpu/GpuShortArray.html" title="class in edu.rit.gpu">GpuShortArray</a>, <a href="../../../edu/rit/gpu/GpuStructArray.html" title="class in edu.rit.gpu">GpuStructArray</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">GpuArray</span>
extends <a href="../../../edu/rit/gpu/GpuVbl.html" title="class in edu.rit.gpu">GpuVbl</a></pre>
<div class="block">Class GpuArray is the abstract base class for a GPU array variable. This is
an array of data stored in the GPU's memory and mirrored in the CPU's memory.
Construct an instance of a subclass of class GpuArray by calling a factory
method on a <a href="../../../edu/rit/gpu/Gpu.html" title="class in edu.rit.gpu">Gpu</a> object or a <a href="../../../edu/rit/gpu/Module.html" title="class in edu.rit.gpu">Module</a>
object.
<P>
Class GpuArray supports mirroring all of the GPU's data array in the CPU's
memory, mirroring only a portion of the GPU's data array in the CPU's memory,
or mirroring none of the GPU's data array. Class GpuArray provides operations
for copying all or portions of the data array from the CPU to the GPU or from
the GPU to the CPU.
<P>
In the GPU memory, the array is implemented as a pointer to an array of
<I>N</I> data elements, where <I>N</I> is the length of the array.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#cpuLength()">cpuLength</a></strong>()</code>
<div class="block">Returns the length of the GPU array mirrored in the host CPU's memory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#devToHost()">devToHost</a></strong>()</code>
<div class="block">Copy this GPU array from the GPU device's memory to the host CPU's
memory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#devToHost(int)">devToHost</a></strong>(int&nbsp;len)</code>
<div class="block">Copy the initial portion of this GPU array from the GPU device's memory
to the host CPU's memory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#devToHost(int, int, int)">devToHost</a></strong>(int&nbsp;dstindex,
int&nbsp;srcindex,
int&nbsp;len)</code>
<div class="block">Copy the given portion of this GPU array from the GPU device's memory to
the host CPU's memory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#hostToDev()">hostToDev</a></strong>()</code>
<div class="block">Copy this GPU array from the host CPU's memory to the GPU device's
memory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#hostToDev(int)">hostToDev</a></strong>(int&nbsp;len)</code>
<div class="block">Copy the initial portion of this GPU array from the host CPU's memory to
the GPU device's memory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#hostToDev(int, int, int)">hostToDev</a></strong>(int&nbsp;dstindex,
int&nbsp;srcindex,
int&nbsp;len)</code>
<div class="block">Copy the given portion of this GPU array from the host CPU's memory to
the GPU device's memory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../edu/rit/gpu/GpuArray.html#length()">length</a></strong>()</code>
<div class="block">Returns the length of the GPU array in the GPU device's memory.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_edu.rit.gpu.GpuVbl">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;edu.rit.gpu.<a href="../../../edu/rit/gpu/GpuVbl.html" title="class in edu.rit.gpu">GpuVbl</a></h3>
<code><a href="../../../edu/rit/gpu/GpuVbl.html#finalize()">finalize</a>, <a href="../../../edu/rit/gpu/GpuVbl.html#free()">free</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="length()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>length</h4>
<pre>public&nbsp;int&nbsp;length()</pre>
<div class="block">Returns the length of the GPU array in the GPU device's memory.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Number of elements in the GPU array.</dd></dl>
</li>
</ul>
<a name="cpuLength()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cpuLength</h4>
<pre>public&nbsp;int&nbsp;cpuLength()</pre>
<div class="block">Returns the length of the GPU array mirrored in the host CPU's memory.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Number of elements in the CPU array.</dd></dl>
</li>
</ul>
<a name="hostToDev()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hostToDev</h4>
<pre>public&nbsp;void&nbsp;hostToDev()</pre>
<div class="block">Copy this GPU array from the host CPU's memory to the GPU device's
memory. This is equivalent to the call
<TT>hostToDev(0,0,cpuLength())</TT>.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../edu/rit/gpu/GpuVbl.html#hostToDev()">hostToDev</a></code>&nbsp;in class&nbsp;<code><a href="../../../edu/rit/gpu/GpuVbl.html" title="class in edu.rit.gpu">GpuVbl</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
<a name="hostToDev(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hostToDev</h4>
<pre>public&nbsp;void&nbsp;hostToDev(int&nbsp;len)</pre>
<div class="block">Copy the initial portion of this GPU array from the host CPU's memory to
the GPU device's memory. This is equivalent to the call
<TT>hostToDev(0,0,len)</TT>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>len</code> - Number of elements to copy.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>len</TT> &lt; 0 or <TT>len</TT>
&gt; <TT>cpuLength()</TT>.</dd>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
<a name="hostToDev(int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hostToDev</h4>
<pre>public abstract&nbsp;void&nbsp;hostToDev(int&nbsp;dstindex,
int&nbsp;srcindex,
int&nbsp;len)</pre>
<div class="block">Copy the given portion of this GPU array from the host CPU's memory to
the GPU device's memory. <TT>len</TT> elements starting at index
<TT>srcindex</TT> in the CPU array are copied to the GPU array starting
at index <TT>dstindex</TT>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstindex</code> - GPU array starting index.</dd><dd><code>srcindex</code> - CPU array starting index.</dd><dd><code>len</code> - Number of elements to copy.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>dstindex</TT> &lt; 0,
<TT>srcindex</TT> &lt; 0, <TT>len</TT> &lt; 0, <TT>dstindex+len</TT>
&gt; <TT>length()</TT>, or <TT>srcindex+len</TT> &gt;
<TT>cpuLength()</TT>.</dd>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
<a name="devToHost()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>devToHost</h4>
<pre>public&nbsp;void&nbsp;devToHost()</pre>
<div class="block">Copy this GPU array from the GPU device's memory to the host CPU's
memory. This is equivalent to the call
<TT>devToHost(0,0,cpuLength())</TT>.</div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../edu/rit/gpu/GpuVbl.html#devToHost()">devToHost</a></code>&nbsp;in class&nbsp;<code><a href="../../../edu/rit/gpu/GpuVbl.html" title="class in edu.rit.gpu">GpuVbl</a></code></dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
<a name="devToHost(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>devToHost</h4>
<pre>public&nbsp;void&nbsp;devToHost(int&nbsp;len)</pre>
<div class="block">Copy the initial portion of this GPU array from the GPU device's memory
to the host CPU's memory. This is equivalent to the call
<TT>devToHost(0,0,len)</TT>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>len</code> - Number of elements to copy.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>len</TT> &lt; 0 or <TT>len</TT>
&gt; <TT>cpuLength()</TT>.</dd>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
<a name="devToHost(int, int, int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>devToHost</h4>
<pre>public abstract&nbsp;void&nbsp;devToHost(int&nbsp;dstindex,
int&nbsp;srcindex,
int&nbsp;len)</pre>
<div class="block">Copy the given portion of this GPU array from the GPU device's memory to
the host CPU's memory. <TT>len</TT> elements copied starting at index
<TT>srcindex</TT> in the GPU array are copied to the CPU array starting
at index <TT>dstindex</TT>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstindex</code> - CPU array starting index.</dd><dd><code>srcindex</code> - GPU array starting index.</dd><dd><code>len</code> - Number of elements to copy.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - (unchecked exception) Thrown if <TT>dstindex</TT> &lt; 0,
<TT>srcindex</TT> &lt; 0, <TT>len</TT> &lt; 0, <TT>dstindex+len</TT>
&gt; <TT>cpuLength()</TT>, or <TT>srcindex+len</TT> &gt;
<TT>length()</TT>.</dd>
<dd><code><a href="../../../edu/rit/gpu/GpuException.html" title="class in edu.rit.gpu">GpuException</a></code> - (unchecked exception) Thrown if a GPU error occurred.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/GpuArray.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../edu/rit/gpu/Gpu.html" title="class in edu.rit.gpu"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../edu/rit/gpu/GpuByteArray.html" title="class in edu.rit.gpu"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?edu/rit/gpu/GpuArray.html" target="_top">Frames</a></li>
<li><a href="GpuArray.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><FONT SIZE="-2">Copyright &copy; 2013&ndash;2016 by Alan Kaminsky. All rights reserved. Send comments to ark</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">&#64;</FONT><FONT SIZE="1" COLOR="#FFFFFF">&shy;</FONT><FONT SIZE="-2">cs.rit.edu.</FONT></small></p>
</body>
</html>