Viskores  1.0
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
viskores::cont::CellLocatorTwoLevel Class Reference

A locator that uses 2 nested levels of grids. More...

#include <CellLocatorTwoLevel.h>

Inheritance diagram for viskores::cont::CellLocatorTwoLevel:
viskores::cont::CellLocatorBase viskores::cont::ExecutionObjectBase

Public Types

using SupportedCellSets = ::viskores::cont::internal::CellSetList
 
using CellExecObjectList = viskores::ListTransform< SupportedCellSets, CellSetContToExec >
 
using CellLocatorExecList = viskores::ListTransform< CellExecObjectList, viskores::exec::CellLocatorTwoLevel >
 
using ExecObjType = viskores::ListApply< CellLocatorExecList, viskores::exec::CellLocatorMultiplexer >
 
using LastCell = typename ExecObjType::LastCell
 

Public Member Functions

 CellLocatorTwoLevel ()
 
void SetDensityL1 (viskores::FloatDefault val)
 Specify the desired approximate number of cells per level 1 bin. More...
 
viskores::FloatDefault GetDensityL1 () const
 Specify the desired approximate number of cells per level 1 bin. More...
 
void SetDensityL2 (viskores::FloatDefault val)
 Specify the desired approximate number of cells per level 2 bin. More...
 
viskores::FloatDefault GetDensityL2 () const
 Specify the desired approximate number of cells per level 2 bin. More...
 
void PrintSummary (std::ostream &out) const
 Print a summary of the state of this locator. More...
 
ExecObjType PrepareForExecution (viskores::cont::DeviceAdapterId device, viskores::cont::Token &token) const
 
- Public Member Functions inherited from viskores::cont::CellLocatorBase
virtual ~CellLocatorBase ()=default
 
const viskores::cont::UnknownCellSetGetCellSet () const
 Specify the CellSet defining the structure of the cells being searched. More...
 
void SetCellSet (const viskores::cont::UnknownCellSet &cellSet)
 Specify the CellSet defining the structure of the cells being searched. More...
 
const viskores::cont::CoordinateSystemGetCoordinates () const
 Specify the CoordinateSystem defining the location of the cells. More...
 
void SetCoordinates (const viskores::cont::CoordinateSystem &coords)
 Specify the CoordinateSystem defining the location of the cells. More...
 
void SetCoordinates (const viskores::cont::UnknownArrayHandle &coords)
 Specify the CoordinateSystem defining the location of the cells. More...
 
void Update () const
 Build the search structure used to look up cells. More...
 

Private Types

template<typename CellSetCont >
using CellSetContToExec = typename CellSetCont::template ExecConnectivityType< viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint >
 

Private Member Functions

void Build () override
 

Private Attributes

viskores::FloatDefault DensityL1
 
viskores::FloatDefault DensityL2
 
viskores::internal::cl_uniform_bins::Grid TopLevel
 
viskores::cont::ArrayHandle< viskores::internal::cl_uniform_bins::DimVec3LeafDimensions
 
viskores::cont::ArrayHandle< viskores::IdLeafStartIndex
 
viskores::cont::ArrayHandle< viskores::IdCellStartIndex
 
viskores::cont::ArrayHandle< viskores::IdCellCount
 
viskores::cont::ArrayHandle< viskores::IdCellIds
 

Additional Inherited Members

- Protected Member Functions inherited from viskores::cont::CellLocatorBase
void SetModified ()
 
bool GetModified () const
 

Detailed Description

A locator that uses 2 nested levels of grids.

CellLocatorTwoLevel creates a cell search structure using two levels of structured grids. The first level is a coarse grid that covers the entire region of the data. It is expected that the distributions of dataset cells in this coarse grid will be very uneven. Within each bin of the coarse grid, a second level grid is defined within the spatial bounds of the coarse bin. The size of this second level grid is proportional to the number of cells in the first level. In this way, the second level grids adapt to the distribution of cells being located. The adaption is not perfect, but it is has very good space efficiency and is fast to generate and use.

The algorithm used in CellLocatorTwoLevel is described in the following publication:

Javor Kalojanov, Markus Billeter, and Philipp Slusallek. "Two-Level Grids for Ray Tracing on GPUs." Computer Graphics Forum, 2011, pages 307-314. DOI 10.1111/j.1467-8659.2011.01862.x

Member Typedef Documentation

◆ CellExecObjectList

◆ CellLocatorExecList

◆ CellSetContToExec

template<typename CellSetCont >
using viskores::cont::CellLocatorTwoLevel::CellSetContToExec = typename CellSetCont::template ExecConnectivityType<viskores::TopologyElementTagCell, viskores::TopologyElementTagPoint>
private

◆ ExecObjType

◆ LastCell

using viskores::cont::CellLocatorTwoLevel::LastCell = typename ExecObjType::LastCell

◆ SupportedCellSets

using viskores::cont::CellLocatorTwoLevel::SupportedCellSets = ::viskores::cont::internal::CellSetList

Constructor & Destructor Documentation

◆ CellLocatorTwoLevel()

viskores::cont::CellLocatorTwoLevel::CellLocatorTwoLevel ( )
inline

Member Function Documentation

◆ Build()

void viskores::cont::CellLocatorTwoLevel::Build ( )
overrideprivatevirtual

◆ GetDensityL1()

viskores::FloatDefault viskores::cont::CellLocatorTwoLevel::GetDensityL1 ( ) const
inline

Specify the desired approximate number of cells per level 1 bin.

The default value is 32.

◆ GetDensityL2()

viskores::FloatDefault viskores::cont::CellLocatorTwoLevel::GetDensityL2 ( ) const
inline

Specify the desired approximate number of cells per level 2 bin.

This value should be relatively small as it is close to the average number of cells that must be checked for each find. The default value is 2.

◆ PrepareForExecution()

ExecObjType viskores::cont::CellLocatorTwoLevel::PrepareForExecution ( viskores::cont::DeviceAdapterId  device,
viskores::cont::Token token 
) const

◆ PrintSummary()

void viskores::cont::CellLocatorTwoLevel::PrintSummary ( std::ostream &  out) const

Print a summary of the state of this locator.

◆ SetDensityL1()

void viskores::cont::CellLocatorTwoLevel::SetDensityL1 ( viskores::FloatDefault  val)
inline

Specify the desired approximate number of cells per level 1 bin.

The default value is 32.

◆ SetDensityL2()

void viskores::cont::CellLocatorTwoLevel::SetDensityL2 ( viskores::FloatDefault  val)
inline

Specify the desired approximate number of cells per level 2 bin.

This value should be relatively small as it is close to the average number of cells that must be checked for each find. The default value is 2.

Member Data Documentation

◆ CellCount

viskores::cont::ArrayHandle<viskores::Id> viskores::cont::CellLocatorTwoLevel::CellCount
private

◆ CellIds

viskores::cont::ArrayHandle<viskores::Id> viskores::cont::CellLocatorTwoLevel::CellIds
private

◆ CellStartIndex

viskores::cont::ArrayHandle<viskores::Id> viskores::cont::CellLocatorTwoLevel::CellStartIndex
private

◆ DensityL1

viskores::FloatDefault viskores::cont::CellLocatorTwoLevel::DensityL1
private

◆ DensityL2

viskores::FloatDefault viskores::cont::CellLocatorTwoLevel::DensityL2
private

◆ LeafDimensions

viskores::cont::ArrayHandle<viskores::internal::cl_uniform_bins::DimVec3> viskores::cont::CellLocatorTwoLevel::LeafDimensions
private

◆ LeafStartIndex

viskores::cont::ArrayHandle<viskores::Id> viskores::cont::CellLocatorTwoLevel::LeafStartIndex
private

◆ TopLevel

viskores::internal::cl_uniform_bins::Grid viskores::cont::CellLocatorTwoLevel::TopLevel
private

The documentation for this class was generated from the following file: