Skip to content

Commit

Permalink
Rebase issues fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neon60 committed Oct 9, 2024
1 parent 5fedf3d commit 3765885
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
19 changes: 9 additions & 10 deletions docs/how-to/hip_runtime_api/memory_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,21 @@ Memory allocation
The following API calls with result in these allocations:

.. list-table:: Memory coherence control
:widths: 25, 35, 20, 20
:header-rows: 1
:align: center

* - API
- System allocated
- :cpp:func:`hipMallocManaged`
- :cpp:func:`hipHostMalloc`
- :cpp:func:`hipMalloc`
* - Data location
- Data location
- Allocation
* - System allocated
- Host
- Host
- Host
- Device
* - Allocation
- :ref:`Pageable <pageable_host_memory>`
* - :cpp:func:`hipMallocManaged`
- Host
- :ref:`Managed <unified_memory>`
* - :cpp:func:`hipHostMalloc`
- Host
- :ref:`Pinned <pinned_host_memory>`
* - :cpp:func:`hipMalloc`
- Device
- Pinned
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Texture fetching
*******************************************************************************

`Textures <../../../doxygen/html/group___texture.html>`_ are more than just a buffer
`Textures <../../../../doxygen/html/group___texture.html>`_ are more than just a buffer
interpreted as a 1D, 2D, or 3D array.

As textures are associated with graphics, they are indexed using floating-point
Expand All @@ -34,7 +34,7 @@ sections.
Here is the sample texture used in this document for demonstration purposes. It
is 2x2 texels and indexed in the [0 to 1] range.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/original.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/original.png
:width: 150
:alt: Sample texture
:align: center
Expand Down Expand Up @@ -68,7 +68,7 @@ The following image shows a texture stretched to a 4x4 pixel quad but still
indexed in the [0 to 1] range. The in-between values are the same as the values
of the nearest texel.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/nearest.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/nearest.png
:width: 300
:alt: Texture upscaled with nearest point sampling
:align: center
Expand Down Expand Up @@ -99,7 +99,7 @@ This following image shows a texture stretched out to a 4x4 pixel quad, but
still indexed in the [0 to 1] range. The in-between values are interpolated
between the neighboring texels.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/linear.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/linear.png
:width: 300
:alt: Texture upscaled with linear filtering
:align: center
Expand All @@ -126,7 +126,7 @@ bounds. The border value must be set before texture fetching.
The following image shows the texture on a 4x4 pixel quad, indexed in the
[0 to 3] range. The out-of-bounds values are the border color, which is yellow.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/border.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/border.png
:width: 300
:alt: Texture with yellow border color
:align: center
Expand All @@ -149,7 +149,7 @@ The following image shows the texture on a 4x4 pixel quad, indexed in the
[0 to 3] range. The out-of-bounds values are repeating the values at the edge of
the texture.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/clamp.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/clamp.png
:width: 300
:alt: Texture with clamp addressing
:align: center
Expand All @@ -174,7 +174,7 @@ This creates a repeating image effect.
The following image shows the texture on a 4x4 pixel quad, indexed in the
[0 to 3] range. The out-of-bounds values are repeating the original texture.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/wrap.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/wrap.png
:width: 300
:alt: Texture with wrap addressing
:align: center
Expand Down Expand Up @@ -203,7 +203,7 @@ The following image shows the texture on a 4x4 pixel quad, indexed in The
[0 to 3] range. The out-of-bounds values are repeating the original texture, but
mirrored.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/textures/mirror.png
.. figure:: ../../../../data/how-to/hip_runtime_api/memory_management/textures/mirror.png
:width: 300
:alt: Texture with mirror addressing
:align: center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ models described above use the same allocation flags, and the difference is in
how the surrounding code uses the host memory.

The one exception is when the ``hipHostMallocCoherent`` and
``hipHostMallocNonCoherent``flags are set, what is an illegal state.
``hipHostMallocNonCoherent`` flags are set, what is an illegal state.

.. note::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ within a system. This setup simplifies memory management processes and enables
applications to allocate data that can be read or written by code running on
either CPUs or GPUs. The Unified memory model is shown in the following figure.

.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/unified_memory/old.svg
.. figure:: ../../../data/how-to/hip_runtime_api/memory_management/unified_memory/um.svg

.. _unified memory system requirements:

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ On non-AMD platforms, like NVIDIA, HIP provides header files required to support
* {doc}`./how-to/hip_runtime_api`
* {doc}`./how-to/hip_runtime_api/memory_management`
* {doc}`./how-to/hip_runtime_api/cooperative_groups`
* {doc}`./how-to/hipgraph`
* {doc}`./how-to/hip_runtime_api/hipgraph`
* [HIP porting guide](./how-to/hip_porting_guide)
* [HIP porting: driver API guide](./how-to/hip_porting_driver_api)
* {doc}`./how-to/hip_rtc`
Expand Down

0 comments on commit 3765885

Please sign in to comment.