typedef enum _vsip_memory_hint { VSIP_MEM_NONE = 0, VSIP_MEM_RDONLY = 1, VSIP_MEM_CONST = 2, VSIP_MEM_SHARED = 3, VSIP_MEM_SHARED_RDONLY = 4, VSIP_MEM_SHARED_CONST = 5 } vsip_memory_hint; vsip_vview_f* vsip_vcreate_f(vsip_length n, vsip_memory_hint h); vsip_vview_bl* vsip_vcreate_bl(vsip_length n, vsip_memory_hint h); vsip_vview_vi* vsip_vcreate_vi(vsip_length n, vsip_memory_hint h); vsip_vview_mi* vsip_vcreate_mi(vsip_length n, vsip_memory_hint h); vsip_cvview_f* vsip_cvcreate_f(vsip_length n, vsip_memory_hint h);
This function creates a vector view of the specified length n with a given memory hint h. The memory hint describes how the data is intended to be used, such as read-only, constant, or shared memory.
vsip_length n: The number of elements in the vector view. Must be greater than 0.
vsip_memory_hint h: Memory hint for the vector view, indicating properties such as read-only, constant, or shared memory.
VSIP_MEM_NONE - No memory hint
VSIP_MEM_RDONLY - The memory is to be used read-only
VSIP_MEM_CONST - The memory will hold constants
VSIP_MEM_SHARED - The memory will be shared
VSIP_MEM_SHARED_RDONLY - The memory will be shared and is read-only
VSIP_MEM_SHARED_CONST - The memory will be shared and will hold constants
On success, a pointer to the newly created vector view object is returned.
On error, NULL is returned.
If an error occurs, the function returns NULL.
vsip_length length = 10; vsip_memory_hint hint = VSIP_MEM_NONE; vsip_vview_f *vector_view; // Create a vector view vector_view = vsip_vcreate_f(length, hint); if (vector_view == NULL) { // Handle error }