OpenVDB: nanovdb/examples/ex_collide_level_set/common.h Source File

OpenVDB 12.1.1

Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1// Copyright Contributors to the OpenVDB Project
2// SPDX-License-Identifier: Apache-2.0
3
4#pragma once
5
6#define _USE_MATH_DEFINES
7#include <cmath>
8#include <chrono>
9#include <fstream>
10#include <nanovdb/NanoVDB.h>
11#include "ComputePrimitives.h"
12
13// http://www.burtleburtle.net/bob/hash/doobs.html
14 inline __hostdev__ uint32_t hash(uint32_t x)
15{
16 x += (x << 10u);
17 x ^= (x >> 6u);
18 x += (x << 3u);
19 x ^= (x >> 11u);
20 x += (x << 15u);
21 return x;
22}
23
24 inline __hostdev__ float randomf(uint32_t s)
25{
26 return hash(s) / float(0xffffffffu);
27}
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,...
randomf
__hostdev__ float randomf(uint32_t s)
Definition common.h:24
hash
__hostdev__ uint32_t hash(uint32_t x)
Definition common.h:14
__hostdev__
#define __hostdev__
Definition Util.h:73