vsip_cmview_f* (vsip_cmcreate_f)( vsip_length m, vsip_length n, vsip_major rc, vsip_memory_hint h) { vsip_cblock_f* b = VI_cblockcreate_f((size_t)(m*n), h); vsip_cmview_f* v = (vsip_cmview_f*)NULL; if(b != (vsip_cblock_f*)NULL){ v = (rc == VSIP_ROW) ? vsip_cmbind_f(b, (vsip_offset)0, (vsip_stride)n, m, (vsip_stride)1, n) : vsip_cmbind_f(b, (vsip_offset)0, (vsip_stride)1, m, (vsip_stride)m, n); if(v == (vsip_cmview_f*)NULL) VI_cblockdestroy_f(b); } return v; }
vsip_cmview_f* (vsip_cmsubview_f)( const vsip_cmview_f* v, vsip_index i, vsip_index j, vsip_length m, vsip_length n) { return vsip_cmbind_f(v->block, v->offset + i * v->col_stride + j * v->row_stride, v->col_stride, m, v->row_stride, n); }