| 312 | } |
| 313 | |
| 314 | auto makePointSourceCluster(const ClusterMapping& mapping, |
| 315 | const PointSources& sources, |
| 316 | const unsigned* meshIds, |
| 317 | seissol::initializer::LTSTree* ltsTree, |
| 318 | seissol::initializer::LTS* lts, |
| 319 | seissol::initializer::Lut* ltsLut) |
| 320 | -> seissol::kernels::PointSourceClusterPair { |
| 321 | auto hostData = std::pair<std::shared_ptr<ClusterMapping>, std::shared_ptr<PointSources>>( |
| 322 | std::make_shared<ClusterMapping>(mapping), std::make_shared<PointSources>(sources)); |
| 323 | |
| 324 | #if defined(ACL_DEVICE) && !defined(MULTIPLE_SIMULATIONS) |
| 325 | using GpuImpl = seissol::kernels::PointSourceClusterOnDevice; |
| 326 | |
| 327 | auto deviceData = |
| 328 | [&]() -> std::pair<std::shared_ptr<ClusterMapping>, std::shared_ptr<PointSources>> { |
| 329 | if (useUSM()) { |
| 330 | return hostData; |
| 331 | } else { |
| 332 | constexpr auto GpuMemkind = seissol::memory::Memkind::DeviceGlobalMemory; |
| 333 | auto predeviceClusterMapping = mapping; |
| 334 | mapClusterToMesh(predeviceClusterMapping, |
| 335 | meshIds, |
| 336 | ltsTree, |
| 337 | lts, |
| 338 | ltsLut, |
| 339 | seissol::initializer::AllocationPlace::Device); |
| 340 | auto deviceClusterMapping = |
| 341 | std::make_shared<ClusterMapping>(predeviceClusterMapping, GpuMemkind); |
| 342 | auto devicePointSources = std::make_shared<PointSources>(sources, GpuMemkind); |
| 343 | return {deviceClusterMapping, devicePointSources}; |
| 344 | } |
| 345 | }(); |
| 346 | #else |
| 347 | using GpuImpl = seissol::kernels::PointSourceClusterOnHost; |
| 348 | auto deviceData = hostData; |
| 349 | #endif |
| 350 | |
| 351 | return seissol::kernels::PointSourceClusterPair{ |
| 352 | std::make_unique<kernels::PointSourceClusterOnHost>(hostData.first, hostData.second), |
| 353 | std::make_unique<GpuImpl>(deviceData.first, deviceData.second)}; |
| 354 | } |
| 355 | |
| 356 | auto loadSourcesFromFSRM(const char* fileName, |
| 357 | const seissol::geometry::MeshReader& mesh, |
no test coverage detected