Brick Library 0.1
Performance-portable stencil datalayout & codegen
Static Public Member Functions | Public Attributes | List of all members
BrickStorage Struct Reference

Initializing and holding the storage of bricks. More...

#include <brick.h>

Static Public Member Functions

static BrickStorage allocate (long chunks, size_t step)
 Allocation using *alloc. More...
 
static BrickStorage mmap_alloc (long chunks, long step)
 mmap allocator using default (new) file More...
 
static BrickStorage mmap_alloc (long chunks, long step, void *mmap_fd, size_t offset)
 mmap allocator using specified file starting from certain offset More...
 

Public Attributes

std::shared_ptr< bElemdat
 Pointer holding brick data. More...
 
long chunks
 Number of chunks. More...
 
size_t step
 Size of a chunk in number of elements. More...
 
void * mmap_info = nullptr
 MMAP data structure when using mmap as allocator. More...
 
long step
 

Detailed Description

Initializing and holding the storage of bricks.

It requires knowing how many bricks to store before allocating.

Built-in allocators are host-only.

Member Function Documentation

◆ allocate()

static BrickStorage BrickStorage::allocate ( long  chunks,
size_t  step 
)
inlinestatic

Allocation using *alloc.

◆ mmap_alloc() [1/2]

BrickStorage BrickStorage::mmap_alloc ( long  chunks,
long  step 
)
static

mmap allocator using default (new) file

◆ mmap_alloc() [2/2]

BrickStorage BrickStorage::mmap_alloc ( long  chunks,
long  step,
void *  mmap_fd,
size_t  offset 
)
static

mmap allocator using specified file starting from certain offset

Member Data Documentation

◆ chunks

long BrickStorage::chunks

Number of chunks.

A chunk can contain multiple bricks from different sub-fields. Forming structure-of-array.

◆ dat

std::shared_ptr< bElem > BrickStorage::dat

Pointer holding brick data.

◆ mmap_info

void * BrickStorage::mmap_info = nullptr

MMAP data structure when using mmap as allocator.

◆ step [1/2]

size_t BrickStorage::step

Size of a chunk in number of elements.

◆ step [2/2]

long BrickStorage::step

The documentation for this struct was generated from the following files: