Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ EXCLUDE_PATTERNS = */bazel-*/* \
*/build/* \
*/cts/* \
*/external/* \
*/kernels/NNEF-Tools/* \
*/kernels/nnef/NNEF-Tools/* \
*/kernels/utils/half/* \
*.md \
/private/var/tmp/_bazel* \
Expand Down
85 changes: 48 additions & 37 deletions framework/include/vx_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,37 @@ class Array : public Reference
* @param capacity capacity of array
* @param is_virtual is array virtual
* @param type array or lut
* @return vx_array
* @return vx_array array object
* @ingroup group_int_array
*/
static vx_array createArray(vx_context context, vx_enum item_type, vx_size capacity, vx_bool is_virtual, vx_enum type);
static vx_array createArray(
vx_context context, vx_enum item_type, vx_size capacity, vx_bool is_virtual = vx_false_e, vx_enum type = VX_TYPE_ARRAY);

/**
* @brief Create a LUT object
*
* @param context context object
* @param data_type array object type
* @param count count of array
* @return vx_lut_t LUT object
* @ingroup group_int_array
*/
static vx_lut_t createLUT(vx_context context, vx_enum data_type, vx_size count);

/**
* @brief Validate array object
*
* @param item_type array object type
* @param capacity capacity of array
* @return vx_bool
* @return vx_bool true if valid, false otherwise
* @ingroup group_int_array
*/
vx_bool validateArray(vx_enum item_type, vx_size capacity);

/**
* @brief Allocate memory for array object
*
* @return vx_bool
* @return vx_bool true if successful, false otherwise
* @ingroup group_int_array
*/
vx_bool allocateArray();
Expand All @@ -97,7 +109,7 @@ class Array : public Reference
*
* @param context global context
* @param item_type item type
* @return vx_size
* @return vx_size size of item
* @ingroup group_int_array
*/
static vx_size itemSize(vx_context context, vx_enum item_type);
Expand All @@ -107,7 +119,7 @@ class Array : public Reference
*
* @param context global context
* @param item_type item type
* @return vx_bool
* @return vx_bool true if valid, false otherwise
* @ingroup group_int_array
*/
static vx_bool isValidArrayItemType(vx_context context, vx_enum item_type);
Expand All @@ -116,7 +128,7 @@ class Array : public Reference
* @brief Validate array object
*
* @param arr array object to check
* @return vx_bool
* @return vx_bool true if valid, false otherwise
* @ingroup group_int_array
*/
static vx_bool isValidArray(vx_array arr);
Expand All @@ -133,7 +145,7 @@ class Array : public Reference
*
* @param item_type array object type
* @param capacity capacity of array
* @return vx_bool
* @return vx_bool true if successful, false otherwise
* @ingroup group_int_array
*/
vx_bool initVirtualArray(vx_enum item_type, vx_size capacity);
Expand Down Expand Up @@ -209,53 +221,53 @@ class Array : public Reference
/**
* @brief Access array range in object
*
* @param start start index
* @param end end index
* @param pStride pointer of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @return vx_status
* @param start start index
* @param end end index
* @param pStride pointer of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @return vx_status VX_SUCCESS if successful, any other value indicates failure.
* @ingroup group_int_array
*/
vx_status accessArrayRange(vx_size start, vx_size end, vx_size *pStride, void **ptr, vx_enum usage);

/**
* @brief Commit array range
*
* @param start start index
* @param end end index
* @param ptr pointer to data
* @return vx_status
* @param start start index
* @param end end index
* @param ptr pointer to data
* @return vx_status VX_SUCCESS if successful, any other value indicates failure.
* @ingroup group_int_array
*/
vx_status commitArrayRange(vx_size start, vx_size end, const void *ptr);

/**
* @brief Copy array range
*
* @param start start index
* @param end end index
* @param stride size of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @param mem_type host | device
* @return vx_status
* @param start start index
* @param end end index
* @param stride size of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @param mem_type host | device
* @return vx_status VX_SUCCESS if successful, any other value indicates failure.
* @ingroup group_int_array
*/
vx_status copyArrayRange(vx_size start, vx_size end, vx_size stride, void *ptr, vx_enum usage, vx_enum mem_type);

/**
* @brief Map array range
*
* @param start start index
* @param end end index
* @param map_id memory map id
* @param stride size of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @param mem_type host | device
* @param flags additional flags
* @return vx_status
* @param start start index
* @param end end index
* @param map_id memory map id
* @param stride size of stride
* @param ptr pointer to data
* @param usage ro | rw | wo
* @param mem_type host | device
* @param flags additional flags
* @return vx_status VX_SUCCESS if successful, any other value indicates failure.
* @ingroup group_int_array
*/
vx_status mapArrayRange(vx_size start, vx_size end, vx_map_id *map_id, vx_size *stride,
Expand All @@ -265,7 +277,7 @@ class Array : public Reference
* @brief Unmap array range
*
* @param map_id memory map id
* @return vx_status
* @return vx_status VX_SUCCESS if successful, any other value indicates failure.
* @ingroup group_int_array
*/
vx_status unmapArrayRange(vx_map_id map_id);
Expand Down Expand Up @@ -300,5 +312,4 @@ class Array : public Reference

} // namespace corevx


#endif /* VX_ARRAY_H */
#endif /* VX_ARRAY_H */
64 changes: 38 additions & 26 deletions framework/include/vx_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,65 @@

/*!
* \file
* \brief
* \brief The internal context implementation.
*
* \defgroup group_int_context Internal Context API
* \ingroup group_internal
* \brief The Internal Context API
*/

/*! \brief The implementation string which is of the format "<vendor>.<substring>" */
extern const vx_char implementation[];

/*! \brief The top level context data for the entire OpenVX instance
* \ingroup group_int_context
*/
namespace corevx {

class Context : public Reference
class Context final : public Reference
{
private:
/**
* @brief Launch worker graph thread
*
* @param arg Optional argument to pass as parameter.
* @return vx_value_t Thread return value.
* @ingroup group_int_context
*/
static vx_value_t workerGraph(void* arg);

/**
* @brief Launch worker node
*
* @param worker The threadpool of the worker.
* @return vx_bool vx_true_e if ran successful, vx_false_e otherwise
* @ingroup group_int_context
*/
static vx_bool workerNode(vx_threadpool_worker_t* worker);

public:
/**
* @brief Construct a new Context object
* @ingroup group_int_context
*/
Context();

/**
* @brief Delete copy constructor and assignment operator to prevent copying
* @ingroup group_int_context
*/
Context(const Context&) = delete;
Context& operator=(const Context&) = delete;

/**
* @brief Destroy the Context object
* @ingroup group_int_context
*/
~Context();

/**
* @brief Create a new context
* @ingroup group_int_context
*/
static vx_context createContext();

/**
* @brief Get vendor id
*
Expand Down Expand Up @@ -167,6 +196,7 @@ class Context : public Reference
*/
std::vector<vx_kernel_info_t> uniqueKernelTable();

#ifdef OPENVX_USE_OPENCL_INTEROP
/**
* @brief Get the OpenCL context
*
Expand All @@ -182,6 +212,7 @@ class Context : public Reference
* @ingroup group_int_context
*/
cl_command_queue clCommandQueue() const;
#endif /** OPENVX_USE_OPENCL_INTEROP */

/**
* @brief Set the logging enabled state
Expand Down Expand Up @@ -313,24 +344,6 @@ class Context : public Reference
*/
static vx_bool isValidBorderMode(vx_enum mode);

/**
* @brief Launch worker graph thread
*
* @param arg Optional argument to pass as parameter.
* @return vx_value_t Thread return value.
* @ingroup group_int_context
*/
static vx_value_t workerGraph(void *arg);

/**
* @brief Launch worker node
*
* @param worker The threadpool of the worker.
* @return vx_bool vx_true_e if ran successful, vx_false_e otherwise
* @ingroup group_int_context
*/
static vx_bool workerNode(vx_threadpool_worker_t *worker);

/**
* @brief Register a user struct with a certain number of bytes
*
Expand Down Expand Up @@ -501,13 +514,12 @@ class Context : public Reference
const vx_uint16 vendor_id;
/*! \brief The version number this implements */
const vx_uint16 version_number;
/*! \brief The name of this impleemntation */
/*! \brief The implementation string which is of the format "<vendor>.<substring>" */
const vx_char implementation[VX_MAX_IMPLEMENTATION_NAME];
/*! \brief The name of additional extensions in this impleemntation */
const vx_char* extension;
};

} // namespace corevx


#endif /* VX_CONTEXT_H */
#endif /* VX_CONTEXT_H */
14 changes: 12 additions & 2 deletions framework/include/vx_convolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ class Convolution : public Matrix
*/
Convolution(vx_context context, vx_reference scope);

/**
* @brief Create a new convolution
*
* @param context The context associated with this convolution
* @param columns The number of columns in the convolution
* @param rows The number of rows in the convolution
* @return vx_convolution The convolution object
* @ingroup group_int_convolution
*/
static vx_convolution createConvolution(vx_context context, vx_size columns, vx_size rows);

/**
* @brief Get the scale factor of the convolution
*
Expand Down Expand Up @@ -118,5 +129,4 @@ class Convolution : public Matrix

} // namespace corevx


#endif /* VX_CONVOLUTION_H */
#endif /* VX_CONVOLUTION_H */
1 change: 1 addition & 0 deletions framework/include/vx_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

/*!
* \file
* \brief The internal debugging implementation.
*
* \defgroup group_int_debug Internal Debugging API
* \ingroup group_internal
Expand Down
11 changes: 11 additions & 0 deletions framework/include/vx_delay.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ class Delay : public Reference
*/
~Delay();

/**
* @brief Create a delay object
*
* @param context
* @param exemplar
* @param count
* @return vx_delay
* @ingroup group_int_delay
*/
static vx_delay createDelay(vx_context context, vx_reference exemplar, vx_size count);

/**
* @brief Get data type of references associated with this delay object
*
Expand Down
15 changes: 13 additions & 2 deletions framework/include/vx_distribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ class Distribution : public Reference
*/
Distribution(vx_context context, vx_reference scope);

/**
* @brief Create a new distribution
*
* @param context The context associated with this distribution
* @param numBins The number of bins in the distribution
* @param offset The offset of the distribution
* @param range The range of the distribution
* @return vx_distribution The distribution object
* @ingroup group_int_distribution
*/
static vx_distribution createDistribution(vx_context context, vx_size numBins, vx_int32 offset, vx_uint32 range);

/**
* @brief Get the number of dimensions in the distribution
*
Expand Down Expand Up @@ -171,5 +183,4 @@ class Distribution : public Reference

} // namespace corevx


#endif /* VX_DISTRIBUTION_H */
#endif /* VX_DISTRIBUTION_H */
Loading