Skip to content

Commit 6cf56fe

Browse files
author
github-actions[doc-deploy-bot]
committed
Docs for pull request 2099
1 parent 14d9757 commit 6cf56fe

21 files changed

+69
-38
lines changed

pulls/2099/_sources/beginners_guides/installation.rst.txt

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ The following plugins from CodePlay are supported:
159159
.. _codeplay_nv_plugin: https://developer.codeplay.com/products/oneapi/nvidia/
160160
.. _codeplay_amd_plugin: https://developer.codeplay.com/products/oneapi/amd/
161161

162+
Builds for CUDA and AMD devices internally use SYCL alias targets that are passed to the compiler.
163+
A full list of available SYCL alias targets is available in the
164+
`DPC++ Compiler User Manual <https://intel.github.io/llvm/UsersManual.html>`_.
165+
166+
CUDA build
167+
~~~~~~~~~~
168+
162169
``dpctl`` can be built for CUDA devices using the ``DPCTL_TARGET_CUDA`` CMake option,
163170
which accepts a specific compute architecture string:
164171

@@ -173,19 +180,20 @@ set ``DPCTL_TARGET_CUDA`` to a value such as ``ON``, ``TRUE``, ``YES``, ``Y``, o
173180
174181
python scripts/build_locally.py --verbose --cmake-opts="-DDPCTL_TARGET_CUDA=ON"
175182
176-
Note that kernels are built for ``sm_50`` by default, allowing them to work on a wider
177-
range of architectures, but limiting the usage of more recent CUDA features.
183+
Note that kernels are built for the default architecture (``sm_50``), allowing them to work on a
184+
wider range of architectures, but limiting the usage of more recent CUDA features.
178185

179186
For reference, compute architecture strings like ``sm_80`` correspond to specific
180187
CUDA Compute Capabilities (e.g., Compute Capability 8.0 corresponds to ``sm_80``).
181188
A complete mapping between NVIDIA GPU models and their respective
182189
Compute Capabilities can be found in the official
183190
`CUDA GPU Compute Capability <https://developer.nvidia.com/cuda-gpus>`_ documentation.
184191

185-
A full list of available SYCL alias targets is available in the
186-
`DPC++ Compiler User Manual <https://intel.github.io/llvm/UsersManual.html>`_.
192+
AMD build
193+
~~~~~~~~~
187194

188-
To build for AMD devices, use:
195+
``dpctl`` can be built for AMD devices using the ``DPCTL_TARGET_HIP`` CMake option,
196+
which requires specifying a compute architecture string:
189197

190198
.. code-block:: bash
191199
@@ -207,8 +215,13 @@ For example:
207215
.. code-block:: bash
208216
python scripts/build_locally.py --verbose --cmake-opts="-DDPCTL_TARGET_HIP=gfx1030"
209217
210-
It is, however, possible to build for Intel devices, CUDA devices, and an AMD device
211-
architecture all at once:
218+
Multi-target build
219+
~~~~~~~~~~~~~~~~~~
220+
221+
The default ``dpctl`` build from the source enables support of Intel devices only.
222+
Extending the build with a custom SYCL target additionally enables support of CUDA or AMD
223+
device in ``dpctl``. Besides, the support can be also extended to enable both CUDA and AMD
224+
devices at the same time:
212225

213226
.. code-block:: bash
214227

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.asarray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ <h1>dpctl.tensor.asarray<a class="headerlink" href="#dpctl-tensor-asarray" title
810810
<a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><code class="xref py py-class docutils literal notranslate"><span class="pre">dpctl.tensor.usm_ndarray</span></code></a>,
811811
an object representing SYCL USM allocation and implementing
812812
<code class="docutils literal notranslate"><span class="pre">__sycl_usm_array_interface__</span></code> protocol, an instance
813-
of <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>, an object supporting Python buffer
813+
of <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>, an object supporting Python buffer
814814
protocol, a Python scalar, or a (possibly nested) sequence of
815815
Python scalars.</p></li>
816816
<li><p><strong>dtype</strong> (<em>data type</em><em>, </em><em>optional</em>) – output array data type. If <code class="docutils literal notranslate"><span class="pre">dtype</span></code> is

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.astype.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ <h1>dpctl.tensor.astype<a class="headerlink" href="#dpctl-tensor-astype" title="
814814
<li><p><strong>order</strong> (<em>{&quot;C&quot;</em><em>, </em><em>&quot;F&quot;</em><em>, </em><em>&quot;A&quot;</em><em>, </em><em>&quot;K&quot;}</em><em>, </em><em>optional</em>) – Controls memory layout of the resulting array if a copy
815815
is returned.</p></li>
816816
<li><p><strong>casting</strong> (<em>{'no'</em><em>, </em><em>'equiv'</em><em>, </em><em>'safe'</em><em>, </em><em>'same_kind'</em><em>, </em><em>'unsafe'}</em><em>, </em><em>optional</em>) – Controls what kind of data casting may occur. Please see
817-
<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html#numpy.ndarray.astype" title="(in NumPy v2.2)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">numpy.ndarray.astype()</span></code></a> for description of casting modes.</p></li>
817+
<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.astype.html#numpy.ndarray.astype" title="(in NumPy v2.3)"><code class="xref py py-meth docutils literal notranslate"><span class="pre">numpy.ndarray.astype()</span></code></a> for description of casting modes.</p></li>
818818
<li><p><strong>copy</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.13)"><em>bool</em></a><em>, </em><em>optional</em>) – By default, <cite>astype</cite> always returns a newly allocated array.
819819
If this keyword is set to <cite>False</cite>, a view of the input array
820820
may be returned when possible.</p></li>

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.empty.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ <h1>dpctl.tensor.empty<a class="headerlink" href="#dpctl-tensor-empty" title="Pe
809809
<dd class="field-odd"><ul class="simple">
810810
<li><p><strong>shape</strong> (<em>Tuple</em><em>[</em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a><em>]</em><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><em>int</em></a>) – Dimensions of the array to be created.</p></li>
811811
<li><p><strong>dtype</strong> (<em>optional</em>) – data type of the array. Can be typestring,
812-
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, <a class="reference external" href="https://numpy.org/doc/stable/reference/index.html#module-numpy" title="(in NumPy v2.2)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy</span></code></a> char string,
812+
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, <a class="reference external" href="https://numpy.org/doc/stable/reference/index.html#module-numpy" title="(in NumPy v2.3)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy</span></code></a> char string,
813813
or a NumPy scalar type. The <code class="docutils literal notranslate"><span class="pre">None</span></code> value creates an
814814
array of floating point data type. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code></p></li>
815815
<li><p><strong>order</strong> (<code class="docutils literal notranslate"><span class="pre">&quot;C&quot;</span></code>, or <code class="docutils literal notranslate"><span class="pre">F&quot;</span></code>) – memory layout for the array. Default: <code class="docutils literal notranslate"><span class="pre">&quot;C&quot;</span></code></p></li>

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.empty_like.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ <h1>dpctl.tensor.empty_like<a class="headerlink" href="#dpctl-tensor-empty-like"
809809
<dd class="field-odd"><ul class="simple">
810810
<li><p><strong>x</strong> (<a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><em>usm_ndarray</em></a>) – Input array from which to derive the output array shape.</p></li>
811811
<li><p><strong>dtype</strong> (<em>optional</em>) – data type of the array. Can be a typestring,
812-
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, NumPy char string,
812+
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, NumPy char string,
813813
or a NumPy scalar type. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code></p></li>
814814
<li><p><strong>order</strong> (<em>&quot;C&quot;</em><em>, </em><em>&quot;F&quot;</em><em>, </em><em>&quot;A&quot;</em><em>, or </em><em>&quot;K&quot;</em>) – memory layout for the array. Default: <code class="docutils literal notranslate"><span class="pre">&quot;K&quot;</span></code></p></li>
815815
<li><p><strong>device</strong> (<em>optional</em>) – array API concept of device where the output array

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.eye.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ <h1>dpctl.tensor.eye<a class="headerlink" href="#dpctl-tensor-eye" title="Permal
816816
Raises <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#TypeError" title="(in Python v3.13)"><code class="xref py py-exc docutils literal notranslate"><span class="pre">TypeError</span></code></a> if <code class="docutils literal notranslate"><span class="pre">k</span></code> is not an integer.
817817
Default: <code class="docutils literal notranslate"><span class="pre">0</span></code></p></li>
818818
<li><p><strong>dtype</strong> (<em>optional</em>) – data type of the array. Can be typestring,
819-
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, <a class="reference external" href="https://numpy.org/doc/stable/reference/index.html#module-numpy" title="(in NumPy v2.2)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy</span></code></a> char string, or
819+
a <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.dtype.html#numpy.dtype" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.dtype</span></code></a> object, <a class="reference external" href="https://numpy.org/doc/stable/reference/index.html#module-numpy" title="(in NumPy v2.3)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy</span></code></a> char string, or
820820
a NumPy scalar type. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code></p></li>
821821
<li><p><strong>order</strong> (<em>&quot;C&quot;</em><em> or </em><em>&quot;F&quot;</em>) – memory layout for the array. Default: <code class="docutils literal notranslate"><span class="pre">&quot;C&quot;</span></code></p></li>
822822
<li><p><strong>device</strong> (<em>optional</em>) – array API concept of device where the output array

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.from_dlpack.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ <h1>dpctl.tensor.from_dlpack<a class="headerlink" href="#dpctl-tensor-from-dlpac
802802
<dl class="py function">
803803
<dt class="sig sig-object py" id="dpctl.tensor.from_dlpack">
804804
<span class="sig-prename descclassname"><span class="pre">dpctl.tensor.</span></span><span class="sig-name descname"><span class="pre">from_dlpack</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">/</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">device</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">copy</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#dpctl.tensor.from_dlpack" title="Permalink to this definition"></a></dt>
805-
<dd><p>Constructs <a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><code class="xref py py-class docutils literal notranslate"><span class="pre">dpctl.tensor.usm_ndarray</span></code></a> or <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>
805+
<dd><p>Constructs <a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><code class="xref py py-class docutils literal notranslate"><span class="pre">dpctl.tensor.usm_ndarray</span></code></a> or <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>
806806
instance from a Python object <code class="docutils literal notranslate"><span class="pre">x</span></code> that implements <code class="docutils literal notranslate"><span class="pre">__dlpack__</span></code> protocol.</p>
807807
<dl class="field-list simple">
808808
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
@@ -877,7 +877,7 @@ <h1>dpctl.tensor.from_dlpack<a class="headerlink" href="#dpctl-tensor-from-dlpac
877877
depends on where the data backing up input object <code class="docutils literal notranslate"><span class="pre">x</span></code> resides.
878878
If it resides in a USM allocation on a SYCL device, the
879879
type <a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><code class="xref py py-class docutils literal notranslate"><span class="pre">dpctl.tensor.usm_ndarray</span></code></a> is returned, otherwise if it
880-
resides on <code class="docutils literal notranslate"><span class="pre">&quot;kDLCPU&quot;</span></code> device the type is <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>,
880+
resides on <code class="docutils literal notranslate"><span class="pre">&quot;kDLCPU&quot;</span></code> device the type is <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>,
881881
and otherwise an exception is raised.</p>
882882
<div class="admonition note">
883883
<p class="admonition-title">Note</p>
@@ -892,7 +892,7 @@ <h1>dpctl.tensor.from_dlpack<a class="headerlink" href="#dpctl-tensor-from-dlpac
892892
</p>
893893
</dd>
894894
<dt class="field-odd">Return type<span class="colon">:</span></dt>
895-
<dd class="field-odd"><p>Alternative[<a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray">usm_ndarray</a>, <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)">numpy.ndarray</a>]</p>
895+
<dd class="field-odd"><p>Alternative[<a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray">usm_ndarray</a>, <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)">numpy.ndarray</a>]</p>
896896
</dd>
897897
<dt class="field-even">Raises<span class="colon">:</span></dt>
898898
<dd class="field-even"><ul class="simple">

pulls/2099/api_reference/dpctl/generated/dpctl.tensor.from_numpy.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,11 +803,11 @@ <h1>dpctl.tensor.from_numpy<a class="headerlink" href="#dpctl-tensor-from-numpy"
803803
<dt class="sig sig-object py" id="dpctl.tensor.from_numpy">
804804
<span class="sig-prename descclassname"><span class="pre">dpctl.tensor.</span></span><span class="sig-name descname"><span class="pre">from_numpy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">device</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">usm_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'device'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sycl_queue</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../../../_modules/dpctl/tensor/_copy_utils.html#from_numpy"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#dpctl.tensor.from_numpy" title="Permalink to this definition"></a></dt>
805805
<dd><p>Creates <a class="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><code class="xref py py-class docutils literal notranslate"><span class="pre">dpctl.tensor.usm_ndarray</span></code></a> from instance of
806-
<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>.</p>
806+
<a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a>.</p>
807807
<dl class="field-list simple">
808808
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
809809
<dd class="field-odd"><ul class="simple">
810-
<li><p><strong>arg</strong> – Input convertible to <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.2)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a></p></li>
810+
<li><p><strong>arg</strong> – Input convertible to <a class="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.3)"><code class="xref py py-class docutils literal notranslate"><span class="pre">numpy.ndarray</span></code></a></p></li>
811811
<li><p><strong>device</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.13)"><em>object</em></a>) – array API specification of device where the
812812
output array is created. Device can be specified by
813813
a filter selector string, an instance of

0 commit comments

Comments
 (0)