I'm trying to open two files (linoteste.ima and sysmattest.dat) they both have a matrix. After successfully opening files, when I print them, I get only zero and I do not know what I'm doing wrong. This is not a CUDA related problem but it is only one, it's just that I am opening the file to multiply the matrix with the CUDA. My code is as follows (I have tried to replace the field with one time at one time to read an element, but it does not work):
float * matlino = ( Float *) malloc (sizeof (boat) * 100 * 100); Name * matsys = (name *) malloc (sizeof (boat) * 10000 * 10000); // OpenLinogram file * Flinto, * FMAT; Flinfo = FOPN ("Leonitesti.eima", "R"); // is also attempted with "RB" instead of "R" if (Flino! = Null) {Fred (Matline, Size (float), 100 * 100, Flino); Falcos (Flino); ("Linogram Aberto Com Suisso"); } And adds ("Unfairly Abrar Lignogram"); PrintMat (matlino, 10,10); // Open system matrix fmat = fopen ("sysmattest.dat", "r"); If (fmat! = NULL) {Feed (matts, size (float), 10000 * 10000, FEMAT); Falcos (FATA); ("Matridge Systormar com cumusu"); } And adds ("Uncredited Aber Matridge Sistema"); Thanks advance!
Have you tried FSNF?
Something like this:
if (flin! = Null) {int i; For (i = 0; i & lt; 10000; i ++) fscanf (Flino, "% f", and Malino [i]); Fclose (flino); }
Comments
Post a Comment