Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions projects/rocprim/docs/how-to/rocPRIM-spir-v.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,19 @@ Using SPIR-V with rocPRIM

rocPRIM supports building with target-agnostic SPIR-V.

.. note::

SPIR-V is in an early access state. Using it in production is not recommended.

To build with SPIR-V, set the ``ROCPRIM_EXPERIMENTAL_SPIRV`` parameter to any non-zero value, and set ``--offload-arch`` to ``amdgcnspirv``.
To build with SPIR-V, set ``--offload-arch`` to ``amdgcnspirv``.

For example, with hipcc:

.. code:: shell

hipcc -DROCPRIM_EXPERIMENTAL_SPIRV=1 --offload-arch=amdgcnspirv
hipcc --offload-arch=amdgcnspirv

For example, with cmake:

.. code:: shell

cmake -DCMAKE_CXX_FLAGS="-DROCPRIM_EXPERIMENTAL_SPIRV=1 --offload-arch=amdgcnspirv"


.. note::

rocPRIM does not support mixed compilation targets. No other target can be set when ``--offload-arch=amdgcnspirv`` is used.

Setting ``ROCPRIM_EXPERIMENTAL_SPIRV`` will disable all config dispatching.

cmake --offload-arch=amdgcnspirv"

When targeting SPIR-V, the hardware wavefront size (also known as warp size) is not known
at compile time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ constexpr arch::wavefront::target get_wavefront_size(const gen gen = gen::unknow
*/
constexpr target_arch device_target_arch()
{
#if defined(__amdgcn_processor__) && !defined(ROCPRIM_EXPERIMENTAL_SPIRV)
#if defined(__amdgcn_processor__)
// The terminating zero is not counted in the length of the string
return get_target_arch_from_name(__amdgcn_processor__,
sizeof(__amdgcn_processor__) - sizeof('\0'));
Expand Down
4 changes: 0 additions & 4 deletions projects/rocprim/test/rocprim/test_config_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ TEST(RocprimConfigDispatchTests, GetTargetArch)
ASSERT_TRUE(get_target_arch_from_name("gfx803", 6) == target_arch::gfx803);
}

#if !defined(ROCPRIM_EXPERIMENTAL_SPIRV) // This macro disables the config_dispatching

TEST(RocprimConfigDispatchTests, HostMatchesDevice)
{
const int device_id = test_common_utils::obtain_device_from_ctest();
Expand Down Expand Up @@ -147,8 +145,6 @@ TEST(RocprimConfigDispatchTests, ParseCommonArches)
ASSERT_EQ(parse_gcn_arch("gfx90a:sramecc+:xnack-"), target_arch::gfx90a);
}

#endif // ROCPRIM_EXPERIMENTAL_SPIRV

#ifndef _WIN32
TEST(RocprimConfigDispatchTests, DeviceIdFromStream)
{
Expand Down
Loading