Skip to content

Commit

Permalink
Merge branch 'replace-cuda-arch' of github.com:BenWibking/amrex into …
Browse files Browse the repository at this point in the history
…replace-cuda-arch
  • Loading branch information
WeiqunZhang committed Nov 7, 2023
2 parents f0ae8bd + 8f2ef81 commit a43b5bb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_GpuAtomic.H
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ namespace detail {
sycl::atomic_ref<T,mo,ms,as> a{*m};
return a.fetch_max(value);
#else
AMREX_IF_ON_DEVICE(( return atomixMax(m, value); ))
AMREX_IF_ON_DEVICE(( return atomicMax(m, value); ))
AMREX_IF_ON_HOST((
amrex::ignore_unused(m,value);
return T(); // should never get here, but have to return something
Expand Down
16 changes: 8 additions & 8 deletions Src/Base/AMReX_Math.H
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ constexpr std::enable_if_t<std::is_floating_point<T>::value,T> pi ()
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
double cospi (double x)
{
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
return sycl::cospi(x);
#else
AMREX_IF_ON_DEVICE(( return ::cospi(x); ))
Expand All @@ -78,7 +78,7 @@ double cospi (double x)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
float cospi (float x)
{
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
return sycl::cospi(x);
#else
AMREX_IF_ON_DEVICE(( return ::cospif(x); ))
Expand All @@ -90,7 +90,7 @@ float cospi (float x)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
double sinpi (double x)
{
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
return sycl::sinpi(x);
#else
AMREX_IF_ON_DEVICE(( return ::sinpi(x); ))
Expand All @@ -102,7 +102,7 @@ double sinpi (double x)
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
float sinpi (float x)
{
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
return sycl::sinpi(x);
#else
AMREX_IF_ON_DEVICE(( return ::sinpif(x); ))
Expand Down Expand Up @@ -135,7 +135,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
std::pair<double,double> sincos (double x)
{
std::pair<double,double> r;
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
r.first = sycl::sincos(x, sycl::private_ptr<double>(&r.second));
#else
AMREX_IF_ON_DEVICE(( ::sincos(x, &r.first, &r.second); ))
Expand All @@ -149,7 +149,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
std::pair<float,float> sincos (float x)
{
std::pair<float,float> r;
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
r.first = sycl::sincos(x, sycl::private_ptr<float>(&r.second));
#else
AMREX_IF_ON_DEVICE(( ::sincosf(x, &r.first, &r.second); ))
Expand All @@ -163,7 +163,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
std::pair<double,double> sincospi (double x)
{
std::pair<double,double> r;
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
r = sincos(pi<double>()*x);
#else
AMREX_IF_ON_DEVICE(( ::sincospi(x, &r.first, &r.second); ))
Expand All @@ -177,7 +177,7 @@ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
std::pair<float,float> sincospi (float x)
{
std::pair<float,float> r;
#if defined(__SYCL_DEVICE_ONLY__)
#if defined(AMREX_USE_SYCL)
r = sincos(pi<float>()*x);
#else
AMREX_IF_ON_DEVICE(( ::sincospif(x, &r.first, &r.second); ))
Expand Down
2 changes: 1 addition & 1 deletion Src/Base/AMReX_RealVect.H
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ public:
/**
This is a RealVect all of whose components are equal to one.
*/
static const RealVect Unit;
static AMREX_EXPORT const RealVect Unit;

/*@}*/

Expand Down

0 comments on commit a43b5bb

Please sign in to comment.