Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use amre::GpuComplex in diagnostics #1070

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/diagnostics/Diagnostic.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@

#include <vector>

// 16-byte alignment enables coalesced memory access which is significantly faster
struct alignas(2*sizeof(amrex::Real)) AlignedComplex {
amrex::Real real;
amrex::Real imag;

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE constexpr
AlignedComplex& operator+= (const AlignedComplex& rhs) {
real += rhs.real;
imag += rhs.imag;
return *this;
}
};


/** \brief This struct holds data for one field diagnostic on one MR level */
struct FieldDiagnosticData
Expand All @@ -50,7 +37,7 @@ struct FieldDiagnosticData
amrex::Gpu::DeviceVector<int> m_comps_output_idx;
/** Vector over levels, all fields */
amrex::FArrayBox m_F;
using complex_type = AlignedComplex;
using complex_type = amrex::GpuComplex<amrex::Real>;
/** FAB for laser */
amrex::BaseFab<complex_type> m_F_laser;
amrex::Geometry m_geom_io; /**< Diagnostics geometry */
Expand Down
Loading