blob: a0dd865f89584869943569d9ad2d7029179c8d1a [file] [log] [blame]
<!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 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GPUContext (SystemDS 2.1.0-SNAPSHOT API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="GPUContext (SystemDS 2.1.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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/GPUContext.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-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/ExecutionConfig.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContextPool.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html" target="_top">Frames</a></li>
<li><a href="GPUContext.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;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">org.apache.sysds.runtime.instructions.gpu.context</div>
<h2 title="Class GPUContext" class="title">Class GPUContext</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/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>org.apache.sysds.runtime.instructions.gpu.context.GPUContext</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">GPUContext</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Represents a context per GPU accessible through the same JVM.
Each context holds cublas, cusparse, cudnn... handles which are separate for each GPU.</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>jcuda.Pointer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#allocate-java.lang.String-long-">allocate</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;instructionName,
long&nbsp;size)</code>
<div class="block">Invokes memory manager's malloc method</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#clearMemory--">clearMemory</a></span>()</code>
<div class="block">Clears all memory used by this <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUContext</code></a>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#clearTemporaryMemory--">clearTemporaryMemory</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#createGPUObject-org.apache.sysds.runtime.controlprogram.caching.MatrixObject-">createGPUObject</a></span>(<a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching">MatrixObject</a>&nbsp;mo)</code>
<div class="block">Instantiates a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> initialized with the given <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#cudaFreeHelper-java.lang.String-jcuda.Pointer-boolean-">cudaFreeHelper</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;instructionName,
jcuda.Pointer&nbsp;toFree,
boolean&nbsp;eager)</code>
<div class="block">Does cudaFree calls, lazily.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#cudaGetDevice--">cudaGetDevice</a></span>()</code>
<div class="block">Returns which device is currently being used.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#destroy--">destroy</a></span>()</code>
<div class="block">Destroys this GPUContext object.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#ensureComputeCapability--">ensureComputeCapability</a></span>()</code>
<div class="block">Makes sure that GPU that SystemDS is trying to use has the minimum compute capability needed.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getAvailableMemory--">getAvailableMemory</a></span>()</code>
<div class="block">Gets the available memory on GPU that SystemDS can use.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>jcuda.jcublas.cublasHandle</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getCublasHandle--">getCublasHandle</a></span>()</code>
<div class="block">Returns cublasHandle for BLAS operations on the GPU.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>jcuda.jcudnn.cudnnHandle</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getCudnnHandle--">getCudnnHandle</a></span>()</code>
<div class="block">Returns the cudnnHandle for Deep Neural Network operations on the GPU.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>jcuda.jcusolver.cusolverDnHandle</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getCusolverDnHandle--">getCusolverDnHandle</a></span>()</code>
<div class="block">Returns cusolverDnHandle for invoking solve() function on dense matrices on the GPU.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>jcuda.jcusparse.cusparseHandle</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getCusparseHandle--">getCusparseHandle</a></span>()</code>
<div class="block">Returns cusparseHandle for certain sparse BLAS operations on the GPU.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getDeviceNum--">getDeviceNum</a></span>()</code>
<div class="block">Returns which device is assigned to this GPUContext instance.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>jcuda.runtime.cudaDeviceProp</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getGPUProperties--">getGPUProperties</a></span>()</code>
<div class="block">Gets the device properties for the active GPU (set with cudaSetDevice()).</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/JCudaKernels.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">JCudaKernels</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getKernels--">getKernels</a></span>()</code>
<div class="block">Returns utility class used to launch custom CUDA kernel, specific to the active GPU for this GPUContext.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getMaxBlocks--">getMaxBlocks</a></span>()</code>
<div class="block">Gets the maximum number of blocks supported by the active cuda device.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getMaxSharedMemory--">getMaxSharedMemory</a></span>()</code>
<div class="block">Gets the shared memory per block supported by the active cuda device.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getMaxThreadsPerBlock--">getMaxThreadsPerBlock</a></span>()</code>
<div class="block">Gets the maximum number of threads per block for "active" GPU.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUMemoryManager.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUMemoryManager</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getMemoryManager--">getMemoryManager</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#getWarpSize--">getWarpSize</a></span>()</code>
<div class="block">Gets the warp size supported by the active cuda device.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#initializeThread--">initializeThread</a></span>()</code>
<div class="block">Sets the device for the calling thread.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#printMemoryInfo-java.lang.String-">printMemoryInfo</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;opcode)</code>
<div class="block">Print information of memory usage.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#shallowCopyGPUObject-org.apache.sysds.runtime.instructions.gpu.context.GPUObject-org.apache.sysds.runtime.controlprogram.caching.MatrixObject-">shallowCopyGPUObject</a></span>(<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a>&nbsp;source,
<a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching">MatrixObject</a>&nbsp;mo)</code>
<div class="block">Shallow copy the given source <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> to a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> and
assign that to the given <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a>.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
</table>
<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="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/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="getMemoryManager--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMemoryManager</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUMemoryManager.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUMemoryManager</a>&nbsp;getMemoryManager()</pre>
</li>
</ul>
<a name="cudaGetDevice--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cudaGetDevice</h4>
<pre>public static&nbsp;int&nbsp;cudaGetDevice()</pre>
<div class="block">Returns which device is currently being used.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current device for the calling host thread</dd>
</dl>
</li>
</ul>
<a name="printMemoryInfo-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>printMemoryInfo</h4>
<pre>public&nbsp;void&nbsp;printMemoryInfo(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;opcode)</pre>
<div class="block">Print information of memory usage.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>opcode</code> - opcode of caller</dd>
</dl>
</li>
</ul>
<a name="getDeviceNum--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeviceNum</h4>
<pre>public&nbsp;int&nbsp;getDeviceNum()</pre>
<div class="block">Returns which device is assigned to this GPUContext instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>active device assigned to this GPUContext instance</dd>
</dl>
</li>
</ul>
<a name="initializeThread--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initializeThread</h4>
<pre>public&nbsp;void&nbsp;initializeThread()</pre>
<div class="block">Sets the device for the calling thread.
This method must be called after
<a href="../../../../../../../org/apache/sysds/runtime/controlprogram/context/ExecutionContext.html#getGPUContext-int-"><code>ExecutionContext.getGPUContext(int)</code></a>
If in a multi-threaded environment like parfor, this method must be called when in the
appropriate thread.</div>
</li>
</ul>
<a name="allocate-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allocate</h4>
<pre>public&nbsp;jcuda.Pointer&nbsp;allocate(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;instructionName,
long&nbsp;size)</pre>
<div class="block">Invokes memory manager's malloc method</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>instructionName</code> - name of instruction for which to record per instruction performance statistics, null if don't want to record</dd>
<dd><code>size</code> - size of data (in bytes) to allocate</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>jcuda pointer</dd>
</dl>
</li>
</ul>
<a name="cudaFreeHelper-java.lang.String-jcuda.Pointer-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cudaFreeHelper</h4>
<pre>public&nbsp;void&nbsp;cudaFreeHelper(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;instructionName,
jcuda.Pointer&nbsp;toFree,
boolean&nbsp;eager)</pre>
<div class="block">Does cudaFree calls, lazily.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>instructionName</code> - name of the instruction for which to record per instruction free time, null if do not want to record</dd>
<dd><code>toFree</code> - <code>Pointer</code> instance to be freed</dd>
<dd><code>eager</code> - true if to be done eagerly</dd>
</dl>
</li>
</ul>
<a name="getAvailableMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAvailableMemory</h4>
<pre>public&nbsp;long&nbsp;getAvailableMemory()</pre>
<div class="block">Gets the available memory on GPU that SystemDS can use.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the available memory in bytes</dd>
</dl>
</li>
</ul>
<a name="ensureComputeCapability--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ensureComputeCapability</h4>
<pre>public&nbsp;void&nbsp;ensureComputeCapability()</pre>
<div class="block">Makes sure that GPU that SystemDS is trying to use has the minimum compute capability needed.</div>
</li>
</ul>
<a name="createGPUObject-org.apache.sysds.runtime.controlprogram.caching.MatrixObject-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createGPUObject</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a>&nbsp;createGPUObject(<a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching">MatrixObject</a>&nbsp;mo)</pre>
<div class="block">Instantiates a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> initialized with the given <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mo</code> - a <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a> that represents a matrix</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> instance</dd>
</dl>
</li>
</ul>
<a name="shallowCopyGPUObject-org.apache.sysds.runtime.instructions.gpu.context.GPUObject-org.apache.sysds.runtime.controlprogram.caching.MatrixObject-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shallowCopyGPUObject</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a>&nbsp;shallowCopyGPUObject(<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">GPUObject</a>&nbsp;source,
<a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching">MatrixObject</a>&nbsp;mo)</pre>
<div class="block">Shallow copy the given source <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> to a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> and
assign that to the given <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a>.
This copy doesn't memcopy the device memory.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - a <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> which is the source of the copy</dd>
<dd><code>mo</code> - a <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a> to associate with the new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> instance</dd>
</dl>
</li>
</ul>
<a name="getGPUProperties--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGPUProperties</h4>
<pre>public&nbsp;jcuda.runtime.cudaDeviceProp&nbsp;getGPUProperties()</pre>
<div class="block">Gets the device properties for the active GPU (set with cudaSetDevice()).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the device properties</dd>
</dl>
</li>
</ul>
<a name="getMaxThreadsPerBlock--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxThreadsPerBlock</h4>
<pre>public&nbsp;int&nbsp;getMaxThreadsPerBlock()</pre>
<div class="block">Gets the maximum number of threads per block for "active" GPU.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum number of threads per block</dd>
</dl>
</li>
</ul>
<a name="getMaxBlocks--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxBlocks</h4>
<pre>public&nbsp;int&nbsp;getMaxBlocks()</pre>
<div class="block">Gets the maximum number of blocks supported by the active cuda device.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum number of blocks supported</dd>
</dl>
</li>
</ul>
<a name="getMaxSharedMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxSharedMemory</h4>
<pre>public&nbsp;long&nbsp;getMaxSharedMemory()</pre>
<div class="block">Gets the shared memory per block supported by the active cuda device.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the shared memory per block</dd>
</dl>
</li>
</ul>
<a name="getWarpSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWarpSize</h4>
<pre>public&nbsp;int&nbsp;getWarpSize()</pre>
<div class="block">Gets the warp size supported by the active cuda device.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the warp size</dd>
</dl>
</li>
</ul>
<a name="getCudnnHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCudnnHandle</h4>
<pre>public&nbsp;jcuda.jcudnn.cudnnHandle&nbsp;getCudnnHandle()</pre>
<div class="block">Returns the cudnnHandle for Deep Neural Network operations on the GPU.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>cudnnHandle for current thread</dd>
</dl>
</li>
</ul>
<a name="getCublasHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCublasHandle</h4>
<pre>public&nbsp;jcuda.jcublas.cublasHandle&nbsp;getCublasHandle()</pre>
<div class="block">Returns cublasHandle for BLAS operations on the GPU.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>cublasHandle for current thread</dd>
</dl>
</li>
</ul>
<a name="getCusparseHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCusparseHandle</h4>
<pre>public&nbsp;jcuda.jcusparse.cusparseHandle&nbsp;getCusparseHandle()</pre>
<div class="block">Returns cusparseHandle for certain sparse BLAS operations on the GPU.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>cusparseHandle for current thread</dd>
</dl>
</li>
</ul>
<a name="getCusolverDnHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCusolverDnHandle</h4>
<pre>public&nbsp;jcuda.jcusolver.cusolverDnHandle&nbsp;getCusolverDnHandle()</pre>
<div class="block">Returns cusolverDnHandle for invoking solve() function on dense matrices on the GPU.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>cusolverDnHandle for current thread</dd>
</dl>
</li>
</ul>
<a name="getKernels--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKernels</h4>
<pre>public&nbsp;<a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/JCudaKernels.html" title="class in org.apache.sysds.runtime.instructions.gpu.context">JCudaKernels</a>&nbsp;getKernels()</pre>
<div class="block">Returns utility class used to launch custom CUDA kernel, specific to the active GPU for this GPUContext.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/JCudaKernels.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>JCudaKernels</code></a> for current thread</dd>
</dl>
</li>
</ul>
<a name="destroy--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroy</h4>
<pre>public&nbsp;void&nbsp;destroy()</pre>
<div class="block">Destroys this GPUContext object.</div>
</li>
</ul>
<a name="clearMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearMemory</h4>
<pre>public&nbsp;void&nbsp;clearMemory()</pre>
<div class="block">Clears all memory used by this <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUContext</code></a>.
Be careful to ensure that no memory is currently being used in the temporary memory before invoking this.
If memory is being used between MLContext invocations, they are pointed to by a <a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUObject.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><code>GPUObject</code></a> instance
which would be part of the <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a>. The cleanup of that <a href="../../../../../../../org/apache/sysds/runtime/controlprogram/caching/MatrixObject.html" title="class in org.apache.sysds.runtime.controlprogram.caching"><code>MatrixObject</code></a> instance will
cause the memory associated with that block on the GPU to be freed up.</div>
</li>
</ul>
<a name="clearTemporaryMemory--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearTemporaryMemory</h4>
<pre>public&nbsp;void&nbsp;clearTemporaryMemory()</pre>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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/GPUContext.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-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/ExecutionConfig.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../org/apache/sysds/runtime/instructions/gpu/context/GPUContextPool.html" title="class in org.apache.sysds.runtime.instructions.gpu.context"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/sysds/runtime/instructions/gpu/context/GPUContext.html" target="_top">Frames</a></li>
<li><a href="GPUContext.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.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>
</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>Copyright &#169; 2021 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>