Commit ac6ab5b7 authored by Peter Eastman's avatar Peter Eastman
Browse files

Fixed error when using Nvidia GPU on Apple's OpenCL

parent ec3ee586
......@@ -98,7 +98,7 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
if (vendor.size() >= 6 && vendor.substr(0, 6) == "NVIDIA") {
compilationOptions += " -DWARPS_ARE_ATOMIC";
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.
......@@ -108,6 +108,7 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
if (computeCapabilityMajor > 1 || computeCapabilityMinor > 1)
supports64BitGlobalAtomics = true;
}
}
else if (vendor.size() >= 28 && vendor.substr(0, 28) == "Advanced Micro Devices, Inc.") {
// AMD APP SDK 2.4 has a performance problem with atomics. Enable the work around.
compilationOptions += " -DAMD_ATOMIC_WORK_AROUND";
......
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