LvArray
Classes | Namespaces | Typedefs | Functions
bufferManipulation.hpp File Reference

Contains functions for manipulating buffers. More...

#include "LvArrayConfig.hpp"
#include "Macros.hpp"
#include "typeManipulation.hpp"
#include "arrayManipulation.hpp"
#include <camp/resource.hpp>
#include <utility>
Include dependency graph for bufferManipulation.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LvArray::bufferManipulation::VoidBuffer
 This class implements the default behavior for the Buffer methods related to execution space. This class is not intended to be used directly, instead derive from it if you would like to inherit the default behavior. More...
 

Namespaces

 LvArray
 The top level namespace.
 
 LvArray::bufferManipulation
 Contains template functions for performing common operations on buffers.
 

Typedefs

using LvArray::MemorySpace = camp::resources::Platform
 an alias for camp::resources::Platform.
 

Functions

std::ostream & LvArray::operator<< (std::ostream &os, MemorySpace const space)
 Output a Platform enum to a stream. More...
 
 LvArray::bufferManipulation::HAS_MEMBER_FUNCTION_NO_RTYPE (move, MemorySpace::host, true)
 Defines a static constexpr bool HasMemberFunction_move< CLASS > that is true iff the class has a method move(MemorySpace, bool). More...
 
template<typename BUFFER >
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK void LvArray::bufferManipulation::check (BUFFER const &buf, std::ptrdiff_t const size)
 Check that given Buffer and size are valid. More...
 
template<typename BUFFER >
void LvArray::bufferManipulation::checkInsert (BUFFER const &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos)
 Check that given Buffer, size, and insertion position, are valid. More...
 
template<typename BUFFER >
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE void LvArray::bufferManipulation::free (BUFFER &buf, std::ptrdiff_t const size)
 Destroy the values in the buffer and free it's memory. More...
 
template<typename BUFFER >
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE void LvArray::bufferManipulation::setCapacity (BUFFER &buf, std::ptrdiff_t const size, MemorySpace const space, std::ptrdiff_t const newCapacity)
 Set the capacity of the buffer. More...
 
template<typename BUFFER >
LVARRAY_HOST_DEVICE void LvArray::bufferManipulation::reserve (BUFFER &buf, std::ptrdiff_t const size, MemorySpace const space, std::ptrdiff_t const newCapacity)
 Reserve space in the buffer for at least the given capacity. More...
 
template<typename BUFFER >
void LvArray::bufferManipulation::dynamicReserve (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newCapacity)
 If the buffer's capacity is greater than newCapacity this is a no-op. Otherwise the buffer's capacity is increased to at least 2 * newCapacity. More...
 
template<typename BUFFER , typename ... ARGS>
LVARRAY_HOST_DEVICE void LvArray::bufferManipulation::resize (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const newSize, ARGS &&... args)
 Resize the buffer to the given size. More...
 
template<typename BUFFER , typename ... ARGS>
void LvArray::bufferManipulation::emplaceBack (BUFFER &buf, std::ptrdiff_t const size, ARGS &&... args)
 Construct a new value at the end of the buffer. More...
 
template<typename BUFFER , typename ... ARGS>
void LvArray::bufferManipulation::emplace (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos, ARGS &&... args)
 Construct a new value at position pos. More...
 
template<typename BUFFER , typename ITER >
std::ptrdiff_t LvArray::bufferManipulation::insert (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos, ITER const first, ITER const last)
 Insert multiple values into the buffer. More...
 
template<typename BUFFER >
void LvArray::bufferManipulation::popBack (BUFFER &buf, std::ptrdiff_t const size)
 Remove a value from the end of the buffer. More...
 
template<typename BUFFER >
void LvArray::bufferManipulation::erase (BUFFER &buf, std::ptrdiff_t const size, std::ptrdiff_t const pos)
 Erase a value from the buffer. More...
 
template<typename DST_BUFFER , typename SRC_BUFFER >
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE void LvArray::bufferManipulation::copyInto (DST_BUFFER &dst, std::ptrdiff_t const dstSize, SRC_BUFFER const &src, std::ptrdiff_t const srcSize)
 Copy values from the source buffer into the destination buffer. More...
 

Detailed Description

Contains functions for manipulating buffers.