Help Me Understand The Matrix Multiplication Sample Kernel!

Discussion created by Fuxianjun on May 26, 2010
Latest reply on May 27, 2010 by Fuxianjun

I have many problems about the matrix mulplication sample.I appreciate you to help me answer the following questions.

1,Please help me understand the matrix multiplication sample kernel! It's better to explain in detail.

2.When use this function clGetKernelWorkGroupInfo() to query CL_KERNEL_WORK_GROUP_SIZE in the matrix multiplication sample kernel, it return 256, dose it means that if I query CL_KERNEL_WORK_GROUP_SIZE in anoter kernel with the parameter of float type(in the sample kernel,the parameter type is float4) , the return will be 1024 because of float4 consist of 4 floats?

3. Dose  CL_KERNEL_WORK_GROUP_SIZE means how many work-items a work-group contains ? In the case of 2D calculation, if CL_KERNEL_WORK_GROUP_SIZE is 256, dose it means the blocksize must be 16, and there are 16*16 work-items in the work-group?

4.When I change the size of the two multiplied matrix to be not multiples of blocksize ,it returns a zero matrix, why ?  How does OPENCL allocate input matrix into work-group or work-item?