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_block_f* vsip_blockcreate_f(vsip_length n, vsip_memory_hint h); vsip_block_i* vsip_blockcreate_i(vsip_length n, vsip_memory_hint h); vsip_cblock_f* vsip_cblockcreate_f(vsip_length n, vsip_memory_hint h);
These functions create a block of data of the specified type with elements. The memory hint h describes how this data is
intended to be used, such as read-only, constant, or shared memory.
vsip_length n: The number of elements in the block. Must be greater than 0.
vsip_memory_hint h: Memory hint for the block, 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 block 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_block_f *float_block; // Create a float block float_block = vsip_blockcreate_f(length, hint); if (float_block == NULL) { // Handle error } vsip_block_i *int_block; // Create an integer block int_block = vsip_blockcreate_i(length, hint); if (int_block == NULL) { // Handle error } vsip_cblock_f *complex_block; // Create a complex float block complex_block = vsip_cblockcreate_f(length, hint); if (complex_block == NULL) { // Handle error }