OpenLB 1.7
Loading...
Searching...
No Matches
context.h
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2022 Adrian Kummerlaender
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24#ifndef GPU_CUDA_CONTEXT_H
25#define GPU_CUDA_CONTEXT_H
26
27#include "device.h"
28
29namespace olb {
30
32template <typename T, typename DESCRIPTOR, typename PARAMETERS>
33class ConcreteParametersD<T,DESCRIPTOR,Platform::GPU_CUDA,PARAMETERS> final
34 : public AbstractedConcreteParameters<T,DESCRIPTOR>
35 , public Serializable {
36private:
37 using ParametersD = typename olb::ParametersD<T,DESCRIPTOR>::template include<PARAMETERS>;
39
40public:
41 ParametersD parameters;
42
43 ConcreteParametersD(std::size_t); // TODO: Implement more generic non-cellwise field allocation in Data
44
48
49 void setProcessingContext(ProcessingContext context) override;
50
51 ParametersD* deviceData() {
52 return _deviceParameters.get();
53 }
54
56 std::size_t getNblock() const override;
58 std::size_t getSerializableSize() const override;
60 bool* getBlock(std::size_t iBlock, std::size_t& sizeBlock, bool loadingMode) override;
61
62};
63
64}
65
66#endif
AbstractParameters< T, DESCRIPTOR > & asAbstract() override
Definition context.h:45
Base class for serializable objects of constant size. For dynamic size use BufferSerializable.
Definition serializer.h:145
Managed pointer for device-side memory.
Definition device.h:79
Top level namespace for all of OpenLB.
ProcessingContext
OpenLB processing contexts.
Definition platform.h:55
Platform
OpenLB execution targets.
Definition platform.h:36
@ GPU_CUDA
Vector CPU (AVX2 / AVX-512 collision)
Dynamic access interface for FIELD-valued parameters.
Abstract base of ConcreteParametersD.
Concrete storage of ParametersD in olb::Data.
std::size_t getNblock() const override
Number of data blocks for the serializable interface.
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 setProcessingContext(ProcessingContext context) override
ParametersD< T, DESCRIPTOR >::template include< PARAMETERS > parameters
std::size_t getSerializableSize() const override
Binary size for the serializer.
Set of FIELD-valued parameters.