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:
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?
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.