| |
| |
| |
| <!DOCTYPE html> |
| <html class="writer-html5" lang="en" > |
| <head> |
| <meta charset="utf-8"> |
| |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| <title>pyarrow.cuda.Context — Apache Arrow v2.0.0</title> |
| |
| |
| |
| <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> |
| <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
| |
| |
| |
| |
| |
| |
| |
| <!--[if lt IE 9]> |
| <script src="../../_static/js/html5shiv.min.js"></script> |
| <![endif]--> |
| |
| |
| <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script> |
| <script src="../../_static/jquery.js"></script> |
| <script src="../../_static/underscore.js"></script> |
| <script src="../../_static/doctools.js"></script> |
| <script src="../../_static/language_data.js"></script> |
| |
| <script type="text/javascript" src="../../_static/js/theme.js"></script> |
| |
| |
| <link rel="canonical" href="https://arrow.apache.org/docs/python/generated/pyarrow.cuda.Context.html" /> |
| <link rel="index" title="Index" href="../../genindex.html" /> |
| <link rel="search" title="Search" href="../../search.html" /> |
| <link rel="next" title="pyarrow.cuda.CudaBuffer" href="pyarrow.cuda.CudaBuffer.html" /> |
| <link rel="prev" title="CUDA Integration" href="../api/cuda.html" /> |
|
|
|
|
| <!-- Matomo -->
|
| <script>
|
| var _paq = window._paq = window._paq || [];
|
| /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
|
| _paq.push(["setDoNotTrack", true]);
|
| _paq.push(["disableCookies"]);
|
| _paq.push(['trackPageView']);
|
| _paq.push(['enableLinkTracking']);
|
| (function() {
|
| var u="https://analytics.apache.org/";
|
| _paq.push(['setTrackerUrl', u+'matomo.php']);
|
| _paq.push(['setSiteId', '20']);
|
| var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
| g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
|
| })();
|
| </script>
|
| <!-- End Matomo Code -->
|
|
|
| </head> |
| |
| <body class="wy-body-for-nav"> |
| |
| |
| <div class="wy-grid-for-nav"> |
| |
| <nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
| <div class="wy-side-scroll"> |
| <div class="wy-side-nav-search" > |
| |
| |
| |
| <a href="../../index.html" class="icon icon-home" alt="Documentation Home"> Apache Arrow |
| |
| |
| |
| </a> |
| |
| |
| |
| |
| <div class="version"> |
| 2.0.0 |
| </div> |
| |
| |
| |
| |
| <div role="search"> |
| <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search docs" /> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| |
| |
| </div> |
| |
| |
| <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> |
| |
| |
| |
| |
| |
| |
| <p class="caption"><span class="caption-text">Specifications and Protocols</span></p> |
| <ul> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/Versioning.html">Format Versioning and Stability</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/Columnar.html">Arrow Columnar Format</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/Flight.html">Arrow Flight RPC</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/Integration.html">Integration Testing</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/CDataInterface.html">The Arrow C data interface</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/CStreamInterface.html">The Arrow C stream interface</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../format/Other.html">Other Data Structures</a></li> |
| </ul> |
| <p class="caption"><span class="caption-text">Libraries</span></p> |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../../status.html">Implementation Status</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://arrow.apache.org/docs/c_glib/">C/GLib</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../cpp/index.html">C++</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://github.com/apache/arrow/blob/master/csharp/README.md">C#</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://godoc.org/github.com/apache/arrow/go/arrow">Go</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../java/index.html">Java</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://arrow.apache.org/docs/js/">JavaScript</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://github.com/apache/arrow/blob/master/matlab/README.md">MATLAB</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="../index.html">Python</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="../install.html">Installing PyArrow</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../memory.html">Memory and IO Interfaces</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../data.html">Data Types and In-Memory Data Model</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../compute.html">Compute Functions</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../ipc.html">Streaming, Serialization, and IPC</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../filesystems.html">Filesystem Interface</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../filesystems_deprecated.html">Filesystem Interface (legacy)</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../plasma.html">The Plasma In-Memory Object Store</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../numpy.html">NumPy Integration</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../pandas.html">Pandas Integration</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../timestamps.html">Timestamps</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../csv.html">Reading CSV files</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../feather.html">Feather File Format</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../json.html">Reading JSON files</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../parquet.html">Reading and Writing the Apache Parquet Format</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../dataset.html">Tabular Datasets</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../cuda.html">CUDA Integration</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../extending_types.html">Extending pyarrow</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../extending.html">Using pyarrow from C++ and Cython Code</a></li> |
| <li class="toctree-l2 current"><a class="reference internal" href="../api.html">API Reference</a><ul class="current"> |
| <li class="toctree-l3"><a class="reference internal" href="../api/datatypes.html">Data Types and Schemas</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/arrays.html">Arrays and Scalars</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/memory.html">Buffers and Memory</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/compute.html">Compute Functions</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/files.html">Streams and File Access</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/tables.html">Tables and Tensors</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/ipc.html">Serialization and IPC</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/flight.html">Arrow Flight</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/formats.html">Tabular File Formats</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/filesystems.html">Filesystems</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/dataset.html">Dataset</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/plasma.html">Plasma In-Memory Object Store</a></li> |
| <li class="toctree-l3 current"><a class="reference internal" href="../api/cuda.html">CUDA Integration</a><ul class="current"> |
| <li class="toctree-l4 current"><a class="reference internal" href="../api/cuda.html#cuda-contexts">CUDA Contexts</a></li> |
| <li class="toctree-l4"><a class="reference internal" href="../api/cuda.html#cuda-buffers">CUDA Buffers</a></li> |
| <li class="toctree-l4"><a class="reference internal" href="../api/cuda.html#serialization-and-ipc">Serialization and IPC</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l3"><a class="reference internal" href="../api/misc.html">Miscellaneous</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="../getting_involved.html">Getting Involved</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../benchmarks.html">Benchmarks</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference external" href="https://arrow.apache.org/docs/r/">R</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://github.com/apache/arrow/blob/master/ruby/README.md">Ruby</a></li> |
| <li class="toctree-l1"><a class="reference external" href="https://docs.rs/crate/arrow/">Rust</a></li> |
| </ul> |
| <p class="caption"><span class="caption-text">Development</span></p> |
| <ul> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/contributing.html">Contributing to Apache Arrow</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/cpp/index.html">C++ Development</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/python.html">Python Development</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/archery.html">Daily Development using Archery</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/crossbow.html">Packaging and Testing with Crossbow</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/docker.html">Running Docker Builds</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/benchmarks.html">Benchmarks</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../developers/documentation.html">Building the Documentation</a></li> |
| </ul> |
| |
| |
| |
| </div> |
| |
| </div> |
| </nav> |
| |
| <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> |
| |
| |
| <nav class="wy-nav-top" aria-label="top navigation"> |
| |
| <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
| <a href="../../index.html">Apache Arrow</a> |
| |
| </nav> |
| |
| |
| <div class="wy-nav-content"> |
| |
| <div class="rst-content"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <div role="navigation" aria-label="breadcrumbs navigation"> |
| |
| <ul class="wy-breadcrumbs"> |
| |
| <li><a href="../../index.html" class="icon icon-home"></a> »</li> |
| |
| <li><a href="../index.html">Python bindings</a> »</li> |
| |
| <li><a href="../api.html">API Reference</a> »</li> |
| |
| <li><a href="../api/cuda.html">CUDA Integration</a> »</li> |
| |
| <li>pyarrow.cuda.Context</li> |
| |
| |
| <li class="wy-breadcrumbs-aside"> |
| |
| |
| <a href="../../_sources/python/generated/pyarrow.cuda.Context.rst.txt" rel="nofollow"> View page source</a> |
| |
| |
| </li> |
| |
| </ul> |
| |
| |
| <hr/> |
| </div> |
| <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| <div itemprop="articleBody"> |
| |
| <div class="section" id="pyarrow-cuda-context"> |
| <h1>pyarrow.cuda.Context<a class="headerlink" href="#pyarrow-cuda-context" title="Permalink to this headline">¶</a></h1> |
| <dl class="py class"> |
| <dt id="pyarrow.cuda.Context"> |
| <em class="property">class </em><code class="sig-prename descclassname">pyarrow.cuda.</code><code class="sig-name descname">Context</code><a class="headerlink" href="#pyarrow.cuda.Context" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">pyarrow.lib._Weakrefable</span></code></p> |
| <p>CUDA driver context.</p> |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.__init__"> |
| <code class="sig-name descname">__init__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.__init__" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Create a CUDA driver context for a particular device.</p> |
| <p>If a CUDA context handle is passed, it is wrapped, otherwise |
| a default CUDA context for the given device is requested.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>device_number</strong> (<em>int</em><em> (</em><em>default 0</em><em>)</em>) – Specify the GPU device for which the CUDA driver context is |
| requested.</p></li> |
| <li><p><strong>handle</strong> (<em>int</em><em>, </em><em>optional</em>) – Specify CUDA handle for a shared context that has been created |
| by another library.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <p class="rubric">Methods</p> |
| <table class="longtable docutils align-default"> |
| <colgroup> |
| <col style="width: 10%" /> |
| <col style="width: 90%" /> |
| </colgroup> |
| <tbody> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.__init__" title="pyarrow.cuda.Context.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">__init__</span></code></a></p></td> |
| <td><p>Create a CUDA driver context for a particular device.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.buffer_from_data" title="pyarrow.cuda.Context.buffer_from_data"><code class="xref py py-obj docutils literal notranslate"><span class="pre">buffer_from_data</span></code></a></p></td> |
| <td><p>Create device buffer and initialize with data.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.buffer_from_object" title="pyarrow.cuda.Context.buffer_from_object"><code class="xref py py-obj docutils literal notranslate"><span class="pre">buffer_from_object</span></code></a></p></td> |
| <td><p>Create device buffer view of arbitrary object that references device accessible memory.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.foreign_buffer" title="pyarrow.cuda.Context.foreign_buffer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">foreign_buffer</span></code></a></p></td> |
| <td><p>Create device buffer from address and size as a view.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.from_numba" title="pyarrow.cuda.Context.from_numba"><code class="xref py py-obj docutils literal notranslate"><span class="pre">from_numba</span></code></a></p></td> |
| <td><p>Create a Context instance from a Numba CUDA context.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.get_device_address" title="pyarrow.cuda.Context.get_device_address"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_device_address</span></code></a></p></td> |
| <td><p>Return the device address that is reachable from kernels running in the context</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.get_num_devices" title="pyarrow.cuda.Context.get_num_devices"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_num_devices</span></code></a></p></td> |
| <td><p>Return the number of GPU devices.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.new_buffer" title="pyarrow.cuda.Context.new_buffer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">new_buffer</span></code></a></p></td> |
| <td><p>Return new device buffer.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.open_ipc_buffer" title="pyarrow.cuda.Context.open_ipc_buffer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">open_ipc_buffer</span></code></a></p></td> |
| <td><p>Open existing CUDA IPC memory handle</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.synchronize" title="pyarrow.cuda.Context.synchronize"><code class="xref py py-obj docutils literal notranslate"><span class="pre">synchronize</span></code></a></p></td> |
| <td><p>Blocks until the device has completed all preceding requested tasks.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.to_numba" title="pyarrow.cuda.Context.to_numba"><code class="xref py py-obj docutils literal notranslate"><span class="pre">to_numba</span></code></a></p></td> |
| <td><p>Convert Context to a Numba CUDA context.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <p class="rubric">Attributes</p> |
| <table class="longtable docutils align-default"> |
| <colgroup> |
| <col style="width: 10%" /> |
| <col style="width: 90%" /> |
| </colgroup> |
| <tbody> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.bytes_allocated" title="pyarrow.cuda.Context.bytes_allocated"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bytes_allocated</span></code></a></p></td> |
| <td><p>Return the number of allocated bytes.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.device_number" title="pyarrow.cuda.Context.device_number"><code class="xref py py-obj docutils literal notranslate"><span class="pre">device_number</span></code></a></p></td> |
| <td><p>Return context device number.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><a class="reference internal" href="#pyarrow.cuda.Context.handle" title="pyarrow.cuda.Context.handle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">handle</span></code></a></p></td> |
| <td><p>Return pointer to context handle.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.buffer_from_data"> |
| <code class="sig-name descname">buffer_from_data</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.buffer_from_data" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Create device buffer and initialize with data.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>data</strong> (<em>{CudaBuffer</em><em>, </em><a class="reference internal" href="pyarrow.cuda.HostBuffer.html#pyarrow.cuda.HostBuffer" title="pyarrow.cuda.HostBuffer"><em>HostBuffer</em></a><em>, </em><a class="reference internal" href="pyarrow.Buffer.html#pyarrow.Buffer" title="pyarrow.Buffer"><em>Buffer</em></a><em>, </em><em>array-like}</em>) – Specify data to be copied to device buffer.</p></li> |
| <li><p><strong>offset</strong> (<em>int</em>) – Specify the offset of input buffer for device data |
| buffering. Default: 0.</p></li> |
| <li><p><strong>size</strong> (<em>int</em>) – Specify the size of device buffer in bytes. Default: all |
| (starting from input offset)</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>cbuf</strong> (<em>CudaBuffer</em>) – Device buffer with copied data.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.buffer_from_object"> |
| <code class="sig-name descname">buffer_from_object</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.buffer_from_object" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Create device buffer view of arbitrary object that references |
| device accessible memory.</p> |
| <p>When the object contains a non-contiguous view of device |
| accessible memory then the returned device buffer will contain |
| contiguous view of the memory, that is, including the |
| intermediate data that is otherwise invisible to the input |
| object.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>obj</strong> (<em>{object</em><em>, </em><a class="reference internal" href="pyarrow.Buffer.html#pyarrow.Buffer" title="pyarrow.Buffer"><em>Buffer</em></a><em>, </em><a class="reference internal" href="pyarrow.cuda.HostBuffer.html#pyarrow.cuda.HostBuffer" title="pyarrow.cuda.HostBuffer"><em>HostBuffer</em></a><em>, </em><a class="reference internal" href="pyarrow.cuda.CudaBuffer.html#pyarrow.cuda.CudaBuffer" title="pyarrow.cuda.CudaBuffer"><em>CudaBuffer</em></a><em>, </em><em>..}</em>) – Specify an object that holds (device or host) address that |
| can be accessed from device. This includes objects with |
| types defined in pyarrow.cuda as well as arbitrary objects |
| that implement the CUDA array interface as defined by numba.</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>cbuf</strong> (<em>CudaBuffer</em>) – Device buffer as a view of device accessible memory.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py attribute"> |
| <dt id="pyarrow.cuda.Context.bytes_allocated"> |
| <code class="sig-name descname">bytes_allocated</code><a class="headerlink" href="#pyarrow.cuda.Context.bytes_allocated" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return the number of allocated bytes.</p> |
| </dd></dl> |
| |
| <dl class="py attribute"> |
| <dt id="pyarrow.cuda.Context.device_number"> |
| <code class="sig-name descname">device_number</code><a class="headerlink" href="#pyarrow.cuda.Context.device_number" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return context device number.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.foreign_buffer"> |
| <code class="sig-name descname">foreign_buffer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.foreign_buffer" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Create device buffer from address and size as a view.</p> |
| <p>The caller is responsible for allocating and freeing the |
| memory. When <cite>address==size==0</cite> then a new zero-sized buffer |
| is returned.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><ul class="simple"> |
| <li><p><strong>address</strong> (<em>int</em>) – Specify the starting address of the buffer. The address can |
| refer to both device or host memory but it must be |
| accessible from device after mapping it with |
| <cite>get_device_address</cite> method.</p></li> |
| <li><p><strong>size</strong> (<em>int</em>) – Specify the size of device buffer in bytes.</p></li> |
| <li><p><strong>base</strong> (<em>{None</em><em>, </em><em>object}</em>) – Specify object that owns the referenced memory.</p></li> |
| </ul> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>cbuf</strong> (<em>CudaBuffer</em>) – Device buffer as a view of device reachable memory.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.from_numba"> |
| <em class="property">static </em><code class="sig-name descname">from_numba</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.from_numba" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Create a Context instance from a Numba CUDA context.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>context</strong> (<em>{numba.cuda.cudadrv.driver.Context</em><em>, </em><em>None}</em>) – A Numba CUDA context instance. |
| If None, the current Numba context is used.</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>shared_context</strong> (<em>pyarrow.cuda.Context</em>) – Context instance.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.get_device_address"> |
| <code class="sig-name descname">get_device_address</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.get_device_address" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return the device address that is reachable from kernels running in |
| the context</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>address</strong> (<em>int</em>) – Specify memory address value</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>device_address</strong> (<em>int</em>) – Device address accessible from device context</p> |
| </dd> |
| </dl> |
| <p class="rubric">Notes</p> |
| <p>The device address is defined as a memory address accessible |
| by device. While it is often a device memory address but it |
| can be also a host memory address, for instance, when the |
| memory is allocated as host memory (using cudaMallocHost or |
| cudaHostAlloc) or as managed memory (using cudaMallocManaged) |
| or the host memory is page-locked (using cudaHostRegister).</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.get_num_devices"> |
| <em class="property">static </em><code class="sig-name descname">get_num_devices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.get_num_devices" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return the number of GPU devices.</p> |
| </dd></dl> |
| |
| <dl class="py attribute"> |
| <dt id="pyarrow.cuda.Context.handle"> |
| <code class="sig-name descname">handle</code><a class="headerlink" href="#pyarrow.cuda.Context.handle" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return pointer to context handle.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.new_buffer"> |
| <code class="sig-name descname">new_buffer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.new_buffer" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Return new device buffer.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>nbytes</strong> (<em>int</em>) – Specify the number of bytes to be allocated.</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>buf</strong> (<em>CudaBuffer</em>) – Allocated buffer.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.open_ipc_buffer"> |
| <code class="sig-name descname">open_ipc_buffer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.open_ipc_buffer" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Open existing CUDA IPC memory handle</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Parameters</dt> |
| <dd class="field-odd"><p><strong>ipc_handle</strong> (<a class="reference internal" href="pyarrow.cuda.IpcMemHandle.html#pyarrow.cuda.IpcMemHandle" title="pyarrow.cuda.IpcMemHandle"><em>IpcMemHandle</em></a>) – Specify opaque pointer to CUipcMemHandle (driver API).</p> |
| </dd> |
| <dt class="field-even">Returns</dt> |
| <dd class="field-even"><p><strong>buf</strong> (<em>CudaBuffer</em>) – referencing device buffer</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.synchronize"> |
| <code class="sig-name descname">synchronize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.synchronize" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Blocks until the device has completed all preceding requested |
| tasks.</p> |
| </dd></dl> |
| |
| <dl class="py method"> |
| <dt id="pyarrow.cuda.Context.to_numba"> |
| <code class="sig-name descname">to_numba</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyarrow.cuda.Context.to_numba" title="Permalink to this definition">¶</a></dt> |
| <dd><p>Convert Context to a Numba CUDA context.</p> |
| <dl class="field-list simple"> |
| <dt class="field-odd">Returns</dt> |
| <dd class="field-odd"><p><strong>context</strong> (<em>numba.cuda.cudadrv.driver.Context</em>) – Numba CUDA context instance.</p> |
| </dd> |
| </dl> |
| </dd></dl> |
| |
| </dd></dl> |
| |
| </div> |
| |
| |
| </div> |
| |
| </div> |
| <footer> |
| |
| <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> |
| |
| <a href="pyarrow.cuda.CudaBuffer.html" class="btn btn-neutral float-right" title="pyarrow.cuda.CudaBuffer" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> |
| |
| |
| <a href="../api/cuda.html" class="btn btn-neutral float-left" title="CUDA Integration" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> |
| |
| </div> |
| |
| |
| <hr/> |
| |
| <div role="contentinfo"> |
| <p> |
| |
| © Copyright 2016-2019 Apache Software Foundation |
| |
| </p> |
| </div> |
| |
| |
| |
| Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a |
| |
| <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> |
| |
| provided by <a href="https://readthedocs.org">Read the Docs</a>. |
| |
| </footer> |
| |
| </div> |
| </div> |
| |
| </section> |
| |
| </div> |
| |
| |
| <script type="text/javascript"> |
| jQuery(function () { |
| SphinxRtdTheme.Navigation.enable(true); |
| }); |
| </script> |
| |
| |
| |
| |
| |
| |
| |
| <script type="text/javascript" src="/docs/_static/versionwarning.js"></script></body> |
| </html> |