Generators ========== SlangPy provides a way to generate data dynamically within kernels, eliminating the need to supply it in a buffer or tensor. This is achieved using generators. Code for all generator examples can be found `here `_ Generators can be passed to a Slang function in Python just like any other argument. When the kernel runs, the correct values are automatically passed to the corresponding parameter. For example, the following code demonstrates how to pass the `call_id` generator to a kernel: .. code-block:: python res = np.zeros((4,4,2), dtype=np.int32) module.myfunc(spy.call_id(), _result=res) The current generators available in SlangPy are: - :ref:`Call Id ` - :ref:`Thread Id ` - :ref:`Wang Hash ` - :ref:`Rand float ` - :ref:`Grid `