Skip to content

Refactor Kokkos functors to 3D MDRange, remove SIMD specializations, and update Field view#23

Open
Amazingkivas wants to merge 2 commits intomainfrom
codex/fix-gpu-data-transfer-issues-iy6krb
Open

Refactor Kokkos functors to 3D MDRange, remove SIMD specializations, and update Field view#23
Amazingkivas wants to merge 2 commits intomainfrom
codex/fix-gpu-data-transfer-issues-iy6krb

Conversation

@Amazingkivas
Copy link
Owner

Motivation

  • Simplify and generalize the Kokkos functors to iterate over full 3D domains with a consistent index ordering and eliminate complex SIMD-specific code paths.
  • Improve memory semantics for field arrays by using the appropriate Kokkos::View memory traits and the project FP typedef.

Description

  • Changed ComputeE_FieldFunctor and ComputeB_FieldFunctor to use a 3D Kokkos::MDRangePolicy and updated their operator() signatures from (const int& k, const int& j) to (const int& k, const int& j, const int& i) with flattened 3D indexing.
  • Removed all SIMD-specific members and loops (including simd_type, simd_width, start_i/end_i, and Kokkos_SIMD.hpp usage) and replaced with scalar per-index updates and simpler periodic-boundary handling.
  • Updated kokkos_shared.h to remove Kokkos_SIMD.hpp, switch Field to Kokkos::View<FP*, Kokkos::MemoryTraits<Kokkos::Restrict | Kokkos::Aligned>>, and use the project FP type consistently.
  • Fixed a small signature typo for coef_dz (ensuring it is passed by reference) and simplified index computations for neighbor accesses (i_pred_idx, j_pred_idx, k_pred_idx / scalar_*_idx).

Testing

  • Built the project with the updated headers and Kokkos integration using the usual build system; the build completed successfully.
  • Ran the repository's automated unit tests and the FDTD example/run tests; all tests passed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant