 extern "C" ghost_error_t ghost_densemat_cm_cu_fromRand(ghost_densemat_t *vec)
 {
     ghost_error_t ret = GHOST_SUCCESS;
-    if (vec->traits.flags & GHOST_DENSEMAT_SCATTERED) {
+    if (vec->traits.flags & GHOST_DENSEMAT_VIEW) {
         ERROR_LOG("fromRand does currently not consider vector views!");
         return GHOST_ERR_NOT_IMPLEMENTED;
     }


    char *cucolfield = NULL, *curowfield = NULL;
    
    if ((v1->traits.flags & GHOST_DENSEMAT_SCATTERED) || (v2->traits.flags & GHOST_DENSEMAT_SCATTERED)) {
        
        WARNING_LOG("Potentially slow AXPBY operation because some rows or columns are masked out!");
        
        GHOST_CALL_GOTO(ghost_cu_malloc((void **)&cucolfield,v1->traits.ncolsorig),err,ret);
        GHOST_CALL_GOTO(ghost_cu_malloc((void **)&curowfield,v1->traits.nrowsorig),err,ret);

    }

    
    if ((v1->traits.flags & GHOST_DENSEMAT_VIEW) || (v2->traits.flags & GHOST_DENSEMAT_VIEW)) {
        WARNING_LOG("Potentially slow VAXPY operation because some rows or columns may be masked out!");
        
        GHOST_CALL_GOTO(ghost_cu_malloc((void **)&cucolfield,v1->traits.ncolsorig),err,ret);
        GHOST_CALL_GOTO(ghost_cu_malloc((void **)&curowfield,v1->traits.nrowsorig),err,ret);
