Block-Structured AMR Software Framework
AMReX_Morton.H File Reference
#include <AMReX_Config.H>
#include <AMReX_REAL.H>
#include <AMReX_Dim3.H>
#include <AMReX_Array.H>
#include <AMReX_GpuQualifiers.H>
#include <cstdint>

Go to the source code of this file.

Namespaces

 amrex
 
 amrex::Morton
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint32_t amrex::Morton::makeSpace (std::uint32_t x) noexcept
 This makes space in the input 32-bit integer by splitting the bits so they can be interleaved. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint32_t amrex::Morton::toUInt10 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping only 10 significant bits. This puts the first 10 bits of x into retval with the 22 highest bits set to 0. It is assumed that xmin <= x < xmax. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint32_t amrex::Morton::toUInt16 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping only 16 significant bits. This puts the first 16 bits of x into retval with the 16 highest bits set to 0. It is assumed that xmin <= x < xmax. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint32_t amrex::Morton::toUInt32 (amrex::Real x, amrex::Real xmin, amrex::Real xmax) noexcept
 Convert a Real to a uint32, keeping all significant bits. It is assumed that xmin <= x < xmax. More...
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE std::uint32_t amrex::Morton::get32BitCode (AMREX_D_DECL(Real x, Real y, Real z), const GpuArray< amrex::Real, AMREX_SPACEDIM > &plo, const GpuArray< amrex::Real, AMREX_SPACEDIM > &phi) noexcept
 Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer. More...