vx.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * Copyright (c) 2012-2017 The Khronos Group Inc.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef _OPENVX_H_
  17. #define _OPENVX_H_
  18. /*!
  19. * \file
  20. * \brief The top level OpenVX Header.
  21. */
  22. /*! \brief Defines the length of the implementation name string, including the trailing zero.
  23. * \ingroup group_context
  24. */
  25. #define VX_MAX_IMPLEMENTATION_NAME (64)
  26. /*! \brief Defines the length of a kernel name string to be added to OpenVX, including the trailing zero.
  27. * \ingroup group_kernel
  28. */
  29. #define VX_MAX_KERNEL_NAME (128)
  30. #include <VX/vx_vendors.h>
  31. #include <VX/vx_types.h>
  32. #include <VX/vx_kernels.h>
  33. #include <VX/vx_api.h>
  34. #include <VX/vx_nodes.h>
  35. /*! \brief Defines the major version number macro.
  36. * \ingroup group_basic_features
  37. */
  38. #define VX_VERSION_MAJOR(x) ((x & 0xFF) << 8)
  39. /*! \brief Defines the minor version number macro.
  40. * \ingroup group_basic_features
  41. */
  42. #define VX_VERSION_MINOR(x) ((x & 0xFF) << 0)
  43. /*! \brief Defines the predefined version number for 1.0.
  44. * \ingroup group_basic_features
  45. */
  46. #define VX_VERSION_1_0 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(0))
  47. /*! \brief Defines the predefined version number for 1.1.
  48. * \ingroup group_basic_features
  49. */
  50. #define VX_VERSION_1_1 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(1))
  51. /*! \brief Defines the predefined version number for 1.2.
  52. * \ingroup group_basic_features
  53. */
  54. #define VX_VERSION_1_2 (VX_VERSION_MAJOR(1) | VX_VERSION_MINOR(2))
  55. /*! \brief Defines the OpenVX Version Number.
  56. * \ingroup group_basic_features
  57. */
  58. //#define VX_VERSION VX_VERSION_1_2
  59. #define BUILD_YEAR_CH0 (__DATE__[ 7])
  60. #define BUILD_YEAR_CH1 (__DATE__[ 8])
  61. #define BUILD_YEAR_CH2 (__DATE__[ 9])
  62. #define BUILD_YEAR_CH3 (__DATE__[10])
  63. #define BUILD_MONTH_IS_JAN (__DATE__[0] == 'J' && __DATE__[1] == 'a' && __DATE__[2] == 'n')
  64. #define BUILD_MONTH_IS_FEB (__DATE__[0] == 'F')
  65. #define BUILD_MONTH_IS_MAR (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'r')
  66. #define BUILD_MONTH_IS_APR (__DATE__[0] == 'A' && __DATE__[1] == 'p')
  67. #define BUILD_MONTH_IS_MAY (__DATE__[0] == 'M' && __DATE__[1] == 'a' && __DATE__[2] == 'y')
  68. #define BUILD_MONTH_IS_JUN (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'n')
  69. #define BUILD_MONTH_IS_JUL (__DATE__[0] == 'J' && __DATE__[1] == 'u' && __DATE__[2] == 'l')
  70. #define BUILD_MONTH_IS_AUG (__DATE__[0] == 'A' && __DATE__[1] == 'u')
  71. #define BUILD_MONTH_IS_SEP (__DATE__[0] == 'S')
  72. #define BUILD_MONTH_IS_OCT (__DATE__[0] == 'O')
  73. #define BUILD_MONTH_IS_NOV (__DATE__[0] == 'N')
  74. #define BUILD_MONTH_IS_DEC (__DATE__[0] == 'D')
  75. #define BUILD_MONTH_CH0 ((BUILD_MONTH_IS_OCT || BUILD_MONTH_IS_NOV || BUILD_MONTH_IS_DEC) ? '1' : '0')
  76. #define BUILD_MONTH_CH1 ( \
  77. (BUILD_MONTH_IS_JAN) ? '1' : \
  78. (BUILD_MONTH_IS_FEB) ? '2' : \
  79. (BUILD_MONTH_IS_MAR) ? '3' : \
  80. (BUILD_MONTH_IS_APR) ? '4' : \
  81. (BUILD_MONTH_IS_MAY) ? '5' : \
  82. (BUILD_MONTH_IS_JUN) ? '6' : \
  83. (BUILD_MONTH_IS_JUL) ? '7' : \
  84. (BUILD_MONTH_IS_AUG) ? '8' : \
  85. (BUILD_MONTH_IS_SEP) ? '9' : \
  86. (BUILD_MONTH_IS_OCT) ? '0' : \
  87. (BUILD_MONTH_IS_NOV) ? '1' : \
  88. (BUILD_MONTH_IS_DEC) ? '2' : '?' \
  89. )
  90. #define BUILD_DAY_CH0 ((__DATE__[4] >= '0') ? (__DATE__[4]) : '0')
  91. #define BUILD_DAY_CH1 (__DATE__[5])
  92. #define BUILD_HOUR_CH0 (__TIME__[0])
  93. #define BUILD_HOUR_CH1 (__TIME__[1])
  94. #define BUILD_MIN_CH0 (__TIME__[3])
  95. #define BUILD_MIN_CH1 (__TIME__[4])
  96. #define BUILD_SEC_CH0 (__TIME__[6])
  97. #define BUILD_SEC_CH1 (__TIME__[7])
  98. #define VX_VERSION { \
  99. '1', \
  100. '.', \
  101. '3', \
  102. '.', \
  103. BUILD_YEAR_CH0, BUILD_YEAR_CH1, BUILD_YEAR_CH2, BUILD_YEAR_CH3, \
  104. BUILD_MONTH_CH0, BUILD_MONTH_CH1, \
  105. BUILD_DAY_CH0, BUILD_DAY_CH1, \
  106. '.', \
  107. BUILD_HOUR_CH0, BUILD_HOUR_CH1, \
  108. '\0' \
  109. }
  110. #endif