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
4e50d721
Commit
4e50d721
authored
Apr 04, 2013
by
Peter Eastman
Browse files
Ensure that CUDA is chosen over OpenCL when both are available
parent
aee19db2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
platforms/cuda/include/CudaPlatform.h
platforms/cuda/include/CudaPlatform.h
+1
-3
platforms/cuda/src/CudaPlatform.cpp
platforms/cuda/src/CudaPlatform.cpp
+4
-0
platforms/opencl/include/OpenCLPlatform.h
platforms/opencl/include/OpenCLPlatform.h
+1
-3
platforms/opencl/src/OpenCLPlatform.cpp
platforms/opencl/src/OpenCLPlatform.cpp
+4
-0
platforms/reference/include/ReferencePlatform.h
platforms/reference/include/ReferencePlatform.h
+1
-3
platforms/reference/src/ReferencePlatform.cpp
platforms/reference/src/ReferencePlatform.cpp
+4
-0
No files found.
platforms/cuda/include/CudaPlatform.h
View file @
4e50d721
...
@@ -47,9 +47,7 @@ public:
...
@@ -47,9 +47,7 @@ public:
static
const
std
::
string
name
=
"CUDA"
;
static
const
std
::
string
name
=
"CUDA"
;
return
name
;
return
name
;
}
}
double
getSpeed
()
const
{
double
getSpeed
()
const
;
return
100
;
}
bool
supportsDoublePrecision
()
const
;
bool
supportsDoublePrecision
()
const
;
const
std
::
string
&
getPropertyValue
(
const
Context
&
context
,
const
std
::
string
&
property
)
const
;
const
std
::
string
&
getPropertyValue
(
const
Context
&
context
,
const
std
::
string
&
property
)
const
;
void
setPropertyValue
(
Context
&
context
,
const
std
::
string
&
property
,
const
std
::
string
&
value
)
const
;
void
setPropertyValue
(
Context
&
context
,
const
std
::
string
&
property
,
const
std
::
string
&
value
)
const
;
...
...
platforms/cuda/src/CudaPlatform.cpp
View file @
4e50d721
...
@@ -114,6 +114,10 @@ CudaPlatform::CudaPlatform() {
...
@@ -114,6 +114,10 @@ CudaPlatform::CudaPlatform() {
#endif
#endif
}
}
double
CudaPlatform
::
getSpeed
()
const
{
return
100
;
}
bool
CudaPlatform
::
supportsDoublePrecision
()
const
{
bool
CudaPlatform
::
supportsDoublePrecision
()
const
{
return
true
;
return
true
;
}
}
...
...
platforms/opencl/include/OpenCLPlatform.h
View file @
4e50d721
...
@@ -46,9 +46,7 @@ public:
...
@@ -46,9 +46,7 @@ public:
static
const
std
::
string
name
=
"OpenCL"
;
static
const
std
::
string
name
=
"OpenCL"
;
return
name
;
return
name
;
}
}
double
getSpeed
()
const
{
double
getSpeed
()
const
;
return
100
;
}
bool
supportsDoublePrecision
()
const
;
bool
supportsDoublePrecision
()
const
;
const
std
::
string
&
getPropertyValue
(
const
Context
&
context
,
const
std
::
string
&
property
)
const
;
const
std
::
string
&
getPropertyValue
(
const
Context
&
context
,
const
std
::
string
&
property
)
const
;
void
setPropertyValue
(
Context
&
context
,
const
std
::
string
&
property
,
const
std
::
string
&
value
)
const
;
void
setPropertyValue
(
Context
&
context
,
const
std
::
string
&
property
,
const
std
::
string
&
value
)
const
;
...
...
platforms/opencl/src/OpenCLPlatform.cpp
View file @
4e50d721
...
@@ -85,6 +85,10 @@ OpenCLPlatform::OpenCLPlatform() {
...
@@ -85,6 +85,10 @@ OpenCLPlatform::OpenCLPlatform() {
setPropertyDefaultValue
(
OpenCLPrecision
(),
"single"
);
setPropertyDefaultValue
(
OpenCLPrecision
(),
"single"
);
}
}
double
OpenCLPlatform
::
getSpeed
()
const
{
return
50
;
}
bool
OpenCLPlatform
::
supportsDoublePrecision
()
const
{
bool
OpenCLPlatform
::
supportsDoublePrecision
()
const
{
return
true
;
return
true
;
}
}
...
...
platforms/reference/include/ReferencePlatform.h
View file @
4e50d721
...
@@ -49,9 +49,7 @@ public:
...
@@ -49,9 +49,7 @@ public:
static
const
std
::
string
name
=
"Reference"
;
static
const
std
::
string
name
=
"Reference"
;
return
name
;
return
name
;
}
}
double
getSpeed
()
const
{
double
getSpeed
()
const
;
return
1
;
}
bool
supportsDoublePrecision
()
const
;
bool
supportsDoublePrecision
()
const
;
void
contextCreated
(
ContextImpl
&
context
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
properties
)
const
;
void
contextCreated
(
ContextImpl
&
context
,
const
std
::
map
<
std
::
string
,
std
::
string
>&
properties
)
const
;
void
contextDestroyed
(
ContextImpl
&
context
)
const
;
void
contextDestroyed
(
ContextImpl
&
context
)
const
;
...
...
platforms/reference/src/ReferencePlatform.cpp
View file @
4e50d721
...
@@ -73,6 +73,10 @@ ReferencePlatform::ReferencePlatform() {
...
@@ -73,6 +73,10 @@ ReferencePlatform::ReferencePlatform() {
registerKernelFactory
(
RemoveCMMotionKernel
::
Name
(),
factory
);
registerKernelFactory
(
RemoveCMMotionKernel
::
Name
(),
factory
);
}
}
double
ReferencePlatform
::
getSpeed
()
const
{
return
1
;
}
bool
ReferencePlatform
::
supportsDoublePrecision
()
const
{
bool
ReferencePlatform
::
supportsDoublePrecision
()
const
{
return
(
sizeof
(
RealOpenMM
)
>=
sizeof
(
double
));
return
(
sizeof
(
RealOpenMM
)
>=
sizeof
(
double
));
}
}
...
...
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