The matrix MA with len columns and ht rows is written to stream in ASCII format. stream must already be open for write operations in text format.
The number format and the separation between columns may be specified using MF_setWriteFormat (C/C++ only) and MF_setWriteSeparate, respectively. See these functions for details.
Storing data in ASCII format is useful if the data have to be readable by human eyes, or if they are to be exported into other programs which are not able to read machine-format numbers. If avoidable, these functions should not be used for the storage of intermediate results that later have again to be read in. Instead, the function pairs of the MF_store / MF_recall family are recommended for the following reasons: conversion into ASCII format is slow, may lead to round-off errors, and requires much more disk memory than storage in machine format.
CUDA versions only: cudaM?_write_buf takes a host vector h_Wk as additional argument. The latter serves as buffer memory and needs to be (at least) of the same size as d_MA, i.e. ht*len. By avoiding the need of cudaM?_write to allocate its own buffer memory, cudaM?_write_buf is slightly faster.
|