Results 1 to 2 of 2

Thread: devices selection

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    14

    devices selection

    hi,
    I'm still new to opencl,
    I have two GPU cards on my pc
    what is the easiest way to choose the card I want to use to compute my program?
    thx in advance

  2. #2
    Junior Member
    Join Date
    Nov 2010
    Posts
    14

    Re: devices selection

    You can do it like this:
    Code :
    	//Get devices of first platform
    	clGetDeviceIDs(*platform, CL_DEVICE_TYPE_GPU, NULL, NULL, &amount);
    	cl_device_id *devices = (cl_device_id*) malloc(amount * sizeof(cl_device_id));
    	clGetDeviceIDs(*platform, CL_DEVICE_TYPE_GPU, amount, devices, NULL);

    Then, when you create your command queue, you can specify whether you want to use the first device (device[0]) or the second device[0]). This worked for me.

    If you want to know which number your device has, I would run CLInfo which is included in the ATI Stream SDK Samples. Or you can run a clGetDeviceInfo with an appropriate flag.

    Greets,
    centershock

Similar Threads

  1. selection the 3d objects OpenGL ES 1.1
    By pcersltda in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 07-23-2010, 09:51 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
  •