OpenVX ICD Extension  76df2d2
 All Functions Typedefs Groups Pages
vx_khr_icd.h
1 /*
2  * Copyright (c) 2016 The Khronos Group Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and/or associated documentation files (the
6  * "Materials"), to deal in the Materials without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Materials, and to
9  * permit persons to whom the Materials are furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Materials.
14  *
15  * MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS
16  * KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS
17  * SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT
18  * https://www.khronos.org/registry/
19  *
20  * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26  * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
27  */
28 
29 /*! \file
30  * \defgroup group_icd OpenVX ICD Loader API
31  * \brief The OpenVX Installable Client Driver (ICD) Loader API.
32  * \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.
33  */
34 
35 #ifndef _VX_KHR_ICD_H_
36 #define _VX_KHR_ICD_H_
37 
38 #include <VX/vx.h>
39 #include <VX/vxu.h>
40 
41 /*! \brief Platform handle of an implementation.
42  * \ingroup group_icd
43  */
44 typedef struct _vx_platform * vx_platform;
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /*! \brief Queries list of available platforms.
51  * \param [in] capacity Maximum number of items that platform[] can hold.
52  * \param [out] platform[] List of platform handles.
53  * \param [out] pNumItems Number of platform handles returned.
54  * \return A <tt>\ref vx_status_e</tt> enumeration.
55  * \retval VX_SUCCESS No errors.
56  * \retval VX_FAILURE If no platforms are found.
57  * \ingroup group_icd
58  */
59 vx_status VX_API_CALL vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size * pNumItems);
60 
61 /*! \brief Queries the platform for some specific information.
62  * \param [in] platform The platform handle.
63  * \param [in] attribute The attribute to query. Use one of the following:
64  * <tt>\ref VX_CONTEXT_VENDOR_ID</tt>,
65  * <tt>\ref VX_CONTEXT_VERSION</tt>,
66  * <tt>\ref VX_CONTEXT_EXTENSIONS_SIZE</tt>,
67  * <tt>\ref VX_CONTEXT_EXTENSIONS</tt>.
68  * \param [out] ptr The location at which to store the resulting value.
69  * \param [in] size The size in bytes of the container to which \a ptr points.
70  * \return A <tt>\ref vx_status_e</tt> enumeration.
71  * \retval VX_SUCCESS No errors.
72  * \retval VX_ERROR_INVALID_REFERENCE If the platform is not a <tt>\ref vx_platform</tt>.
73  * \retval VX_ERROR_INVALID_PARAMETERS If any of the other parameters are incorrect.
74  * \retval VX_ERROR_NOT_SUPPORTED If the attribute is not supported on this implementation.
75  * \ingroup group_icd
76  */
77 vx_status VX_API_CALL vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size);
78 
79 /*! \brief Creates a <tt>\ref vx_context</tt> from a <tt>\ref vx_platform</tt>.
80  * \details This creates a top-level object context for OpenVX from a platform handle.
81  * \returns The reference to the implementation context <tt>\ref vx_context</tt>. Any possible errors
82  * preventing a successful creation should be checked using <tt>\ref vxGetStatus</tt>.
83  * \ingroup group_icd
84  */
85 vx_context VX_API_CALL vxCreateContextFromPlatform(vx_platform platform);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
vx_context vxCreateContextFromPlatform(vx_platform platform)
Creates a vx_context from a vx_platform.
vx_status vxQueryPlatform(vx_platform platform, vx_enum attribute, void *ptr, vx_size size)
Queries the platform for some specific information.
vx_status vxIcdGetPlatforms(vx_size capacity, vx_platform platform[], vx_size *pNumItems)
Queries list of available platforms.
struct _vx_platform * vx_platform
Platform handle of an implementation.
Definition: vx_khr_icd.h:44