beignet-1.3.2-cl_accelerator_intel.patch 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. Description: Move cl_intel_accelerator to cl_intel.h
  2. Beignet's own headers define cl_intel_accelerator etc directly in
  3. cl_ext.h, but khronos-opencl-headers 2.2~ places these in a separate
  4. file cl_ext_intel.h, and older versions do not include it at all.
  5. Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
  6. Forwarded: https://lists.freedesktop.org/archives/beignet/2018-July/009217.html
  7. --- a/include/CL/cl_intel.h
  8. +++ b/include/CL/cl_intel.h
  9. @@ -26,6 +26,115 @@
  10. extern "C" {
  11. #endif
  12. +#if defined(__CL_EXT_H) && !defined(cl_intel_accelerator)
  13. +#ifdef CL_VERSION_2_2
  14. +#include "CL/cl_ext_intel.h"
  15. +#else
  16. +/*********************************
  17. +* cl_intel_accelerator extension *
  18. +*********************************/
  19. +#define cl_intel_accelerator 1
  20. +#define cl_intel_motion_estimation 1
  21. +
  22. +typedef struct _cl_accelerator_intel* cl_accelerator_intel;
  23. +typedef cl_uint cl_accelerator_type_intel;
  24. +typedef cl_uint cl_accelerator_info_intel;
  25. +
  26. +typedef struct _cl_motion_estimation_desc_intel {
  27. + cl_uint mb_block_type;
  28. + cl_uint subpixel_mode;
  29. + cl_uint sad_adjust_mode;
  30. + cl_uint search_path_type;
  31. +} cl_motion_estimation_desc_intel;
  32. +
  33. +/* Error Codes */
  34. +#define CL_INVALID_ACCELERATOR_INTEL -1094
  35. +#define CL_INVALID_ACCELERATOR_TYPE_INTEL -1095
  36. +#define CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL -1096
  37. +#define CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL -1097
  38. +
  39. +/* Deprecated Error Codes */
  40. +#define CL_INVALID_ACCELERATOR_INTEL_DEPRECATED -6000
  41. +#define CL_INVALID_ACCELERATOR_TYPE_INTEL_DEPRECATED -6001
  42. +#define CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL_DEPRECATED -6002
  43. +#define CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL_DEPRECATED -6003
  44. +
  45. +/* cl_accelerator_type_intel */
  46. +#define CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL 0x0
  47. +
  48. +/* cl_accelerator_info_intel */
  49. +#define CL_ACCELERATOR_DESCRIPTOR_INTEL 0x4090
  50. +#define CL_ACCELERATOR_REFERENCE_COUNT_INTEL 0x4091
  51. +#define CL_ACCELERATOR_CONTEXT_INTEL 0x4092
  52. +#define CL_ACCELERATOR_TYPE_INTEL 0x4093
  53. +
  54. +/*cl_motion_detect_desc_intel flags */
  55. +#define CL_ME_MB_TYPE_16x16_INTEL 0x0
  56. +#define CL_ME_MB_TYPE_8x8_INTEL 0x1
  57. +#define CL_ME_MB_TYPE_4x4_INTEL 0x2
  58. +
  59. +#define CL_ME_SUBPIXEL_MODE_INTEGER_INTEL 0x0
  60. +#define CL_ME_SUBPIXEL_MODE_HPEL_INTEL 0x1
  61. +#define CL_ME_SUBPIXEL_MODE_QPEL_INTEL 0x2
  62. +
  63. +#define CL_ME_SAD_ADJUST_MODE_NONE_INTEL 0x0
  64. +#define CL_ME_SAD_ADJUST_MODE_HAAR_INTEL 0x1
  65. +
  66. +#define CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL 0x0
  67. +#define CL_ME_SEARCH_PATH_RADIUS_4_4_INTEL 0x1
  68. +#define CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL 0x5
  69. +
  70. +extern CL_API_ENTRY cl_accelerator_intel CL_API_CALL
  71. +clCreateAcceleratorINTEL(
  72. + cl_context /* context */,
  73. + cl_accelerator_type_intel /* accelerator_type */,
  74. + size_t /* descriptor_size */,
  75. + const void* /* descriptor */,
  76. + cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
  77. +
  78. +typedef CL_API_ENTRY cl_accelerator_intel
  79. + (CL_API_CALL *clCreateAcceleratorINTEL_fn)(
  80. + cl_context /* context */,
  81. + cl_accelerator_type_intel /* accelerator_type */,
  82. + size_t /* descriptor_size */,
  83. + const void* /* descriptor */,
  84. + cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
  85. +
  86. +extern CL_API_ENTRY cl_int CL_API_CALL
  87. +clGetAcceleratorInfoINTEL
  88. +(
  89. + cl_accelerator_intel /* accelerator */,
  90. + cl_accelerator_info_intel /* param_name */,
  91. + size_t /* param_value_size */,
  92. + void* /* param_value */,
  93. + size_t* /* param_value_size_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
  94. +
  95. +typedef CL_API_ENTRY cl_int
  96. + (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)(
  97. + cl_accelerator_intel /* accelerator */,
  98. + cl_accelerator_info_intel /* param_name */,
  99. + size_t /* param_value_size */,
  100. + void* /* param_value */,
  101. + size_t* /* param_value_size_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
  102. +
  103. +extern CL_API_ENTRY cl_int CL_API_CALL
  104. +clRetainAcceleratorINTEL(
  105. + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
  106. +
  107. +typedef CL_API_ENTRY cl_int
  108. + (CL_API_CALL *clRetainAcceleratorINTEL_fn)(
  109. + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
  110. +
  111. +extern CL_API_ENTRY cl_int CL_API_CALL
  112. +clReleaseAcceleratorINTEL(
  113. + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
  114. +
  115. +typedef CL_API_ENTRY cl_int
  116. + (CL_API_CALL *clReleaseAcceleratorINTEL_fn)(
  117. + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
  118. +#endif
  119. +#endif
  120. +
  121. #define CL_MEM_PINNABLE (1 << 10)
  122. /* Track allocations and report current number of unfreed allocations */
  123. --- a/src/cl_accelerator_intel.h
  124. +++ b/src/cl_accelerator_intel.h
  125. @@ -4,6 +4,7 @@
  126. #include "cl_base_object.h"
  127. #include "CL/cl.h"
  128. #include "CL/cl_ext.h"
  129. +#include "CL/cl_intel.h"
  130. #include <stdint.h>
  131. struct _cl_accelerator_intel {
  132. --- a/src/cl_driver.h
  133. +++ b/src/cl_driver.h
  134. @@ -24,6 +24,7 @@
  135. #include <stdlib.h>
  136. #include "cl_driver_type.h"
  137. #include "CL/cl_ext.h"
  138. +#include "CL/cl_intel.h"
  139. /* Various limitations we should remove actually */
  140. #define GEN_MAX_SURFACES 256
  141. #define GEN_MAX_SAMPLERS 16