294 |
|
|
295 |
int imageDataSize = (int)nrrdElementNumber(nin); |
int imageDataSize = (int)nrrdElementNumber(nin); |
296 |
|
|
297 |
|
float * data = (float *)nin->data; |
298 |
|
printf("Data Image: %f\n", (float)data[4* nin->axis[1].size * nin->axis[2].size + 5 * nin->axis[2].size + 2]); |
299 |
|
|
300 |
cl_mem imageData_mem, out_mem, h1_mem, h2_mem; |
cl_mem imageData_mem, out_mem, h1_mem, h2_mem; |
301 |
|
|
302 |
|
|
369 |
(void *)h2 ,0,NULL,NULL); |
(void *)h2 ,0,NULL,NULL); |
370 |
|
|
371 |
|
|
372 |
imageData_mem = clCreateBuffer(context,CL_MEM_READ_ONLY,imageDataSize,NULL,NULL); |
imageData_mem = clCreateBuffer(context,CL_MEM_READ_ONLY,sizeof(float) * imageDataSize,NULL,NULL); |
373 |
err |= clEnqueueWriteBuffer(queue,imageData_mem,CL_TRUE,0,imageDataSize, |
err |= clEnqueueWriteBuffer(queue,imageData_mem,CL_TRUE,0,sizeof(float) * imageDataSize, |
374 |
nin->data ,0,NULL,NULL); |
nin->data ,0,NULL,NULL); |
375 |
|
|
376 |
//Load the transformMatrix |
//Load the transformMatrix |
425 |
|
|
426 |
err = clEnqueueReadBuffer(queue,out_mem,CL_TRUE,0, sizeof(float) * (SIZE *SIZE),out,0,NULL,NULL); |
err = clEnqueueReadBuffer(queue,out_mem,CL_TRUE,0, sizeof(float) * (SIZE *SIZE),out,0,NULL,NULL); |
427 |
|
|
428 |
|
printMatrix(out,20); |
429 |
|
|
430 |
clReleaseKernel(kernel); |
clReleaseKernel(kernel); |
431 |
clReleaseProgram(program); |
clReleaseProgram(program); |
432 |
clReleaseCommandQueue(queue); |
clReleaseCommandQueue(queue); |