"platforms/cuda/tests/TestCudaDPDIntegrator.cpp" did not exist on "b1a2221493b2563ec2d3351adc1e39c7b67a0cb6"
Commit 95b02c8e authored by Peter Eastman's avatar Peter Eastman
Browse files

Only use the atomic version of charge spreading on compute level 2.0 or later,...

Only use the atomic version of charge spreading on compute level 2.0 or later, since it is slower than the other version on earlier GPUs.
parent 25881dc0
......@@ -100,12 +100,12 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
simdWidth = 32;
if (device.getInfo<CL_DEVICE_EXTENSIONS>().find("cl_nv_device_attribute_query") != string::npos) {
// Compute level 1.2 and later Nvidia GPUs support 64 bit atomics, even though they don't list the
// proper extension as supported.
// proper extension as supported. We only use them on compute level 2.0 or later, since they're very
// slow on earlier GPUs.
cl_uint computeCapabilityMajor, computeCapabilityMinor;
cl_uint computeCapabilityMajor;
clGetDeviceInfo(device(), CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV, sizeof(cl_uint), &computeCapabilityMajor, NULL);
clGetDeviceInfo(device(), CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV, sizeof(cl_uint), &computeCapabilityMinor, NULL);
if (computeCapabilityMajor > 1 || computeCapabilityMinor > 1)
if (computeCapabilityMajor > 1)
supports64BitGlobalAtomics = true;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment