Open GoogleCodeExporter opened 9 years ago
I second this.
The code in Listing 21.2 should read:
const char *C_elem_KernelSource = "\n"\
"__kernel void mmul(const int Mdim \n"\
" const int Ndim, \n"\
" const int Pdim, \n"\
" __global float* A, \n"\
" __global float* B, \n"\
" __global float* C) \n"\
"{ \n"\
" int k; \n"\
" int i = get_global_id(0); \n"\
" int j = get_global_id(1); \n"\
" i = i + global_pim_id_0*get_global_size(0); \n"\
" j = j + global_pim_id_1*get_global_size(1); \n"\
" float tmp; \n"\
" if ( (i<Ndim) && (j<Mdim)) { \n"\
" tmp = 0.0; \n"\
" for (k = 0; k < Pdim; k++) \n"\
" tmp += A[i*Ndim+k] * B[k*Pdim+j]; \n"\
" C[i*Mdim+j] = tmp; \n"\
" } \n"\
"} \n"\
"\n"
with the only change being that C[i*Ndim+j]
should be changed to C[i*Mdim+j]
Original issue reported on code.google.com by
thalie.k...@gmail.com
on 10 Oct 2012 at 10:10