}
unsigned int j = 0;
- output.coulombVirial_[XX][XX] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombVirial_[YY][YY] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombVirial_[ZZ][ZZ] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombVirial_[XX][YY] = output.coulombVirial_[YY][XX] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombVirial_[XX][ZZ] = output.coulombVirial_[ZZ][XX] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombVirial_[YY][ZZ] = output.coulombVirial_[ZZ][YY] = 0.25f * pmeGpu->staging.h_virialAndEnergy[j++];
- output.coulombEnergy_ = 0.5f * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[XX][XX] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[YY][YY] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[ZZ][ZZ] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[XX][YY] = output.coulombVirial_[YY][XX] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[XX][ZZ] = output.coulombVirial_[ZZ][XX] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombVirial_[YY][ZZ] = output.coulombVirial_[ZZ][YY] = 0.25F * pmeGpu->staging.h_virialAndEnergy[j++];
+ output.coulombEnergy_ = 0.5F * pmeGpu->staging.h_virialAndEnergy[j++];
return output;
}
* smaller than the minimum order^2 required in spread/gather ATM which
* we need to check for.
*/
-static void checkRequiredWarpSize(const cl_kernel kernel,
+static void checkRequiredWarpSize(cl_kernel kernel,
const char* kernelName,
const gmx_device_info_t *deviceInfo)
{
warpSize / c_pmeSpreadGatherThreadsPerAtom,
c_pmeSpreadGatherThreadsPerAtom,
static_cast<float>(c_pmeMaxUnitcellShift),
- c_usePadding,
- c_skipNeutralAtoms,
+ static_cast<int>(c_usePadding),
+ static_cast<int>(c_skipNeutralAtoms),
c_virialAndEnergyCount,
spreadWorkGroupSize,
solveMaxWorkGroupSize,
{
cl_context_properties properties[] = {
CL_CONTEXT_PLATFORM,
- (cl_context_properties) devInfo->ocl_gpu_id.ocl_platform_id,
+ reinterpret_cast<cl_context_properties>(devInfo->ocl_gpu_id.ocl_platform_id),
0
};
// uncrustify spacing
return egpuCompatible;
}
-} // namespace
+} // namespace gmx
/*! \brief Returns an ocl_vendor_id_t value corresponding to the input OpenCL vendor name.
*
//! Deleted copy constructor.
ClHandle(const ClHandle &) = delete;
//! Default move assignment operator.
- ClHandle &operator=(ClHandle &&) = default;
+ ClHandle &operator=(ClHandle &&) noexcept = default;
//! Default copy constructor.
- ClHandle(ClHandle &&) = default;
+ ClHandle(ClHandle &&) noexcept = default;
/*! \brief Convenience conversion operator so the wrapper type
* can simply convert to the wrapped type. */
operator cl_type() const { return handle_; }
using ClKernel = ClHandle<cl_kernel>;
/*! @} */
-} // namespace
+} // namespace gmx
#endif
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018,2019, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* \throws InternalError If status indicates failure, supplying
* descriptive text from \c message. */
-static void throwUponFailure(cl_int status, const char *message)
+void throwUponFailure(cl_int status, const char *message)
{
if (status != CL_SUCCESS)
{
const auto *device = getDeviceInfo(gpuInfo, compatibleGpus[0]);
cl_context_properties properties[] = {
CL_CONTEXT_PLATFORM,
- (cl_context_properties) device->ocl_gpu_id.ocl_platform_id,
+ reinterpret_cast<cl_context_properties>(device->ocl_gpu_id.ocl_platform_id),
0
};
// Give uncrustify more space
auto deviceId = device->ocl_gpu_id.ocl_device_id;
- auto context = clCreateContext(properties, 1, &deviceId, NULL, NULL, &status);
+ auto context = clCreateContext(properties, 1, &deviceId, nullptr, nullptr, &status);
throwUponFailure(status, "creating context");
auto commandQueue = clCreateCommandQueue(context, deviceId, 0, &status);
throwUponFailure(status, "creating command queue");
}
else
{
- auto xp = makeConstArrayRef(*upd->xp()).subArray(0, homenr);
- auto x = makeArrayRef(state->x).subArray(0, homenr);
-#ifndef __clang_analyzer__
+ auto xp = makeConstArrayRef(*upd->xp()).subArray(0, homenr);
+ auto x = makeArrayRef(state->x).subArray(0, homenr);
+
+
int gmx_unused nth = gmx_omp_nthreads_get(emntUpdate);
-#endif
#pragma omp parallel for num_threads(nth) schedule(static)
for (int i = 0; i < homenr; i++)
{
}
-void
-setupGpuShortRangeWork(gmx_nbnxn_gpu_t *nb,
- const gmx::GpuBonded *gpuBonded,
- const Nbnxm::InteractionLocality iLocality)
+//NOLINTNEXTLINE(misc-definitions-in-headers)
+void setupGpuShortRangeWork(gmx_nbnxn_gpu_t *nb,
+ const gmx::GpuBonded *gpuBonded,
+ const Nbnxm::InteractionLocality iLocality)
{
GMX_ASSERT(nb, "Need a valid nbnxn_gpu object");
return nb.haveWork[iLocality];
}
-bool
-haveGpuShortRangeWork(const gmx_nbnxn_gpu_t *nb,
- const Nbnxm::AtomLocality aLocality)
+//NOLINTNEXTLINE(misc-definitions-in-headers)
+bool haveGpuShortRangeWork(const gmx_nbnxn_gpu_t *nb,
+ const Nbnxm::AtomLocality aLocality)
{
GMX_ASSERT(nb, "Need a valid nbnxn_gpu object");
nbnxn_atomdata_t gmx_unused *nbatom,
int gmx_unused flags,
AtomLocality gmx_unused aloc,
- const bool gmx_unused copyBackNbForce) GPU_FUNC_TERM;
+ bool gmx_unused copyBackNbForce) GPU_FUNC_TERM;
/*! \brief Attempts to complete nonbonded GPU task.
*
GPU_FUNC_QUALIFIER
void setupGpuShortRangeWork(gmx_nbnxn_gpu_t gmx_unused *nb,
const gmx::GpuBonded gmx_unused *gpuBonded,
- const Nbnxm::InteractionLocality gmx_unused iLocality) GPU_FUNC_TERM;
+ Nbnxm::InteractionLocality gmx_unused iLocality) GPU_FUNC_TERM;
/*! \brief Returns true if there is GPU short-range work for the given atom locality.
*
*/
GPU_FUNC_QUALIFIER
bool haveGpuShortRangeWork(const gmx_nbnxn_gpu_t gmx_unused *nb,
- const Nbnxm::AtomLocality gmx_unused aLocality) GPU_FUNC_TERM_WITH_RETURN(false);
+ Nbnxm::AtomLocality gmx_unused aLocality) GPU_FUNC_TERM_WITH_RETURN(false);
/*! \brief Initialization for F buffer operations on GPU */
CUDA_FUNC_QUALIFIER
{
size_t device_limit;
- device_limit = (1ull << device_size_t_size_bits) - 1;
+ device_limit = (1ULL << device_size_t_size_bits) - 1;
for (int i = 0; i < work_dim; i++)
{
//! OpenCL notification callback function
static void CL_CALLBACK
-ocl_notify_fn( const char *pErrInfo, const void *, size_t, void *)
+ocl_notify_fn(const char *pErrInfo, const void gmx_unused *private_info, size_t gmx_unused cb, void gmx_unused *user_data)
{
if (pErrInfo != nullptr)
{
cl_atomdata_t *atomData = nb->atdat;
cl_command_queue ls = nb->stream[InteractionLocality::Local];
- cl_float value = 0.0f;
+ cl_float value = 0.0F;
cl_error = clEnqueueFillBuffer(ls, atomData->f, &value, sizeof(cl_float),
0, natoms_clear*sizeof(rvec), 0, nullptr, nullptr);
/* Each thread should copy its own data to the combined arrays,
* as otherwise data will go back and forth between different caches.
*/
- int gmx_unused nthreads = gmx_omp_nthreads_get(emntPairsearch);
+ const int gmx_unused nthreads = gmx_omp_nthreads_get(emntPairsearch);
#pragma omp parallel for num_threads(nthreads) schedule(static)
for (gmx::index n = 0; n < nbls.ssize(); n++)