I have huge amount of txt files which contains 64x64 matrices consisting of integers. txt files has names like:
mat_1.txt, mat_2.txt, mat_3.txt, mat_4.txt, .... , mat_n.txt.
I have to create a variable, allocate space on host and device, read txt file and copy to device. is it possible to do it all in one loop?
I know how to create a string with sprintf but do not know how to use this string for example for declaring variables.
char fname[10];
for( int k=1; k<=n; k++ )
{
sprintf( fname, "mat_%d", k );
int *fname; // how to say to compiler that insted of `fname` there
// should be `mat_1` and in next cycle `mat_2`?
}
fnameto be"mat_1"the first time,"mat_2"the second time, etc.mat_Xdynamically