Combine Tile Code and SIMT Library Calls in One Kernel with NVIDIA CUDA Tile NVIDIA's CUDA 13.5 introduces a preview of Tile/SIMT interoperability that lets tile kernels call device functions from supported NVIDIA SIMT libraries directly, eliminating the global-memory round trip that previously forced such computations into separate kernels. The compiler queries a library-supplied .tilelib file with tile shapes, data types and target GPU, then selects a SIMT implementation and links it into a single kernel at compile time via the tileiras compiler. Libraries shipping or scheduled to add tilelibs include NVIDIA MathDx Tile 0.5.0 (cuFFTDx, cuBLASDx, cuSolverDx, nvCOMPDx), NVSHMEM 3.9.0 and NVIDIA Warp 1.20.0. NVIDIA CUDA Tile enables you to write GPU kernels in terms of tiles instead of threads. You load a tile of data, operate on it as a whole, and store the result. The compiler maps those operations to threads and manages shared memory and Tensor Cores. Before CUDA 13.5, tile kernels could not call SIMT single instruction, multiple threads library device functions directly. If a computation needed a library operation between two stages of tile code, those stages had to run in separate kernels, exchanging intermediate results through global memory. CUDA 13.5 introduces a preview of Tile/SIMT interoperability. A tile kernel can now call device functions from supported NVIDIA SIMT libraries, avoiding that intermediate exchange through global memory. This post shows you how to make these calls in Python and C++, how the compiler connects the two programming models, and how applications use interop to combine tile code with SIMT libraries. How CUDA Tile calls SIMT library functions In a tile kernel, the compiler decides how each tile is distributed across the threads of a block. SIMT library functions require a specific thread and data layout. An NVIDIA cuFFTDx transform runs on a set number of threads, with each thread holding particular elements, and it may use shared memory and barriers. When tile code calls one of these functions, the compiler uses these requirements to set up the call. Libraries provide that information in a tilelib , a file with the .tilelib extension that ships with the library. A tilelib lists the functions the library exposes to tile code, with their parameters and result types. For each call in your kernel, the compiler queries the tilelib with the tile shapes, data types, and target GPU, and the tilelib returns one or more SIMT implementations. Each implementation states how many threads it runs on, which elements each thread holds, how much shared memory it needs, and how it synchronizes. An implementation can run one call per thread, one per warp, or one across the whole thread block. The tile compiler, tileiras , selects an implementation that fits the rest of the kernel, arranges the tile data to match it, allocates the required shared memory, inserts barriers if necessary, and links the SIMT code into the kernel. This happens at compile time, and the result is a single kernel, as shown in Figure 1. The following library releases provide tilelibs or are scheduled to add them: - NVIDIA MathDx Tile 0.5.0 https://docs.nvidia.com/cuda/mathdx tile/index.html : cuFFTDx, cuBLASDx, cuSolverDx, and nvCOMPDx - NVIDIA NVSHMEM 3.9.0 https://docs.nvidia.com/nvshmem/api/latest/index.html : communication between GPUs from tile code - NVIDIA Warp 1.20.0 https://nvidia.github.io/warp/stable/ : GPU acceleration for computational physics, AI, and optimization workflows Call SIMT libraries from CUDA Tile kernels The following examples show how to call cuFFTDx from cuTile Python and CUDA Tile C++ to compute a batch of fast Fourier transforms FFTs . The multi-GPU FFT application later in this post shows the same call in a kernel that combines FFTs and communication. Call cuFFTDx from cuTile Python In Python, libraries expose functions that you call inside an @ct.kernel function. MathDx provides these functions through modules such as nvmath.tile.fft , nvmath.tile.linalg , and nvmath.tile.compress . The following FFT call takes a tile and returns a tile. python import cuda.tile as ct import nvmath.tile.fft as mfft Inside a @ct.kernel function: data = ct.load signals, ct.bid 0 , 0, 0 , shape= ROWS, N, 2 tile code spectrum = mfft.fft data, axis=1 SIMT library code: cuFFTDx data holds ROWS signals of length N, and mfft.fft transforms each one. These modules wrap foreign call , a function in the cuda-tile-preview package that invokes functions exposed by a tilelib. You can use it to call a library that ships a tilelib but no Python module. The following example makes the same FFT call directly through the cuFFTDx tilelib: python from cuda import tile preview as tp pip install cuda-tile-preview CUFFTDX = tp.Tilelib path="/path/to/cufftdx.tilelib", version="0.5.0" Inside the kernel, in place of mfft.fft: spectrum, = tp.foreign call tilelibs= CUFFTDX, , symbol name="fft", constant params= 2, 1, ROWS, N, ct.float32 , transform axis, tile shape, precision inputs= ct.reshape data, 1, ROWS, N, 2 , , output types= ct.float32, 1, ROWS, N, 2 , , spectrum = ct.reshape spectrum, ROWS, N, 2 Each argument of foreign call tells the compiler something it needs: - tilelibs : Libraries to search for the function. Each tilelib version contributes to the cuTile compilation cache key; changing it triggers kernel recompilation. - symbol name : Name of the function to call. - constant params : Compile-time parameters. The library uses them to choose and generate an implementation. In this example, they’re the transform axis, the tile shape, and the precision. The cuFFTDx function takes a 3D batch of signals, so the call adds a leading dimension of size 1. - inputs : Tiles and scalars passed at run time. - output types : Data type and shape of each result. The library modules make these calls for you. They locate the tilelib, derive constant parameters from tile shapes, and report shape and type errors. Call cuFFTDx from CUDA Tile C++ In C++, include the library’s Tile header and call its functions from a tile global kernel: include "cufftdx tile.hpp" // Inside a tile global function; data is a ct::tile