10 Replies Latest reply on Feb 6, 2012 2:18 AM by harryjiang

    device fission using clCreateSubDevicesEXT (command queue creation fails)




      In my experiments i m trying to partition a cpu to 2 subdevices with 2 cores each and for the first subdevice the command queue is created and i can enqueue tasks into it but when I am trying to create command queues for devices_id [1] it says (failed to create command queue)


      globally declared - static clCreateSubDevicesEXT_fn pfn_clCreateSubDevicesEXT = NULL;

      pfn_clCreateSubDevicesEXT = (clCreateSubDevicesEXT_fn)clGetExtensionFunctionAddress("clCreateSubDevicesEXT");

      const cl_context_properties part_props[] = { CL_DEVICE_PARTITION_BY_COUNTS_EXT, 2, 2, CL_PARTITION_BY_COUNTS_LIST_END_EXT, CL_PROPERTIES_LIST_END_EXT };

      err =  pfn_clCreateSubDevicesEXT(device_id, (const cl_device_partition_property_ext *)part_props, 2, devices_id, &part_count);

      printf("PARTITION SUCCESSSSSSS????? ERRR VALUE! (%d)\n", err);

               for (int i =0; i<2; i++) {

              err= clGetDeviceInfo(devices_id[i], CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(val), &val, NULL);

              printf("Device partition %d: max compute units = %lld\n",i, val );}

              cl_context_properties context_props[3];

      context_props[0] = (cl_context_properties)CL_CONTEXT_PLATFORM;      // indicates that next element is platform

      context_props[1] = (cl_context_properties)platforms[0];  // platform is of type cl_platform_id

              context_props[2] = (cl_context_properties)0;                        // last element must be 0

               context = clCreateContext(context_props, 1, devices_id, NULL, NULL, &err);

              if (!context)


                 printf("Error: Failed to create a compute context!\n");


              commands = clCreateCommandQueue(context, devices_id[1], NULL, &err);

              if (!commands)


                 printf("Error: Failed to create a command queue commands!\n");


              can anyone help me out with this....