Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
// Copyright Contributors to the OpenVDB Project
// SPDX-License-Identifier: MPL-2.0
#pragma once
#include <cmath>
#include <chrono>
#include <fstream>
#include <nanovdb/NanoVDB.h>
#include "ComputePrimitives.h"
// http://www.burtleburtle.net/bob/hash/doobs.html
inline __hostdev__ uint32_t hash(uint32_t x)
{
x += (x << 10u);
x ^= (x >> 6u);
x += (x << 3u);
x ^= (x >> 11u);
x += (x << 15u);
return x;
}
inline __hostdev__ float randomf(uint32_t s)
{
return hash(s) / float(0xffffffffu);
}
ComputePrimitives.h
A collection of parallel compute primitives.
NanoVDB.h
Implements a light-weight self-contained VDB data-structure in a single file! In other words,...
__hostdev__
#define __hostdev__
Definition NanoVDB.h:192
randomf
__hostdev__ float randomf(uint32_t s)
Definition common.h:23
hash
__hostdev__ uint32_t hash(uint32_t x)
Definition common.h:13