Results 1 to 2 of 2

Thread: OpenCL implementation for Multiple platforms

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    18

    OpenCL implementation for Multiple platforms

    One doubt i have about OpenCL implementation for multiple platform to run my applications simultaneously on all available devices across all the platforms. Please correct me, if my implementation is wrong. To do so, I declared the OpenCL data structures as following:

    Code :
    cl_platform_id *platforms = NULL;  //OpenCL Platform IDs (single pointer)
    cl_uint num_platforms;       //Storing number of platforms
    cl_device_id **devices = NULL;   //OpenCL Device IDs (double pointer)
    cl_uint *num_devices;      //Storing number of devices for each platform
    cl_context *context = NULL;   //OpenCL context pointer of size equal to number of available platforms (single pointer)
    cl_command_queue *command_queue1; //OpenCL command queues (single pointer)
    cl_uint *num_command_queues; //Storing number of command queues
    cl_int platform_id = -1;   //Counter variable to count number of platforms
    cl_mem *d_new_input_2d;  //OpenCL device buffer (single pointer)

    My doubt is in two declarations (command queues and device buffer). As i mentioned that i am developing OpenCL code for multiple platforms, considering this point in my mind,
    1. can i declare command queues as a single pointer of size equal to number of available OpenCL devices across all available platforms?
    2. can i declare device buffer as a single pointer of size equal to number of available OpenCL devices across all available platforms?

    Thanks !

  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    18

    Re: OpenCL implementation for Multiple platforms

    I cleared my doubt.
    I implemented myself OpenCL program to run on multiple platforms using :
    1. command queue as a single as well as double pointer. It worked correctly.
    2. device buffer as a single as well as double pointer. It also worked correctly.

    cheers !

Similar Threads

  1. OpenCL On Multiple Platforms
    By homemade-jam in forum OpenCL
    Replies: 2
    Last Post: 03-03-2012, 10:14 AM
  2. Replies: 1
    Last Post: 08-20-2010, 11:19 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
  •