Skip to content

Commit e689c88

Browse files
committed
Merge branch 'development' into derive_vector_multifab
2 parents f7ab597 + 990d40c commit e689c88

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

.github/workflows/cuda.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- uses: actions/checkout@v5
2121
- name: Dependencies
2222
run: |
23+
.github/workflows/dependencies/ubuntu_free_disk_space.sh
2324
.github/workflows/dependencies/dependencies_nvcc.sh 12.6
2425
.github/workflows/dependencies/dependencies_ccache.sh
2526
- name: Set Up Cache
@@ -82,6 +83,7 @@ jobs:
8283
- uses: actions/checkout@v5
8384
- name: Dependencies
8485
run: |
86+
.github/workflows/dependencies/ubuntu_free_disk_space.sh
8587
.github/workflows/dependencies/dependencies_llvm_cuda11_clang15.sh
8688
.github/workflows/dependencies/dependencies_ccache.sh
8789
- name: Set Up Cache
@@ -193,6 +195,7 @@ jobs:
193195
- uses: actions/checkout@v5
194196
- name: Dependencies
195197
run: |
198+
.github/workflows/dependencies/ubuntu_free_disk_space.sh
196199
.github/workflows/dependencies/dependencies_nvcc_2404.sh 13.0
197200
.github/workflows/dependencies/dependencies_ccache.sh
198201
- name: Set Up Cache

Src/Base/AMReX_Math.H

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,34 @@ T comp_ellint_2 (T k)
325325
return Kcomp*sum_val;
326326
}
327327

328+
//! Return inverse square root of x
329+
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
330+
double rsqrt (double x)
331+
{
332+
double r;
333+
#if defined(AMREX_USE_SYCL)
334+
AMREX_IF_ON_DEVICE(( r = sycl::rsqrt(x); ))
335+
#else
336+
AMREX_IF_ON_DEVICE(( r = ::rsqrt(x); ))
337+
#endif
338+
AMREX_IF_ON_HOST(( r = 1. / std::sqrt(x); ))
339+
return r;
340+
}
341+
342+
//! Return inverse square root of x
343+
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
344+
float rsqrt (float x)
345+
{
346+
float r;
347+
#if defined(AMREX_USE_SYCL)
348+
AMREX_IF_ON_DEVICE(( r = sycl::rsqrt(x); ))
349+
#else
350+
AMREX_IF_ON_DEVICE(( r = ::rsqrtf(x); ))
351+
#endif
352+
AMREX_IF_ON_HOST(( r = 1.F / std::sqrt(x); ))
353+
return r;
354+
}
355+
328356
/***************************************************************************************************
329357
* Copyright (c) 2017 - 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
330358
* SPDX-License-Identifier: BSD-3-Clause

Src/Particle/AMReX_ParticleContainer.H

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,14 +1370,14 @@ public:
13701370
/** Create an empty particle container
13711371
*
13721372
* This creates a new AMReX particle container type with same compile-time
1373-
* and run-time attributes. But, it can change its allocator. This is
1374-
* helpful when creating temporary particle buffers for filter operations
1373+
* and run-time attributes. But, it can change its allocator (default: same allocator).
1374+
* This is helpful when creating temporary particle buffers for filter operations
13751375
* and device-to-host copies.
13761376
*
1377-
* @tparam Allocator AMReX allocator, e.g., amrex::PinnedArenaAllocator
1377+
* @tparam Allocator AMReX allocator, e.g., amrex::PinnedArenaAllocator, default: same allocator as the creating PC
13781378
* @return an empty particle container
13791379
* */
1380-
template <template<class> class NewAllocator=amrex::DefaultAllocator>
1380+
template <template<class> class NewAllocator=Allocator>
13811381
ContainerLike<NewAllocator>
13821382
make_alike () const
13831383
{

0 commit comments

Comments
 (0)