Skip to content

Commit

Permalink
more issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Jan 24, 2025
1 parent 21e7ab3 commit d9253b6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ jobs:
- name: Compile
run: |
cmake -S . -B build `
-DCUDAToolkit_ROOT="$Env:CUDA_PATH" `
-DCMAKE_VERBOSE_MAKEFILE=ON `
-DCMAKE_BUILD_TYPE=Release `
-DAMReX_GPU_BACKEND=CUDA `
Expand Down
8 changes: 4 additions & 4 deletions Src/Base/AMReX_NonLocalBC.H
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ template <typename... Args>
using LocalCopy_t = decltype(LocalCopy(std::declval<Args>()...));

//! \brief This type trait tests if a given type DP satisfies the DataPacking concept for type FAB.
#if defined(AMREX_USE_CUDA) && defined(_WIN32)
template <typename DP, typename FAB> struct IsDataPacking : std::true_type {};
#else
template <typename DP, typename FAB>
struct IsDataPacking :
Conjunction<
Expand All @@ -487,6 +490,7 @@ struct IsDataPacking :
IsDetected<UnpackRecvBuffers_t, DP&, FabArray<FAB>&, CommData&>
#endif
> {};
#endif

template <class FAB, class DTOS = Identity, class Proj = Identity>
std::enable_if_t<IsBaseFab<FAB>() && IsCallableR<Dim3, DTOS, Dim3>() && IsFabProjection<Proj, FAB>()>
Expand Down Expand Up @@ -602,10 +606,8 @@ UnpackRecvBuffers (const PackComponents& components, FabArray<FAB>& dest, const
}
#endif // AMREX_USE_MPI

#ifndef _WIN32
static_assert(IsDataPacking<PackComponents, FArrayBox>(), // NOLINT(bugprone-throw-keyword-missing)
"PackComponents is expected to satisfy the concept DataPacking.");
#endif

////////////////////////////////////////////////////////////////////////////////////
// [DataPacking.ApplyDtosAndProjectionOnReciever]
Expand Down Expand Up @@ -665,10 +667,8 @@ UnpackRecvBuffers (const ApplyDtosAndProjectionOnReciever<DTOS, FabProj>& packin
}
#endif // AMREX_USE_MPI

#ifndef _WIN32
static_assert(IsDataPacking<ApplyDtosAndProjectionOnReciever<>, FArrayBox>(), // NOLINT(bugprone-throw-keyword-missing)
"ApplyDtosAndProjectionOnReciever<> is expected to satisfy the DataPacking concept.");
#endif

////////////////////////////////////////////////////////////////////////////////////
// [ParallelCopy_nowait]
Expand Down
15 changes: 15 additions & 0 deletions Src/LinearSolvers/MLMG/AMReX_MLABecLaplacian.H
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,20 @@ MLABecLaplacianT<MF>::averageDownCoeffsSameAmrLevel (int amrlev, Vector<MF>& a,
auto const& by = b[mglev][1].array(mfi);,
auto const& bz = b[mglev][2].array(mfi));
auto const& osm = this->m_overset_mask[amrlev][mglev]->const_array(mfi);
#if defined(AMREX_USE_CUDA) && defined(_WIN32)
amrex::launch(xbx, [=] AMREX_GPU_DEVICE (Box const& t_xbx)
{
overset_rescale_bcoef_x(t_xbx, bx, osm, ncomp, osfac);
});
amrex::launch(ybx, [=] AMREX_GPU_DEVICE (Box const& t_ybx)
{
overset_rescale_bcoef_y(t_ybx, by, osm, ncomp, osfac);
});
amrex::launch(zbx, [=] AMREX_GPU_DEVICE (Box const& t_zbx)
{
overset_rescale_bcoef_z(t_zbx, bz, osm, ncomp, osfac);
});
#else
AMREX_LAUNCH_HOST_DEVICE_LAMBDA_DIM
(xbx, t_xbx,
{
Expand All @@ -685,6 +699,7 @@ MLABecLaplacianT<MF>::averageDownCoeffsSameAmrLevel (int amrlev, Vector<MF>& a,
{
overset_rescale_bcoef_z(t_zbx, bz, osm, ncomp, osfac);
});
#endif
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions Src/Particle/AMReX_ParticleContainerI.H
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,11 @@ ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssig
const size_t np_total = np + ptile.numNeighborParticles();

if (memEfficientSort) {
#if defined(AMREX_USE_CUDA) && defined(_WIN32)
if (!ParticleType::is_soa_particle) {
#else
if constexpr (!ParticleType::is_soa_particle) {
#endif
static_assert(sizeof(ParticleType)%4 == 0 && sizeof(uint32_t) == 4);
using tmp_t = std::conditional_t<sizeof(ParticleType)%8 == 0,
uint64_t, uint32_t>;
Expand Down

0 comments on commit d9253b6

Please sign in to comment.