NetDEM v1.0
Loading...
Searching...
No Matches
webgpu_manager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "utils_macros.hpp"
4#include <webgpu/webgpu.hpp>
5
6namespace netdem {
7
8class Simulation;
9struct ParticleDataGPU;
10
12public:
14
15 void Init(Simulation *const sim);
16
17 void SendDomainData();
18
19 void SendParticleData();
20
22
23 void MergeParticleData(VecXT<ParticleDataGPU> const &particle_data_list);
24
25 wgpu::Device GetDevice();
26
27 void Solve();
28
30
31private:
32 // A pointer to the simulation object that owns this scene.
33 Simulation *sim{nullptr};
34
35 wgpu::Buffer particle_buffer;
36 size_t particle_size{0};
37 size_t particle_data_size{0};
38 size_t workgroup_size{32};
39
40 // device
41 wgpu::Device device;
42};
43
44} // namespace netdem
Class for managing a DEM simulation.
Definition simulation.hpp:21
Definition webgpu_manager.hpp:11
void MergeParticleData(VecXT< ParticleDataGPU > const &particle_data_list)
Definition webgpu_manager.cpp:54
void Init(Simulation *const sim)
Definition webgpu_manager.cpp:17
void SendDomainData()
Definition webgpu_manager.cpp:29
void SendParticleData()
Definition webgpu_manager.cpp:31
~WebGPUManager()
Definition webgpu_manager.cpp:137
WebGPUManager()
Definition webgpu_manager.cpp:15
void Solve()
Definition webgpu_manager.cpp:66
VecXT< ParticleDataGPU > RecvParticleData()
Definition webgpu_manager.cpp:46
wgpu::Device GetDevice()
Definition webgpu_manager.cpp:64
Definition bond_entry.hpp:7
std::vector< T > VecXT
Definition utils_macros.hpp:31