X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fewald%2Fpme_solve_sycl.cpp;h=46883060e9b1367d8f34e48a145b530d250b1309;hb=cbd1e7a8d76fac6ce3b2c7f824fe27c37bb54b27;hp=633cf31e8e690b5cfacadcdb8726dcb5699a5156;hpb=09e7acaea4f8787f474d7eaf95b8e25428074701;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/ewald/pme_solve_sycl.cpp b/src/gromacs/ewald/pme_solve_sycl.cpp index 633cf31e8e..46883060e9 100644 --- a/src/gromacs/ewald/pme_solve_sycl.cpp +++ b/src/gromacs/ewald/pme_solve_sycl.cpp @@ -65,12 +65,15 @@ template a_splineModuli, DeviceAccessor a_solveKernelParams, - DeviceAccessor a_virialAndEnergy, - DeviceAccessor a_fourierGrid) + OptionalAccessor a_virialAndEnergy, + DeviceAccessor 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 */ @@ -281,7 +284,7 @@ auto makeSolveKernel(cl::sycl::handler& cgh, } /* 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