Adelsbach/VSIPL
Core Programming Reference Guide
DD-00016-015
Core

This manual is preliminary and incomplete.
While our Core implementation implements all functions given in the standard we are still working on completing this documentation.

Please refer to the VSIPL standard for a complete function reference of the Core profile until we have completed work on this documentation.

1.2.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); 
vsip_block_bl*  vsip_blockbind_bl(vsip_scalar_bl *p, vsip_length n, vsip_memory_hint h); 
vsip_block_vi*  vsip_blockbind_vi(vsip_scalar_vi *p, vsip_length n, vsip_memory_hint h); 
vsip_block_mi*  vsip_blockbind_mi(vsip_scalar_mi *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 
}