Showing results for 
Search instead for 
Did you mean: 


Journeyman III

matrix mulipltplication failed


I am just beggining to  learn OpenCL and i am going through exercise of Matrix multiplication.i am having following error.Give the solution.

Thanks in advance..

Error10error C2065: 'cin' : undeclared identifier
Error11error C2228: left of '.get' must have class/struct/uniont
Error1error C2440: '=' : cannot convert from 'void *' to 'cl_float *'
Error2error C2440: '=' : cannot convert from 'void *' to 'cl_float *'
Error3error C2440: '=' : cannot convert from 'void *' to 'cl_float *'t
0 Kudos
1 Reply
Adept II

Re: matrix mulipltplication failed

One thing I can spot is issue when you use malloc. You need to always cast the pointer returned by malloc to the appropriate pointer to the data type you want to store. Therefore you should have something like the following (parts you are missing are highlighted in bold, underlined);

inputMatrix1 = (cl_float*) malloc(sizeof(cl_float)*width*height);

inputMatrix2 = (cl_float*) malloc(sizeof(cl_float)*width*height);

results = (cl_float*) malloc(sizeof(cl_float)*width*height);

Same applies to every line in which you have used malloc.

0 Kudos