vx_khr_icd.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (c) 2017-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. /*! \file
  17. * \defgroup group_icd OpenVX ICD Loader API
  18. * \brief The OpenVX Installable Client Driver (ICD) Loader API.
  19. * \details The vx_khr_icd extension provides a mechanism for vendors to implement Installable Client Driver (ICD) for OpenVX. The OpenVX ICD Loader API provides a mechanism for applications to access these vendor implementations.
  20. */
  21. #ifndef _VX_KHR_ICD_H_
  22. #define _VX_KHR_ICD_H_
  23. #include <VX/vx.h>
  24. #include <VX/vxu.h>
  25. /*! \brief Platform handle of an implementation.
  26. * \ingroup group_icd
  27. */
  28. typedef struct _vx_platform * vx_platform;
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /*! \brief Queries list of available platforms.
  33. * \param [in] capacity Maximum number of items that platform[] can hold.
  34. * \param [out] platform[] List of platform handles.
  35. * \param [out] pNumItems Number of platform handles returned.
  36. * \return A <tt>\ref vx_status_e</tt> enumeration.
  37. * \retval VX_SUCCESS No errors.
  38. * \retval VX_FAILURE If no platforms are found.
  39. * \ingroup group_icd
  40. */
  41. vx_status VX_API_CALL vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size * pNumItems);
  42. /*! \brief Queries the platform for some specific information.
  43. * \param [in] platform The platform handle.
  44. * \param [in] attribute The attribute to query. Use one of the following:
  45. * <tt>\ref VX_CONTEXT_VENDOR_ID</tt>,
  46. * <tt>\ref VX_CONTEXT_VERSION</tt>,
  47. * <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>,
  48. * <tt>\ref VX_CONTEXT_EXTENSIONS</tt>.
  49. * \param [out] ptr The location at which to store the resulting value.
  50. * \param [in] size The size in bytes of the container to which \a ptr points.
  51. * \return A <tt>\ref vx_status_e</tt> enumeration.
  52. * \retval VX_SUCCESS No errors.
  53. * \retval VX_ERROR_INVALID_REFERENCE If the platform is not a <tt>\ref vx_platform</tt>.
  54. * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
  55. * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
  56. * \ingroup group_icd
  57. */
  58. vx_status VX_API_CALL vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size);
  59. /*! \brief Creates a <tt>\ref vx_context</tt> from a <tt>\ref vx_platform</tt>.
  60. * \details This creates a top-level object context for OpenVX from a platform handle.
  61. * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
  62. * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
  63. * \ingroup group_icd
  64. */
  65. vx_context VX_API_CALL vxCreateContextFromPlatform(vx_platform platform);
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif