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_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.
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 }