|
10 | 10 | #include "pcms/field/evaluation_request.h" |
11 | 11 | #include "pcms/field/point_evaluator.h" |
12 | 12 | #include "pcms/field/out_of_bounds_policy.h" |
13 | | -#include "pcms/coupler/field_serializer.h" |
14 | 13 | #include "pcms/field/coordinate_system.h" |
15 | 14 | #include "pcms/utility/arrays.h" |
16 | 15 | #include "pcms/utility/memory_spaces.h" |
@@ -366,39 +365,6 @@ inline void SetField(FieldData<Real>& field, const FieldLayout& layout, |
366 | 365 | SetField<ExecutionSpace>(layout, field, func); |
367 | 366 | } |
368 | 367 |
|
369 | | -// Check that serialize followed by deserialize round-trips the data. |
370 | | -// Uses an identity permutation so permutation[i] = i. |
371 | | -inline void CheckSerializeDeserialize(const FieldLayout& layout, |
372 | | - FieldData<Real>& field) |
373 | | -{ |
374 | | - auto data_before = FlattenToRank1View(field.GetDOFHolderDataHost()); |
375 | | - int n = static_cast<int>(data_before.size()); |
376 | | - |
377 | | - std::vector<Real> buffer(n); |
378 | | - std::vector<LO> perm(n); |
379 | | - for (int i = 0; i < n; ++i) |
380 | | - perm[i] = i; |
381 | | - |
382 | | - Rank1View<Real, HostMemorySpace> buf_view(buffer.data(), n); |
383 | | - Rank1View<const LO, HostMemorySpace> perm_view(perm.data(), n); |
384 | | - |
385 | | - FieldSerializer<Real> serializer; |
386 | | - serializer.Serialize(field, layout, buf_view, perm_view); |
387 | | - serializer.Deserialize( |
388 | | - field, layout, Rank1View<const Real, HostMemorySpace>(buf_view), perm_view); |
389 | | - |
390 | | - auto data_after = FlattenToRank1View(field.GetDOFHolderDataHost()); |
391 | | - REQUIRE(data_after.size() == data_before.size()); |
392 | | - for (int i = 0; i < n; ++i) { |
393 | | - REQUIRE(data_after[i] == Catch::Approx(data_before[i])); |
394 | | - } |
395 | | -} |
396 | | - |
397 | | -inline void CheckSerializeDeserialize(Field<Real>& field) |
398 | | -{ |
399 | | - CheckSerializeDeserialize(field.GetLayout(), field.GetData()); |
400 | | -} |
401 | | - |
402 | 368 | // Helper structure to hold device coordinates with proper lifetime management |
403 | 369 | struct DeviceCoordinates |
404 | 370 | { |
|
0 commit comments