OpenCL computing (dimension avarage) with doubles

Hi,

I am learning OpenCL and got a problem with computing a dimensional average with double variables.

The OpenCL kernel code is:

const char C_lastdim_dimavg_KernelSource = "
"
" #pragma OPENCL EXTENSION cl_khr_fp64 : enable
"
"__kernel void dimavg(
"
" const int m,
"
" __global double
vin,
"
" __global double* vout)
"
"{
"
" int k;
"
" int i = get_global_id(0);
"
" double sum_val = 0.0;
"
" for(k = 0; k < m; ++k)
"
" sum_val += vin[i + k];
"
" vout[i] = sum_val / (double)m;
"
"}
"
"
";

I have tried with float, it seems this code works right.

Thanks in advance,

Wei