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_cblock_f* vsip_cblockbind_f(vsip_scalar_f *r, vsip_scalar_f *i, vsip_length n, vsip_memory_hint h); vsip_cblock_d* vsip_cblockbind_d(vsip_scalar_d *r, vsip_scalar_d *i, vsip_length n, vsip_memory_hint h);
This function creates a new complex data block using existing data, which can be either interleaved complex numbers or split real
and imaginary data arrays. If the imaginary data array i is NULL, it is assumed that r is interleaved and contains
elements. If the imaginary data array is provided, it is assumed that each of the r and i arrays contains
elements.
The block must be admitted before it can be used.
vsip_scalar_p *r: Pointer to the real part array or the interleaved array.
vsip_scalar_p *i: Pointer to the imaginary part array. If NULL, r is assumed to be interleaved.
vsip_length n: The number of complex elements. 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 complex block object is returned.
On error, NULL is returned.
If an error occurs, the function returns NULL.
vsip_scalar_f real_data[10]; // Example data array vsip_scalar_f imag_data[10]; // Example imaginary data array vsip_length length = 10; vsip_memory_hint hint = VSIP_MEM_NONE; vsip_cblock_f *block; // Create a block with split real and imaginary data block = vsip_cblockbind_f(real_data, imag_data, length, hint); if (block == NULL) { // Handle error } // Admit the block before using it int result = vsip_cblockadmit_f(block, VSIP_TRUE); if (result != 0) { // Handle error } // Create a block with interleaved data vsip_scalar_f interleaved_data[20]; // Example interleaved data array block = vsip_cblockbind_f(interleaved_data, NULL, length, hint); if (block == NULL) { // Handle error } // Admit the block before using it result = vsip_cblockadmit_f(block, VSIP_TRUE); if (result != 0) { // Handle error }