blob: 31836e8233653d8013b9a5c857606ae0c92e74c9 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>CUDAManager (OpenJ9 JDK 11)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="com.ibm.gpu.CUDAManager class">
<meta name="keywords" content="getInstance()">
<meta name="keywords" content="instance()">
<meta name="keywords" content="getOutputHeader()">
<meta name="keywords" content="getVersion()">
<meta name="keywords" content="tearDown()">
<meta name="keywords" content="acquireFreeDevice()">
<meta name="keywords" content="getCUDADevices()">
<meta name="keywords" content="getDefaultDevice()">
<meta name="keywords" content="getDevice()">
<meta name="keywords" content="getDeviceCount()">
<meta name="keywords" content="getDeviceWithMostAvailableMemory()">
<meta name="keywords" content="getDoubleThreshold()">
<meta name="keywords" content="getEnabledCUDADevices()">
<meta name="keywords" content="getFloatThreshold()">
<meta name="keywords" content="getFreeMemoryForDevice()">
<meta name="keywords" content="getIntThreshold()">
<meta name="keywords" content="getLongThreshold()">
<meta name="keywords" content="getNextAvailableDevice()">
<meta name="keywords" content="getVerboseGPUOutput()">
<meta name="keywords" content="hasCUDASupport()">
<meta name="keywords" content="isSortEnabledOnGPU()">
<meta name="keywords" content="isSortEnforcedOnGPU()">
<meta name="keywords" content="printAllDeviceInfo()">
<meta name="keywords" content="releaseDevice()">
<meta name="keywords" content="setDefaultDevice()">
<meta name="keywords" content="setDevice()">
<meta name="keywords" content="setVerboseGPU()">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="CUDAManager (OpenJ9 JDK 11)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":41,"i11":10,"i12":10,"i13":10,"i14":9,"i15":10,"i16":9,"i17":10,"i18":9,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":41};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CUDAManager.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 class="aboutLanguage"><div style="margin-top: 9px;"><strong>OpenJ9 JDK 11</strong></div></div>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../../module-summary.html">openj9.gpu</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">com.ibm.gpu</a></div>
<h2 title="Class CUDAManager" class="title">Class CUDAManager</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.ibm.gpu.CUDAManager</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public final class <span class="typeNameLabel">CUDAManager</span>
extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">Object</a></pre>
<div class="block">This class contains information important to IBM GPU enabled functions.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#acquireFreeDevice()">acquireFreeDevice</a></span>()</code></th>
<td class="colLast">
<div class="block">Look for the next free device and mark it as busy.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ArrayList.html?is-external=true" title="class or interface in java.util" class="externalLink" target="_blank">ArrayList</a>&lt;<a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCUDADevices()">getCUDADevices</a></span>()</code></th>
<td class="colLast">
<div class="block">Use this method to obtain a reference to an ArrayList containing
references to all discovered CUDA devices.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDefaultDevice()">getDefaultDevice</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the ID of the default device, set to 0 by default.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDevice(int)">getDevice</a></span>&#8203;(int&nbsp;deviceId)</code></th>
<td class="colLast">
<div class="block">Get a reference to the CUDA device by means of its index (with 0 being the first).</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeviceCount()">getDeviceCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Identifies the number of available CUDA devices.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeviceWithMostAvailableMemory()">getDeviceWithMostAvailableMemory</a></span>()</code></th>
<td class="colLast">
<div class="block">Identifies the CUDA device that has the most memory available.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDoubleThreshold()">getDoubleThreshold</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the minimum length of a double array that will be
sorted using a GPU if enabled.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getEnabledCUDADevices()">getEnabledCUDADevices</a></span>()</code></th>
<td class="colLast">
<div class="block">Use this method to return an array of enabled CUDA devices.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFloatThreshold()">getFloatThreshold</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the minimum length of a float array that will be
sorted using a GPU if enabled.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getFreeMemoryForDevice(int)">getFreeMemoryForDevice</a></span>&#8203;(int&nbsp;deviceId)</code></th>
<td class="colLast">
<div class="block">Get the amount of free memory (in bytes) available for the provided CUDA device.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>static <a href="CUDAManager.html" title="class in com.ibm.gpu">CUDAManager</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getInstance()">getInstance</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <code>instance()</code> instead.</div>
</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getIntThreshold()">getIntThreshold</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the minimum length of an int array that will be
sorted using a GPU if enabled.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getLongThreshold()">getLongThreshold</a></span>()</code></th>
<td class="colLast">
<div class="block">Gets the minimum length of a long array that will be
sorted using a GPU if enabled.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getNextAvailableDevice()">getNextAvailableDevice</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the next CUDA device that is available to run calculations on.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOutputHeader()">getOutputHeader</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the header used to prefix all IBM GPU related output.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getVerboseGPUOutput()">getVerboseGPUOutput</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the value of the verboseGPUOutput flag.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getVersion()">getVersion</a></span>()</code></th>
<td class="colLast">
<div class="block">Get the version of this class.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hasCUDASupport()">hasCUDASupport</a></span>()</code></th>
<td class="colLast">
<div class="block">Use this method to identify if CUDA is supported on this machine and
within this environment: returns true if the number of CUDA devices
detected is greater than 0.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>static <a href="CUDAManager.html" title="class in com.ibm.gpu">CUDAManager</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#instance()">instance</a></span>()</code></th>
<td class="colLast">
<div class="block">Return a CUDAManager instance.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSortEnabledOnGPU()">isSortEnabledOnGPU</a></span>()</code></th>
<td class="colLast">
<div class="block">This method provides a means to determine if sort is
enabled to be used by any available CUDA device.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSortEnforcedOnGPU()">isSortEnforcedOnGPU</a></span>()</code></th>
<td class="colLast">
<div class="block">This method provides a means to determine if sort is
forced to be used by any available CUDA device.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#printAllDeviceInfo()">printAllDeviceInfo</a></span>()</code></th>
<td class="colLast">
<div class="block">Print information for each detected CUDA device.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#releaseDevice(int)">releaseDevice</a></span>&#8203;(int&nbsp;deviceId)</code></th>
<td class="colLast">
<div class="block">Mark a device as being free; must be in a try finally block as we MUST
release the handle regardless of whether or not a sort was successful.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDefaultDevice(int)">setDefaultDevice</a></span>&#8203;(int&nbsp;deviceId)</code></th>
<td class="colLast">
<div class="block">Sets the default device to the given device ID.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setDevice(int)">setDevice</a></span>&#8203;(int&nbsp;deviceId)</code></th>
<td class="colLast">
<div class="block">Use this method to set the device to use for subsequent calls.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setVerboseGPU(boolean)">setVerboseGPU</a></span>&#8203;(boolean&nbsp;condition)</code></th>
<td class="colLast">
<div class="block">Set the value of the verboseGPUOutput flag.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#tearDown()">tearDown</a></span>()</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">This method has no effect; it will be removed in a future version.</div>
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods declared in class&nbsp;java.lang.<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink" target="_blank">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink" target="_blank">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink" target="_blank">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink" target="_blank">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink" target="_blank">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink" target="_blank">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink" target="_blank">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink" target="_blank">toString</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink" target="_blank">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink" target="_blank">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink" target="_blank">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getInstance()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstance</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">@Deprecated</a>
public static&nbsp;<a href="CUDAManager.html" title="class in com.ibm.gpu">CUDAManager</a>&nbsp;getInstance()
throws <a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a>,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">SecurityException</a></pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <code>instance()</code> instead.</div>
</div>
<div class="block">Return a CUDAManager instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a CUDAManager instance</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></code> - This exception is not actually thrown; use <code>instance()</code> instead.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">SecurityException</a></code> - If a security manager exists and the calling thread does not
have permission to access the CUDAManager instance.</dd>
</dl>
</li>
</ul>
<a id="instance()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>instance</h4>
<pre class="methodSignature">public static&nbsp;<a href="CUDAManager.html" title="class in com.ibm.gpu">CUDAManager</a>&nbsp;instance()
throws <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">SecurityException</a></pre>
<div class="block">Return a CUDAManager instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a CUDAManager instance</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/SecurityException.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">SecurityException</a></code> - If a security manager exists and the calling thread does not
have permission to access the CUDAManager instance.</dd>
</dl>
</li>
</ul>
<a id="getOutputHeader()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOutputHeader</h4>
<pre class="methodSignature">public static&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">String</a>&nbsp;getOutputHeader()</pre>
<div class="block">Get the header used to prefix all IBM GPU related output.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The header used for IBM GPU related output.</dd>
</dl>
</li>
</ul>
<a id="getVersion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVersion</h4>
<pre class="methodSignature">public static&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">String</a>&nbsp;getVersion()</pre>
<div class="block">Get the version of this class.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the version of this class.</dd>
</dl>
</li>
</ul>
<a id="tearDown()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tearDown</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_blank">@Deprecated</a>
public static&nbsp;void&nbsp;tearDown()</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">This method has no effect; it will be removed in a future version.</div>
</div>
<div class="block">Performs cleanup on the CUDAManager class.</div>
</li>
</ul>
<a id="acquireFreeDevice()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>acquireFreeDevice</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;acquireFreeDevice()</pre>
<div class="block">Look for the next free device and mark it as busy.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the device ID of the next free device.</dd>
</dl>
</li>
</ul>
<a id="getCUDADevices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCUDADevices</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/ArrayList.html?is-external=true" title="class or interface in java.util" class="externalLink" target="_blank">ArrayList</a>&lt;<a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>&gt;&nbsp;getCUDADevices()</pre>
<div class="block">Use this method to obtain a reference to an ArrayList containing
references to all discovered CUDA devices.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns an ArrayList containing all discovered CUDA
devices - see <a href="CUDADevice.html" title="class in com.ibm.gpu"><code>CUDADevice</code></a> for details.</dd>
</dl>
</li>
</ul>
<a id="getDefaultDevice()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDefaultDevice</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getDefaultDevice()</pre>
<div class="block">Gets the ID of the default device, set to 0 by default.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the device ID of the current default device.</dd>
</dl>
</li>
</ul>
<a id="getDevice(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDevice</h4>
<pre class="methodSignature">public&nbsp;<a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>&nbsp;getDevice&#8203;(int&nbsp;deviceId)
throws <a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></pre>
<div class="block">Get a reference to the CUDA device by means of its index (with 0 being the first).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - The index of the device to retrieve (with 0 being the first).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns a CUDA device at the specified index - see
<a href="CUDADevice.html" title="class in com.ibm.gpu"><code>CUDADevice</code></a> for details.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></code> - Throws this exception if an invalid deviceId
has been specified.</dd>
</dl>
</li>
</ul>
<a id="getDeviceCount()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeviceCount</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getDeviceCount()</pre>
<div class="block">Identifies the number of available CUDA devices.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns how many CUDA devices have been detected.</dd>
</dl>
</li>
</ul>
<a id="getDeviceWithMostAvailableMemory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeviceWithMostAvailableMemory</h4>
<pre class="methodSignature">public&nbsp;<a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>&nbsp;getDeviceWithMostAvailableMemory()
throws <a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></pre>
<div class="block">Identifies the CUDA device that has the most memory available.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns a reference to the CUDA device with the most memory available.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></code> - Throws this exception if an
attempt was made to access an invalid device (no longer available).</dd>
</dl>
</li>
</ul>
<a id="getDoubleThreshold()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDoubleThreshold</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getDoubleThreshold()</pre>
<div class="block">Gets the minimum length of a double array that will be
sorted using a GPU if enabled.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum length of a double array that will be
sorted using a GPU.</dd>
</dl>
</li>
</ul>
<a id="getEnabledCUDADevices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnabledCUDADevices</h4>
<pre class="methodSignature">public&nbsp;<a href="CUDADevice.html" title="class in com.ibm.gpu">CUDADevice</a>[]&nbsp;getEnabledCUDADevices()</pre>
<div class="block">Use this method to return an array of enabled CUDA devices.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns an array containing enabled CUDA devices -
see <a href="CUDADevice.html" title="class in com.ibm.gpu"><code>CUDADevice</code></a> for details.</dd>
</dl>
</li>
</ul>
<a id="getFloatThreshold()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFloatThreshold</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getFloatThreshold()</pre>
<div class="block">Gets the minimum length of a float array that will be
sorted using a GPU if enabled.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum length of a float array that will be
sorted using a GPU.</dd>
</dl>
</li>
</ul>
<a id="getFreeMemoryForDevice(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFreeMemoryForDevice</h4>
<pre class="methodSignature">public&nbsp;long&nbsp;getFreeMemoryForDevice&#8203;(int&nbsp;deviceId)
throws <a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></pre>
<div class="block">Get the amount of free memory (in bytes) available for the provided CUDA device.
Does not persistently change the current device.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - The index of the device to query (with 0 being the first).</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns the amount of free memory available.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></code> - Throw this exception if cannot get free memory amount.</dd>
</dl>
</li>
</ul>
<a id="getIntThreshold()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIntThreshold</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getIntThreshold()</pre>
<div class="block">Gets the minimum length of an int array that will be
sorted using a GPU if enabled.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum length of an int array that will be
sorted using a GPU.</dd>
</dl>
</li>
</ul>
<a id="getLongThreshold()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLongThreshold</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getLongThreshold()</pre>
<div class="block">Gets the minimum length of a long array that will be
sorted using a GPU if enabled.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum length of a long array that will be
sorted using a GPU.</dd>
</dl>
</li>
</ul>
<a id="getNextAvailableDevice()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextAvailableDevice</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;getNextAvailableDevice()</pre>
<div class="block">Returns the next CUDA device that is available to run calculations on.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>-1 if there are no free devices, otherwise returns
the ID of the free CUDA device.</dd>
</dl>
</li>
</ul>
<a id="getVerboseGPUOutput()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVerboseGPUOutput</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;getVerboseGPUOutput()</pre>
<div class="block">Get the value of the verboseGPUOutput flag.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether or not verbose output should be produced.</dd>
</dl>
</li>
</ul>
<a id="hasCUDASupport()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasCUDASupport</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;hasCUDASupport()</pre>
<div class="block">Use this method to identify if CUDA is supported on this machine and
within this environment: returns true if the number of CUDA devices
detected is greater than 0.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns true if one or more CUDA devices have been detected.</dd>
</dl>
</li>
</ul>
<a id="isSortEnabledOnGPU()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSortEnabledOnGPU</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isSortEnabledOnGPU()</pre>
<div class="block">This method provides a means to determine if sort is
enabled to be used by any available CUDA device.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns true if GPU sort is enabled.</dd>
</dl>
</li>
</ul>
<a id="isSortEnforcedOnGPU()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSortEnforcedOnGPU</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;isSortEnforcedOnGPU()</pre>
<div class="block">This method provides a means to determine if sort is
forced to be used by any available CUDA device.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Returns true if GPU sort is forced.</dd>
</dl>
</li>
</ul>
<a id="printAllDeviceInfo()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>printAllDeviceInfo</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;printAllDeviceInfo()</pre>
<div class="block">Print information for each detected CUDA device.</div>
</li>
</ul>
<a id="releaseDevice(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>releaseDevice</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;releaseDevice&#8203;(int&nbsp;deviceId)</pre>
<div class="block">Mark a device as being free; must be in a try finally block as we MUST
release the handle regardless of whether or not a sort was successful.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - The device to be marked as free.</dd>
</dl>
</li>
</ul>
<a id="setDefaultDevice(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDefaultDevice</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setDefaultDevice&#8203;(int&nbsp;deviceId)</pre>
<div class="block">Sets the default device to the given device ID.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - The new default device.</dd>
</dl>
</li>
</ul>
<a id="setDevice(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDevice</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setDevice&#8203;(int&nbsp;deviceId)
throws <a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></pre>
<div class="block">Use this method to set the device to use for subsequent calls.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deviceId</code> - Set the default device ID to be this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="GPUConfigurationException.html" title="class in com.ibm.gpu">GPUConfigurationException</a></code> - Throws this exception if an invalid device
number was specified.</dd>
</dl>
</li>
</ul>
<a id="setVerboseGPU(boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setVerboseGPU</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setVerboseGPU&#8203;(boolean&nbsp;condition)</pre>
<div class="block">Set the value of the verboseGPUOutput flag. When this flag is true, GPU
output will be produced.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>condition</code> - Whether or not verbose output should be produced.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.html">Overview</a></li>
<li><a href="../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CUDAManager.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 class="aboutLanguage"><div style="margin-top: 9px;"><strong>OpenJ9 JDK 11</strong></div></div>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.html">All&nbsp;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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small><a href="https://www.eclipse.org/openj9/" target="_blank">Eclipse OpenJ9 website.</a><br> To raise a bug report or suggest an improvement create an <a href="https://github.com/eclipse-openj9/openj9/issues" target="_blank">Eclipse Openj9 issue.</a><br> Copyright &copy; 1998, 2021, IBM Corp. and others.</small></p>
</footer>
</body>
</html>