OpenVDB: nanovdb/util/ForEach.h File Reference

OpenVDB 11.0.0

Loading...
Searching...
No Matches
Namespaces | Functions
ForEach.h File Reference

A unified wrapper for tbb::parallel_for and a naive std::thread fallback. More...

`#include "Range.h"`
`#include <thread>`
`#include <mutex>`
`#include <vector>`

Go to the source code of this file.

## Namespaces
namespace | nanovdb
| Convert a base-pointer to an openvdb grid, denoted srcGrid, to a nanovdb grid of the same type, e.g. float -> float or openvdb::Vec3f -> nanovdb::Vec3f.

## Functions
template<typename RangeT , typename FuncT >
void | forEach (RangeT range, const FuncT &func)
| simple wrapper for tbb::parallel_for with a naive std fallback
template<typename FuncT >
void | forEach (size_t begin, size_t end, size_t grainSize, const FuncT &func)
| Simple wrapper for the function defined above.
template<template< typename... > class ContainerT, typename... T, typename FuncT >
void | forEach (const ContainerT< T... > &c, const FuncT &func)
| Simple wrapper for the function defined above, which works with std::containers.
template<template< typename... > class ContainerT, typename... T, typename FuncT >
void | forEach (const ContainerT< T... > &c, size_t grainSize, const FuncT &func)
| Simple wrapper for the function defined above, which works with std::containers.

## Detailed Description

A unified wrapper for tbb::parallel_for and a naive std::thread fallback.

Author
  Ken Museth

Date
  August 24, 2020