Skip to content
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
12357ce
Updating coments
amikhail48 Jul 24, 2025
f448890
Added debug zone
amikhail48 Jul 26, 2025
5689513
Reworked array
amikhail48 Jul 26, 2025
3b08ba4
Reworked matrix and convolution
amikhail48 Jul 27, 2025
5838066
Reworked distribution
amikhail48 Jul 27, 2025
2fc6ebe
Reworked pyramid
amikhail48 Jul 27, 2025
3b68dc7
Reworked image
amikhail48 Jul 27, 2025
4998d63
Reworked lut
amikhail48 Jul 27, 2025
16247f2
Reworked remap
amikhail48 Jul 27, 2025
aa147c4
Reworked threshold
amikhail48 Jul 27, 2025
5b0dd4d
Reworked type pairs
amikhail48 Jul 27, 2025
77876c4
Reworked user data object
amikhail48 Jul 28, 2025
aee6e99
Reworked tensor
amikhail48 Jul 28, 2025
23f352c
More minor cleanup to type pairs
amikhail48 Jul 28, 2025
7923a5d
Reworked reference
amikhail48 Jul 28, 2025
a67427d
Reworked object array
amikhail48 Jul 29, 2025
2ebea20
Reworked scalar
amikhail48 Jul 29, 2025
dcf2e4d
Reworked parameter
amikhail48 Jul 29, 2025
b638a48
Reworked node
amikhail48 Jul 29, 2025
b53f297
More node cleanup
amikhail48 Jul 29, 2025
6ecfe52
Reworked graph
amikhail48 Jul 29, 2025
ef1d2ed
Reworked context
amikhail48 Jul 30, 2025
e1073cf
Reworked delay
amikhail48 Jul 30, 2025
78a2150
Reworked error
amikhail48 Jul 30, 2025
c9d2b91
Reworked import
amikhail48 Jul 30, 2025
8941c27
Reworked kernel
amikhail48 Jul 30, 2025
f7daa9d
Reworked log
amikhail48 Jul 31, 2025
c35fcce
Fixed broken integration test
amikhail48 Jul 31, 2025
9878ed1
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
51bcfe1
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
7471353
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
ceb9750
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
0fa2b3e
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
ccfb148
Apply suggestion from @amikhail48
amikhail48 Jul 31, 2025
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
68 changes: 68 additions & 0 deletions framework/include/vx_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,74 @@ class Array : public Reference
*/
vx_bool initVirtualArray(vx_enum item_type, vx_size capacity);

/**
* @brief Add items to array
*
* @param count number of items to add
* @param ptr pointer to data
* @param stride size of stride
* @return vx_status
* @ingroup group_int_array
*/
vx_status addItems(vx_size count, const void *ptr, vx_size stride);

/**
* @brief Truncate array to new number of items
*
* @param new_num_items new number of items
* @return vx_status
* @ingroup group_int_array
*/
vx_status truncate(vx_size new_num_items);

/**
* @brief Get item type of array
*
* @return vx_enum
* @ingroup group_int_array
*/
vx_enum itemType() const;

/**
* @brief Get number of items in array
*
* @return vx_size
* @ingroup group_int_array
*/
vx_size numItems() const;

/**
* @brief Get capacity of array
*
* @return vx_size
* @ingroup group_int_array
*/
vx_size totalCapacity() const;

/**
* @brief Get item size in array
*
* @return vx_size Item size in bytes
* @ingroup group_int_array
*/
vx_size itemSize() const;

/**
* @brief Get total size of array
*
* @return vx_size Total size in bytes
* @ingroup group_int_array
*/
vx_size totalSize() const;

/**
* @brief Get offset value
*
* @return vx_uint32 Offset value
* @ingroup group_int_array
*/
vx_uint32 offsetVal() const;

/**
* @brief Access array range in object
*
Expand Down
252 changes: 240 additions & 12 deletions framework/include/vx_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#define VX_CONTEXT_H

#include <memory>
#include <vector>

#include "vx_event_queue.hpp"
#include "vx_internal.h"
Expand All @@ -25,7 +26,6 @@
/*!
* \file
* \brief
* \author Erik Rainey <erik.rainey@gmail.com>
*
* \defgroup group_int_context Internal Context API
* \ingroup group_internal
Expand Down Expand Up @@ -53,6 +53,150 @@ class Context : public Reference
*/
~Context();

/**
* @brief Get vendor id
*
* @return vx_uint16 The vendor id.
* @ingroup group_int_context
*/
vx_uint16 vendorId() const;

/**
* @brief Get version number
*
* @return vx_uint16 The version number.
* @ingroup group_int_context
*/
vx_uint16 version() const;

/**
* @brief Get number of loaded modules
*
* @return vx_uint32 The number of loaded modules.
* @ingroup group_int_context
*/
vx_uint32 numModules() const;

/**
* @brief Get number of references
*
* @return vx_uint32 The number of tracked references.
* @ingroup group_int_context
*/
vx_uint32 numReferences() const;

/**
* @brief Get the implementation name
*
* @return const vx_char* The implementation name.
* @ingroup group_int_context
*/
const vx_char* implName() const;

/**
* @brief Get the names of the extensions supported
*
* @return const vx_char* The names of the extensions supported
* @ingroup group_int_context
*/
const vx_char* extensions() const;

/**
* @brief Get the max dimensions of a convolution supported
*
* @return vx_size The max dimensions of a convolution supported.
* @ingroup group_int_context
*/
vx_size convolutionMaxDim() const;

/**
* @brief Get the max dimensions of a non linear supported
*
* @return vx_size The max dimensions of a non linear supported.
* @ingroup group_int_context
*/
vx_size nonLinearMaxDim() const;

/**
* @brief Get the optical flow max window dimension supported
*
* @return vx_size The optical flow max window dimension supported.
* @ingroup group_int_context
*/
vx_size opticalFlowMaxWindowDim() const;

/**
* @brief Get the immediate border
*
* @return vx_border_t The immediate border.
* @ingroup group_int_context
*/
vx_border_t immediateBorder() const;

/**
* @brief Get the immediate border policy
*
* @return vx_enum The immediate border policy.
* @ingroup group_int_context
*/
vx_enum immediateBorderPolicy() const;

/**
* @brief Get the number of unique kernels
*
* @return vx_uint32 The number of unique kernels.
* @ingroup group_int_context
*/
vx_uint32 numUniqueKernels() const;

/**
* @brief Get the max tensor dimensions supported
*
* @return vx_size The max tensor dimensions supported.
* @ingroup group_int_context
*/
vx_size maxTensorDims() const;

/**
* @brief Get the unique kernel information
*
* @return std::vector<vx_kernel_info_t> The unique kernel information table.
* @ingroup group_int_context
*/
std::vector<vx_kernel_info_t> uniqueKernelTable();

/**
* @brief Get the OpenCL context
*
* @return cl_context The OpenCL context.
* @ingroup group_int_context
*/
cl_context clContext() const;

/**
* @brief Get the OpenCL command queue
*
* @return cl_command_queue The OpenCL command queue.
* @ingroup group_int_context
*/
cl_command_queue clCommandQueue() const;

/**
* @brief Set the logging enabled state
*
* @param flag vx_bool indicating whether to enable or disable logging
* @ingroup group_int_context
*/
void setLoggingEnabled(vx_bool flag);

/**
* @brief Set the perf enabled state
*
* @param flag vx_bool indicating whether to enable or disable performance tracking
* @ingroup group_int_context
*/
void setPerfEnabled(vx_bool flag);

/*! \brief This determines if a context is valid.
* \param [in] context The pointer to the context to test.
* \retval vx_true_e The context is valid.
Expand Down Expand Up @@ -106,12 +250,8 @@ class Context : public Reference
* will allocate memory if needed.
* \ingroup group_int_context
*/
vx_bool addAccessor(vx_size size,
vx_enum usage,
void*& ptr,
vx_reference ref,
vx_uint32 *pIndex,
void *extra_data);
vx_bool addAccessor(vx_size size, vx_enum usage, void*& ptr, vx_reference ref,
vx_uint32* pIndex, void* extra_data);

/*! \brief Finds and removes an accessor from the list.
* \ingroup group_int_context
Expand Down Expand Up @@ -174,21 +314,101 @@ class Context : public Reference
/**
* @brief Launch worker graph thread
*
* @param arg
* @return vx_value_t
* @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 thread
* @brief Launch worker node
*
* @param worker
* @return vx_bool
* @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
*
* @param size The size in bytes of the user struct.
* @return vx_enum The user struct enumeration.
* @ingroup group_int_context
*/
vx_enum registerUserStruct(vx_size size);

/**
* @brief Get the User Struct By Name object
*
* @param name The user struct name.
* @return vx_enum The user struct enumeration.
* @ingroup group_int_context
*/
vx_enum getUserStructByName(const vx_char* name);

/**
* @brief Get the User Struct Name By Enum object
*
* @param user_struct_type Enumeration for user struct type.
* @param type_name Name of user struct type.
* @param name_size Size of user struct name.
* @return vx_status VX_SUCCESS if successful, otherwise a return status with an error
* code.
* @ingroup group_int_context
*/
vx_status getUserStructNameByEnum(vx_enum user_struct_type, vx_char* type_name,
vx_size name_size);

/**
* @brief Get the User Struct Enum By Name object
*
* @param type_name The user struct name.
* @param user_struct_type The user struct type enumeration.
* @return vx_status VX_SUCCESS if successful, otherwise a return status with an error
* code.
* @ingroup group_int_context
*/
vx_status getUserStructEnumByName(const vx_char* type_name, vx_enum* user_struct_type);

/**
* @brief Register user struct with name
*
* @param size Size of user struct name.
* @param type_name The user struct name.
* @return vx_enum Enumeration of registered user struct
* @ingroup group_int_context
*/
vx_enum registerUserStructWithName(vx_size size, const vx_char* type_name);

/**
* @brief Allocate a unique kernel id
*
* @param pKernelEnumId Pointer to allocated kernel id by the framework.
* @return vx_status VX_SUCCESS if successful, otherwise a return status with an error code.
* @ingroup group_int_context
*/
vx_status allocateKernelId(vx_enum* pKernelEnumId);

/**
* @brief Allocate a unique library id
*
* @param pLibraryId Pointer to allocated library id by the framework.
* @return vx_status VX_SUCCESS if successful, otherwise a return status with an error code.
* @ingroup group_int_context
*/
vx_status allocateLibraryId(vx_enum* pLibraryId);

/**
* @brief Set the Immediate Mode Target
*
* @param target_enum The target enumeration.
* @param target_string The target string.
* @return vx_status VX_SUCCESS if successful, otherwise a return status with an error code.
* @ingroup group_int_context
*/
vx_status setImmediateModeTarget(vx_enum target_enum, const char* target_string);

/*! \brief The pointer to process global lock */
vx_sem_t* p_global_lock;
/*! \brief The reference table which contains the handle for later garage collection if needed */
Expand Down Expand Up @@ -275,6 +495,14 @@ class Context : public Reference
vx_value_set_t graph_queue[VX_INT_MAX_QUEUE_DEPTH];
/*! \brief The number of graphs in the queue */
vx_size numGraphsQueued;
/*! \brief The vendor id */
const vx_uint16 vendor_id;
/*! \brief The version number this implements */
const vx_uint16 version_number;
/*! \brief The name of this impleemntation */
const vx_char implementation[VX_MAX_IMPLEMENTATION_NAME];
/*! \brief The name of additional extensions in this impleemntation */
const vx_char* extension;
};

#endif /* VX_CONTEXT_H */
Loading
Loading