Hello,
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..
Error | 10 | error C2065: 'cin' : undeclared identifier | ||||
Error | 11 | error C2228: left of '.get' must have class/struct/union | t | |||
Error | 1 | error C2440: '=' : cannot convert from 'void *' to 'cl_float *' | ||||
Error | 2 | error C2440: '=' : cannot convert from 'void *' to 'cl_float *' | ||||
Error | 3 | error C2440: '=' : cannot convert from 'void *' to 'cl_float *' | t |
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.