|
| __host__ __device__ std::uint32_t | makeSpace (std::uint32_t x) noexcept |
| | This makes space in the input 32-bit integer by splitting the bits so they can be interleaved.
|
| |
| __host__ __device__ std::uint32_t | 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.
|
| |
| __host__ __device__ std::uint32_t | 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.
|
| |
| __host__ __device__ std::uint32_t | 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.
|
| |
| __host__ __device__ std::uint32_t | get32BitCode (Real x, Real y, Real z, const GpuArray< amrex::Real, 3 > &plo, const GpuArray< amrex::Real, 3 > &phi) noexcept |
| | Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer.
|
| |
| __host__ __device__ std::uint32_t | get32BitCode (const XDim3 &p, const GpuArray< amrex::Real, 3 > &plo, const GpuArray< amrex::Real, 3 > &phi) noexcept |
| | Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer.
|
| |
| __host__ __device__ std::uint32_t amrex::Morton::get32BitCode |
( |
Real |
x, |
|
|
Real |
y, |
|
|
Real |
z, |
|
|
const GpuArray< amrex::Real, 3 > & |
plo, |
|
|
const GpuArray< amrex::Real, 3 > & |
phi |
|
) |
| |
|
inlinenoexcept |
Given a 3D real-space coordinate, returns a Morton code stored in an unsigned 32 bit integer.
In 3D, this works by converting the coordinate to a 10-bit nonnegative integer in each direction and then interleaving the bits.
In 2D, it is same except the lowest 16 bits of of the coordinates are kept.
It is assumed that plo <= p < phi has already been enforced.
- Parameters
-
| x | the coordinates to convert. |
| y | the coordinates to convert. |
| z | the coordinates to convert. |
| plo | the low end of the domain. |
| phi | the high end of the domain. |
| __host__ __device__ std::uint32_t amrex::Morton::makeSpace |
( |
std::uint32_t |
x | ) |
|
|
inlinenoexcept |
This makes space in the input 32-bit integer by splitting the bits so they can be interleaved.
In 3D, the lowest 10 bits of x are assumed filled, with the next 22 0. On output, x has been "stretched" to 30 bits, with each input bit followed by two interleaving bits set to 0.
In 2D, it is the same except the lowest 16 bits on x are filled, and there is only one interleaving bit.
In 1D no interleaving is needed and x is just returned.
- Parameters
-
| x | unsigned int holding the input to be split |