Adelsbach/VSIPL
Core Light Programming Reference Guide
DD-00014-015
Core Light

5.2 vsip_blockbind_p - Create a block using existing data

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);
Description

These functions create a new data block using an existing data array p with n> 0 elements and a given memory hint h. The block must be admitted before it can be used.

Parameters
Return Value
Error Handling

If an error occurs, the function returns NULL.

Example

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 
}