.. _libcudacxx-tile-api: CUDA Tile support ================== `CUDA Tile `_ introduces a new way to program GPUs at a higher level than SIMT. Restrictions ------------ With the compiler taking more control over memory and threading there are a number of restrictions in a tile program: C++ Concurrency support ~~~~~~~~~~~~~~~~~~~~~~ Currently the use of inline ptx / assembly is not allowed in a tile program. All of our threading features rely on inline assembly in some capacity. Consequently, the following headers are not supported in tile mode: - - - - - - - - - - This also affects - - - C++ mathematical operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We rely heavily on compiler builtins or cuda runtime functions to implement C++ standard math functions such as ``cuda::std::exp``. Those compiler builtins are not currently supported in tile mode, so the following header is mostly unsupported in a tile kernel: - ``cuda::std::complex`` is supported except for the various math function overloads that are specialized for complex. C++ customization point objects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The standard library uses __ Customization Point Objects __ to enable user-customization of the behavior of many algorithms and ranges. We rely heavily on those for most of our iterator machinery such as e.g `cuda::std::begin`. Those CPOs are currently not accessible in a tile kernel. A potential workaround is to construct an instance of the empty type, e.g. ``decltype(cuda::std::begin){}(container);`` C++ return statements in loops and switches ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tile currently does not support return statements inside of a ``switch`` or a loop. We can work around most places but not all. This mainly affects algorithms and arch traits. In ```` the following algorithms are not supported in a tile kernel - ``cuda::std::equal_range`` - ``cuda::std::find_end`` - ``cuda::std::find_first_of`` - ``cuda::std::partition`` - ``cuda::std::search`` - ``cuda::std::search_n`` Besides that the content of the following headers is unsupported in a tile program - ```` CUDA device intrinsics ~~~~~~~~~~~~~~~~~~~~~~~ In tile mode the compiler handles threads, warps and blocks. Consequently, the access of CUDA device intrinsics such as ``threadIdx`` is currently not allowed in a tile program. Therefore the following headers are not supported in tile mode: - - - - - CUDA extended floating point types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tile programs treat the CUDA extended floating point types as compiler builtin types. This disallows accessing their internals which we require internally. Support for extended floating point types such as ``__half``, ``__nv_bfloat16`` is only partial in libcu++. Support for extended floating point types of size 8, 6 and 4-bit is disabled. Taking the address of a function ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It is currently not supported to take the address of a function in a tile program. This affects our memory resource machinery, so the following headers are unsupported in tile mode: - - ---- Standard C++ Tile Availability Summary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. |V| unicode:: U+2705 .. |X| unicode:: U+274C .. |P| unicode:: U+1F7E8 .. table:: :widths: 25 25 10 40 +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | **Library** | ``Libcu++`` | Supported since | **Notes** | +====================================================================================+======================================================================================+=================+===========================================================================================================+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support. Some algorithms rely on return statements inside of loops | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires ptx | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires ptx | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |P| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support, requires ptx for clock timers | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires unimplemented compiler builtins for math functions. | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support, requires unimplemented compiler builtins for math functions | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires ptx for clock timers | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |X| | Requires taking the address of member functions | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support. Tile C++ disallows taking the address of functions, so ``mem_fn`` et al are not available| +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |P| 3.4 | Partial support. We rely heavily on CPO's. This affects e.g ``cuda::std::begin`` | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires ptx | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | Accessors, transposed layout, and related functions | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | ``cuda::std::addressof``, ``cuda::std::align``, ``cuda::std::assume_aligned`` | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support. ``double`` on windows is not supported. Extended floating point types are not supported. | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support. We rely heavily on CPO's. This affects e.g ``cuda::std::ranges::begin`` | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |P| 3.4 | Partial support. ``seed_seq`` relies on dynamic memory allocations, so it is not available | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires ptx | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |X| | Requires compiler support | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | :ref:` ` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+ | ` `_ | ```` | |V| 3.4 | | +------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------+-----------------+-----------------------------------------------------------------------------------------------------------+