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.4.1 vsip_dmcreate_p - Create a Matrix View

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; 
 
typedef enum { 
  VSIP_ROW = 0, 
  VSIP_COL = 1 
} vsip_major; 
 
vsip_mview_f* vsip_mcreate_f(vsip_length row_length, vsip_length col_length, 
                            vsip_major major, vsip_mem_hint hint); 
vsip_cmview_f* vsip_cmcreate_f(vsip_length row_length, vsip_length col_length, 
                              vsip_major major, vsip_mem_hint hint);
Description

This function creates a new matrix view with the specified dimensions. The function allocates both a data block and a matrix view, and binds them together.

Whether the matrix is stored in row- or column major order can be selected using the major argument.

Parameters
Return Value
Example

vsip_mview_f *matrix; 
vsip_length rows = 100; 
vsip_length cols = 100; 
 
// Create a 100x100 matrix initialized to 0.0 
matrix = vsip_mcreate_f(rows, cols, VSIP_ROW, VSIP_MEM_NONE); 
 
if (matrix == NULL) { 
    // Handle error 
}
Notes