Results 1 to 2 of 2

Thread: Getting device info

  1. #1

    Getting device info

    How can I query info from a given device using the C++ bindings so I can show it?

    I have a vector<Device> with one device on position 0 and I'm trying to use getInfo, but I can't get much information about how to use this method and the types i should pass it.

    Thanks

  2. #2

    Re: Getting device info

    Solved, just inexperience =)

    Reference for (other) beginners:

    Code :
    // get platform
    	vector<Platform> platformList;
    	Platform::get(&platformList);
    	cout << "Platform number is: " << platformList.size() << endl;
     
    	// show platform info
    	cl::string platformInfo;
    	platformList[0].getInfo(CL_PLATFORM_VERSION, &platformInfo);
    	cout << "Platform Info: " << platformInfo.c_str() << endl;
     
    	// get available devices
    	vector<Device> devices;
    	platformList[0].getDevices(CL_DEVICE_TYPE_ALL, &devices);
    	cout << devices.size() << " device(s) found!" << endl;
     
    	// show device info
    	cl::string name;
    	devices[0].getInfo(CL_DEVICE_NAME, &name);
    	cout << "Device name: " << name.c_str() << endl;

Similar Threads

  1. Info on clCreateFromGLRenderbuffer
    By williamsma in forum OpenCL
    Replies: 0
    Last Post: 06-08-2012, 04:12 PM
  2. Device info: maximum number of workitems per compute unit
    By Bilog in forum Suggestions for next release
    Replies: 0
    Last Post: 04-30-2012, 01:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •