Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
ac6ab5b7
Commit
ac6ab5b7
authored
Jul 05, 2011
by
Peter Eastman
Browse files
Fixed error when using Nvidia GPU on Apple's OpenCL
parent
ec3ee586
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
platforms/opencl/src/OpenCLContext.cpp
platforms/opencl/src/OpenCLContext.cpp
+10
-9
No files found.
platforms/opencl/src/OpenCLContext.cpp
View file @
ac6ab5b7
...
@@ -98,15 +98,16 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
...
@@ -98,15 +98,16 @@ OpenCLContext::OpenCLContext(int numParticles, int deviceIndex, OpenCLPlatform::
if
(
vendor
.
size
()
>=
6
&&
vendor
.
substr
(
0
,
6
)
==
"NVIDIA"
)
{
if
(
vendor
.
size
()
>=
6
&&
vendor
.
substr
(
0
,
6
)
==
"NVIDIA"
)
{
compilationOptions
+=
" -DWARPS_ARE_ATOMIC"
;
compilationOptions
+=
" -DWARPS_ARE_ATOMIC"
;
simdWidth
=
32
;
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
// 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.
cl_uint
computeCapabilityMajor
,
computeCapabilityMinor
;
cl_uint
computeCapabilityMajor
,
computeCapabilityMinor
;
clGetDeviceInfo
(
device
(),
CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV
,
sizeof
(
cl_uint
),
&
computeCapabilityMajor
,
NULL
);
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
);
clGetDeviceInfo
(
device
(),
CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV
,
sizeof
(
cl_uint
),
&
computeCapabilityMinor
,
NULL
);
if
(
computeCapabilityMajor
>
1
||
computeCapabilityMinor
>
1
)
if
(
computeCapabilityMajor
>
1
||
computeCapabilityMinor
>
1
)
supports64BitGlobalAtomics
=
true
;
supports64BitGlobalAtomics
=
true
;
}
}
}
else
if
(
vendor
.
size
()
>=
28
&&
vendor
.
substr
(
0
,
28
)
==
"Advanced Micro Devices, Inc."
)
{
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.
// AMD APP SDK 2.4 has a performance problem with atomics. Enable the work around.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment