Hello. I am just beginning to learn OpenCL and I am going through the exercises from the Introduction_to_OpenCL_Programming (exercise files can be found here: http://developer.amd.com/zones/openclzo … -2010.aspx ). I am having trouble getting the code from the multiply matrix problem to run. It compiles, but when I run the program it gives me the message that there was an error reading file.
This is the portion of code I am referring to:
// read the kernel
fp = fopen("multMatrix_kernel.cl","r");
fseek(fp,0L, SEEK_END);
filelen = ftell(fp);
rewind(fp);
kernel_src = (char*) malloc(sizeof(char)*(filelen+1));
readlen = fread(kernel_src,1,filelen,fp);
if(readlen!= filelen)
{
printf("error reading file
");
printf(kernel_src);
std::cin.get();
exit(1);
}
Anyway, I began printing out the kernel source and it seems there is a bunch of characters at the end.
Anyway, if anyone has run into a similar problem I would greatly appreciate any pointers you might have. I am using VS2010. Thank you for your time.