25#ifndef GPU_CUDA_COLUMN_H
26#define GPU_CUDA_COLUMN_H
54 std::unique_ptr<Data> _data;
64 const T&
operator[](std::size_t i)
const override;
67 std::size_t
size()
const;
69 const T*
data()
const;
77 void resize(std::size_t newCount);
90 bool*
getBlock(std::size_t iBlock, std::size_t& sizeBlock,
bool loadingMode)
override;
104 const std::ptrdiff_t _count;
105 const std::size_t _size;
108 std::unique_ptr<Data> _data;
111 T* _devicePopulation;
113 std::ptrdiff_t _shift;
121 const T&
operator[](std::size_t i)
const override;
126 return _devicePopulation;
131 return _devicePopulation;
141 _devicePopulation = _deviceBase + _shift;
147 if (_shift >= _count) {
150 else if (_shift < 0) {
158 throw std::logic_error(
"Cyclic column can not be resized");
168 bool*
getBlock(std::size_t iBlock, std::size_t& sizeBlock,
bool loadingMode)
override;
210 return indices.
size() *
sizeof(T);
215 std::uint8_t* buffer)
const;
219 const std::uint8_t* buffer);
236 return indices.
size() *
sizeof(T);
241 std::uint8_t* buffer)
const;
245 const std::uint8_t* buffer);
ConcreteCommunicatable(gpu::cuda::Column< T > &column)
std::size_t size(ConstSpan< CellID > indices) const
Get serialized size for data at locations indices
ConcreteCommunicatable(gpu::cuda::CyclicColumn< T > &column)
std::size_t size(ConstSpan< CellID > indices) const
Get serialized size for data at locations indices
std::size_t deserialize(ConstSpan< CellID > indices, const std::uint8_t *buffer) override
Deserialize data at locations indices to buffer
std::size_t serialize(ConstSpan< CellID > indices, std::uint8_t *buffer) const override
Serialize data at locations indices to buffer
Base class for serializable objects of constant size. For dynamic size use BufferSerializable.
Plain column for CUDA GPU targets.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
void deduplicate()
Combined ascending sort and removal of duplicate entries.
void clear()
Reset size to zero.
const T * deviceData() const
std::size_t getSerializableSize() const override
Binary size for the serializer.
void setProcessingContext(ProcessingContext)
const T & operator[](std::size_t i) const override
void resize(std::size_t newCount)
bool * getBlock(std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override
Return a pointer to the memory of the current block and its size for the serializable interface.
Virtual memory based cyclic column for usage in ColumnVector.
void setProcessingContext(ProcessingContext)
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
std::size_t getSerializableSize() const override
Binary size for the serializer.
const T * deviceData() const
const T & operator[](std::size_t i) const override
void rotate(std::ptrdiff_t offset)
bool * getBlock(std::size_t iBlock, std::size_t &sizeBlock, bool loadingMode) override
Return a pointer to the memory of the current block and its size for the serializable interface.
void resize(std::size_t count)
Basic wrapper for device stream.
Top level namespace for all of OpenLB.
ProcessingContext
OpenLB processing contexts.
cpu::sisd::CyclicColumn< T > CyclicColumn
Use CPU SISD as default CyclicColumn.
Platform
OpenLB execution targets.
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)
cpu::sisd::Column< T > Column
Use CPU SISD as default Column.
Abstract declarator of Column-like storage.
Abstract declarator of cyclic Column-like storage.
Specializable declarator for concrete implementations of abstract storage types.