|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
GPU::mortonOrder(): the order to run queries at points in, so that queries at nearby points run side by side (see the ordered GPU::parallelFor() and GPU::transform()). More...
#include <cstdint>#include <type_traits>#include "EBGeometry_GPU.hpp"#include "EBGeometry_PODVector.hpp"#include "EBGeometry_Pool.hpp"#include "EBGeometry_Vec.hpp"#include "EBGeometry_GPUOrderImplem.hpp"

Go to the source code of this file.
Namespaces | |
| namespace | EBGeometry |
| Namespace containing all of EBGeometry's functionality. | |
| namespace | EBGeometry::GPU |
| Backend-neutral GPU runtime API surface (CUDA or HIP). | |
Functions | |
| template<class Source > | |
| void | EBGeometry::GPU::mortonOrder (MemoryResource &a_where, const Source &a_source, PODSpan< uint32_t > a_order) |
| Write into a_order the order to run queries at a source's points in: the permutation of 0, ..., n - 1 (n = a_order.size()) that sorts the points along a Morton curve over their bounding box, ties broken by index. Runs on the device, with a bitonic sort, when a_where's memory is device-accessible in a CUDA or HIP build; on the host, with a sort, otherwise. Both give the same order, element for element. | |
| template<class Source > | |
| void | EBGeometry::GPU::mortonOrder (const Pool &a_pool, const Source &a_source, PODVector< uint32_t > &a_order) |
| Write into a_order, an array in a_pool, the order to run queries at a source's points in; the span overload on a_pool's resource, for an order reserved in a pool. | |
GPU::mortonOrder(): the order to run queries at points in, so that queries at nearby points run side by side (see the ordered GPU::parallelFor() and GPU::transform()).
Queries that arrive in no spatial order (particles of a simulation, points sampled at random) make neighboring threads of a device walk unrelated parts of a BVH, and a host loop jump around in memory. Sorting the points along a Morton curve over their bounding box puts nearby points next to each other; the ordered launches then run the queries in that order while every result still lands at its input's index. The order depends on the points only, so it is computed once and reused while they stay put.