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, long 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

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

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,
long  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

bElem* BrickStorage::dat

Pointer holding brick data.

◆ mmap_info

void* BrickStorage::mmap_info = nullptr

MMAP data structure when using mmap as allocator.

◆ step

long BrickStorage::step

Size of a chunk in number of elements.


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