Skip to content

Use 3D Kokkos MDRangePolicy and remove manual SIMD loops in ComputeE/ComputeB functors#22

Open
Amazingkivas wants to merge 1 commit intomainfrom
codex/fix-gpu-data-transfer-issues
Open

Use 3D Kokkos MDRangePolicy and remove manual SIMD loops in ComputeE/ComputeB functors#22
Amazingkivas wants to merge 1 commit intomainfrom
codex/fix-gpu-data-transfer-issues

Conversation

@Amazingkivas
Copy link
Owner

Motivation

  • Replace manual i-range splitting and SIMD/unrolled loops with a full 3D Kokkos parallel policy to simplify the functors and improve portability across backends.
  • Correct and consolidate operator signatures and bounds handling so each functor receives and iterates (k, j, i) and computes flat indices consistently.
  • Fix parameter const-correctness for coefficient arguments to avoid accidental modification and clarify intent.

Description

  • Removed start_i/end_i members and all SIMD/unrolled loop code paths from ComputeE_FieldFunctor and ComputeB_FieldFunctor, and replaced them with an element-wise implementation using a 3D Kokkos::MDRangePolicy.
  • Updated apply functions to create a 3D MDRangePolicy (with explicit iteration order) using {bounds_k[0], bounds_j[0], bounds_i[0]} -> {bounds_k[1], bounds_j[1], bounds_i[1]} and adjusted parameter lists accordingly, including making coef_dz a const FP&.
  • Changed operator() signatures to operator()(const int& k, const int& j, const int& i) const, computed the flattened index, and replaced the SIMD neighbor-index logic with scalar neighbor index calculations (e.g. i_pred_idx, j_pred_idx, k_pred_idx) and periodic boundary handling.
  • Applied the same scalarization and indexing simplifications to ComputeB_FieldFunctor so both field-update functors use the same 3D policy and indexing approach.

Testing

  • Built the project and ran the automated unit and integration tests that exercise the Kokkos functors and field-update kernels, and the test suite completed successfully.
  • Ran the project's field update regression tests under the modified functors and they passed with no failures.

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