Commit 4e50d721 authored by Peter Eastman's avatar Peter Eastman
Browse files

Ensure that CUDA is chosen over OpenCL when both are available

parent aee19db2
......@@ -47,9 +47,7 @@ public:
static const std::string name = "CUDA";
return name;
}
double getSpeed() const {
return 100;
}
double getSpeed() const;
bool supportsDoublePrecision() 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;
......
......@@ -114,6 +114,10 @@ CudaPlatform::CudaPlatform() {
#endif
}
double CudaPlatform::getSpeed() const {
return 100;
}
bool CudaPlatform::supportsDoublePrecision() const {
return true;
}
......
......@@ -46,9 +46,7 @@ public:
static const std::string name = "OpenCL";
return name;
}
double getSpeed() const {
return 100;
}
double getSpeed() const;
bool supportsDoublePrecision() 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;
......
......@@ -85,6 +85,10 @@ OpenCLPlatform::OpenCLPlatform() {
setPropertyDefaultValue(OpenCLPrecision(), "single");
}
double OpenCLPlatform::getSpeed() const {
return 50;
}
bool OpenCLPlatform::supportsDoublePrecision() const {
return true;
}
......
......@@ -49,9 +49,7 @@ public:
static const std::string name = "Reference";
return name;
}
double getSpeed() const {
return 1;
}
double getSpeed() const;
bool supportsDoublePrecision() const;
void contextCreated(ContextImpl& context, const std::map<std::string, std::string>& properties) const;
void contextDestroyed(ContextImpl& context) const;
......
......@@ -73,6 +73,10 @@ ReferencePlatform::ReferencePlatform() {
registerKernelFactory(RemoveCMMotionKernel::Name(), factory);
}
double ReferencePlatform::getSpeed() const {
return 1;
}
bool ReferencePlatform::supportsDoublePrecision() const {
return (sizeof(RealOpenMM) >= sizeof(double));
}
......
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