Loading [MathJax]/extensions/TeX/AMSmath.js
SG++-Doxygen-Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Detect the configuration of OpenCL platforms

This code detects the configuration of the OpenCL platforms available on the machine and outputs it to a file.

It can be used as a quick check whether OpenCL is working.

#include <iostream>
#if USE_OCL == 1
int main(int argc, char** argv) {
std::shared_ptr<sgpp::base::OCLOperationConfiguration> configuration =
std::make_shared<sgpp::base::OCLOperationConfiguration>(
"detectPlatform.cfg");
(*configuration).replaceIDAttr("VERBOSE", true);
sgpp::base::OCLManagerMultiPlatform manager(configuration);
configuration->serialize("detectPlatformOut.cfg");
return 0;
}
#else
int main(int argc, char** argv) {
std::cout << "no OpenCL support" << std::endl;
}
#endif