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_blockbind_f(vsip_scalar_f *p, vsip_length n, vsip_memory_hint h); vsip_block_i* vsip_blockbind_i(vsip_scalar_i *p, vsip_length n, vsip_memory_hint h);
These functions create a new data block using an existing data array p with elements and a given memory hint h. The block
must be admitted before it can be used.
vsip_scalar_p *p: Pointer to the existing data array.
vsip_length n: The number of elements in the data array. 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_scalar_f float_data[10]; // Example float data array vsip_length length = 10; vsip_memory_hint hint = VSIP_MEM_NONE; vsip_block_f *float_block; // Create a float block float_block = vsip_blockbind_f(float_data, length, hint); if (float_block == NULL) { // Handle error } // Admit the block before using it int result = vsip_blockadmit_f(float_block, VSIP_TRUE); if (result != 0) { // Handle error }