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.1 vsip_dblockcreate_p - Create a block

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_block_bl*  vsip_blockcreate_bl(vsip_length n, vsip_memory_hint h); 
vsip_block_vi*  vsip_blockcreate_vi(vsip_length n, vsip_memory_hint h); 
vsip_block_mi*  vsip_blockcreate_mi(vsip_length n, vsip_memory_hint h); 
vsip_cblock_f* vsip_cblockcreate_f(vsip_length n, vsip_memory_hint h);
Description

These functions create a block of data of the specified type with n >0 elements. The memory hint h describes how this data is intended to be used, such as read-only, constant, or shared memory.

Parameters
Return Value
Error Handling

If an error occurs, the function returns NULL.

Example

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 
}