auto makeSolveKernel(cl::sycl::handler& cgh,
DeviceAccessor<float, mode::read> a_splineModuli,
DeviceAccessor<SolveKernelParams, mode::read> a_solveKernelParams,
- DeviceAccessor<float, mode::read_write> a_virialAndEnergy,
- DeviceAccessor<float, mode::read_write> a_fourierGrid)
+ OptionalAccessor<float, mode::read_write, computeEnergyAndVirial> a_virialAndEnergy,
+ DeviceAccessor<float, mode::read_write> a_fourierGrid)
{
cgh.require(a_splineModuli);
cgh.require(a_solveKernelParams);
- cgh.require(a_virialAndEnergy);
+ if constexpr (computeEnergyAndVirial)
+ {
+ cgh.require(a_virialAndEnergy);
+ }
cgh.require(a_fourierGrid);
/* Reduce 7 outputs per warp in the shared memory */
}
/* Optional energy/virial reduction */
- if (computeEnergyAndVirial)
+ if constexpr (computeEnergyAndVirial)
{
/* A tricky shuffle reduction inspired by reduce_force_j_warp_shfl.
* The idea is to reduce 7 energy/virial components into a single variable (aligned by
// https://github.com/illuhad/hipSYCL/issues/636
# ifdef SYCL_DEVICE_ONLY
# if defined(HIPSYCL_PLATFORM_CUDA) && defined(__HIPSYCL_ENABLE_CUDA_TARGET__)
- return isfinite(value);
+ return ::isfinite(value);
# elif defined(HIPSYCL_PLATFORM_ROCM) && defined(__HIPSYCL_ENABLE_HIP_TARGET__)
- return isfinite(value);
+ return ::isfinite(value);
# else
# error "Unsupported hipSYCL target"
# endif