41 case CL_DEVICE_TYPE_CPU : s=
"CPU";
break;
42 case CL_DEVICE_TYPE_GPU : s=
"GPU";
break;
43 case CL_DEVICE_TYPE_ACCELERATOR : s=
"ACCELERATOR";
break;
44 case CL_DEVICE_TYPE_DEFAULT : s=
"DEFAULT";
break;
46 default: s=
"type is unknown";
56 cout <<
"\t\talignment: " <<
getAlignment(queue) << endl;
57 cout <<
"\t\tlocal memory type: " 63 cout <<
"\t\textension CL_KHR_FP64: " 65 cout <<
"\t\textension CL_KHR_INT64_EXTENDED_ATOMICS: " 76 vector<cl::Platform> platforms;
77 vector<cl::Device> devices;
78 cl_context_properties cps[3];
86 if (platforms.size() > 0)
88 for (
unsigned int i = 0; i < platforms.size(); ++i)
90 status = platforms[i].getDevices(CL_DEVICE_TYPE_ALL, &devices);
92 cout <<
"Platform: " << platforms[i].getInfo<CL_PLATFORM_VENDOR>()
93 <<
"\nNumber of devices: " << devices.size() << endl;
95 cps[0] = CL_CONTEXT_PLATFORM;
96 cps[1] = (cl_context_properties)(platforms[i])();
99 for (
unsigned int j = 0; j < devices.size(); ++j)
102 context =
cl::Context(vector<cl::Device>(1, devices[j]), cps, NULL, NULL, &status);
109 cout <<
"\t" << devices[j].getInfo<CL_DEVICE_NAME>() << endl;
Advanced Simulation Library.
Advanced Computational Language.
void errorMessage(cl_int status, const char *errorMessage)
Prints errorMessage and exits depending on the status.
std::shared_ptr< cl::CommandQueue > CommandQueue
string typeToString(unsigned int t)
CommandQueue interface for cl_command_queue.
void printHardwareInfo(const CommandQueue &queue)
std::string getDeviceVersion(const CommandQueue &queue)
Class interface for cl_context.
std::string getDriverVersion(const CommandQueue &queue)