First hello to everybody and sorry for my english i’m an spanish speaker =), its my first time here and i want to congrats to everyone that colaborate ont his subject. Let’s go to the problem, i built my own “oclLoadProgSource” using the standart method for reading files in C, this is:
FILE *fp;
fp = fopen("kernel2.cl", "r");
if (!fp) {
fprintf(stderr, "Failed to load kernel.
");
exit(1);
}
fseek(fp,0,SEEK_END);
kernelLength = ftell(fp);
rewind(fp);
char *clMatrixMul = (char *) malloc (kernelLength);
fread(clMatrixMul,1,kernelLength,fp);
//printf("%s
Cantidad de caracteres: %i.
",clMatrixMul,kernelLength/sizeof(char));
fclose(fp);
but when i do this:
clProgram = clCreateProgramWithSource(clGPUContext,
1,(const char **)&clMatrixMul,
&kernelLength,&errcode);
clCheckErr(errcode, "clCreateProgramWithSource");
errcode = clBuildProgram(clProgram,0,
NULL,"",NULL,NULL);
clCheckErr(errcode, "clBuildProgram");
appear to be a problem with clBuildProgram. I’m not sure if i’m doing well the read of the file, and clCreateProgramWithSource it’s well constructed.
Thanks.