beignet-1.3.2-accept-old-create-queue.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Description: Allow clCreateCommandQueue to create out-of-order queues
  2. Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
  3. Forwarded: https://lists.freedesktop.org/archives/beignet/2018-July/009215.html
  4. --- a/src/cl_api_command_queue.c
  5. +++ b/src/cl_api_command_queue.c
  6. @@ -27,35 +27,11 @@ clCreateCommandQueue(cl_context context,
  7. cl_command_queue_properties properties,
  8. cl_int *errcode_ret)
  9. {
  10. - cl_command_queue queue = NULL;
  11. - cl_int err = CL_SUCCESS;
  12. -
  13. - do {
  14. - if (!CL_OBJECT_IS_CONTEXT(context)) {
  15. - err = CL_INVALID_CONTEXT;
  16. - break;
  17. - }
  18. -
  19. - err = cl_devices_list_include_check(context->device_num, context->devices, 1, &device);
  20. - if (err)
  21. - break;
  22. -
  23. - if (properties & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE | CL_QUEUE_PROFILING_ENABLE)) {
  24. - err = CL_INVALID_VALUE;
  25. - break;
  26. - }
  27. -
  28. - if (properties & CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE) { /*not supported now.*/
  29. - err = CL_INVALID_QUEUE_PROPERTIES;
  30. - break;
  31. - }
  32. -
  33. - queue = cl_create_command_queue(context, device, properties, 0, &err);
  34. - } while (0);
  35. -
  36. - if (errcode_ret)
  37. - *errcode_ret = err;
  38. - return queue;
  39. + cl_queue_properties props[3];
  40. + props[0] = CL_QUEUE_PROPERTIES;
  41. + props[1] = properties;
  42. + props[2] = 0;
  43. + return clCreateCommandQueueWithProperties(context, device, props, errcode_ret);
  44. }
  45. /* 2.0 new API for create command queue. */