Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify wrapped spatial message iterator bounds:radius limitation. #176

Merged
merged 1 commit into from
Dec 15, 2023
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
4 changes: 4 additions & 0 deletions src/guide/agent-functions/agent-communication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ If you are using :class:`MessageSpatial2D<flamegpu::MessageSpatial2D>` or :class

If spatial messages will be accessed via the wrapped iterator, all messages must be output within the environment bounds defined for the message list. Accessing out of bounds messages with the wrapped iterator is undefined behaviour.

.. note::

The spatial message radius must be a factor of the environment dimensions if accessing messages via the wrapped iterator.

.. tabs::

.. code-tab:: cuda Agent C++
Expand Down
5 changes: 5 additions & 0 deletions src/guide/defining-messages-communication/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ The :func:`setMin()<flamegpu::MessageSpatial3D::Description::setMin>` and :func:

Spatial messages are automatically assigned ``float`` location variables with the names ``x``, ``y`` (and ``z``). These are used by FLAME GPU internally to sort messages and handle localised accesses, so must be used when outputting messages.


.. note::

The spatial message radius must be a factor of the environment dimensions if messages will be accessed via the wrapped iterator.

Array Specialisation
--------------------

Expand Down