Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <CL/cl.hpp>
- #include <vector>
- #include <string>
- using std::cout; using std::endl;
- using std::vector;
- using std::string;
- int main(void)
- {
- // query the number of platforms available to us
- vector<cl::Platform> platforms;
- cl::Platform::get(&platforms);
- // pick the first platform from the list
- auto platform = platforms.front();
- // query the number of devices available to us
- vector<cl::Device> devices;
- platform.getDevices(CL_DEVICE_TYPE_ALL, &devices);
- // pick the first device from the list
- auto device = devices.front();
- // get the name of the vendor
- string vendor = device.getInfo<CL_DEVICE_VENDOR>();
- cout << vendor << endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment