Adelsbach/VSIPL
Core Light Double Precision Programming Reference Guide
DD-00014-015
Core Light +DP

5.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_d*  vsip_blockcreate_d(vsip_length n, vsip_memory_hint h); 
vsip_block_i*  vsip_blockcreate_i(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 
}