diff --git a/pyFAI/resources/openCL/ocl_azim_CSR.cl b/pyFAI/resources/openCL/ocl_azim_CSR.cl index 01fdb430..d5483bc7 100644 --- a/pyFAI/resources/openCL/ocl_azim_CSR.cl +++ b/pyFAI/resources/openCL/ocl_azim_CSR.cl @@ -103,7 +103,7 @@ csr_integrate( const global float *weights, //Kahan summation allows single precision arithmetics with error compensation //http://en.wikipedia.org/wiki/Kahan_summation_algorithm // defined in kahan.cl - sum_data_K = kahan_sum(sum_data_K, pown(coef, coef_power) * data); + sum_data_K = kahan_sum(sum_data_K, ((coef_power == 2) ? coef*coef: coef) * data); sum_count_K = kahan_sum(sum_count_K, coef); };//end if dummy } //end if k < bin_bounds.y diff --git a/pyFAI/resources/openCL/ocl_azim_LUT.cl b/pyFAI/resources/openCL/ocl_azim_LUT.cl index 161156bc..4ebd86c4 100644 --- a/pyFAI/resources/openCL/ocl_azim_LUT.cl +++ b/pyFAI/resources/openCL/ocl_azim_LUT.cl @@ -114,7 +114,7 @@ lut_integrate( const global float *weights, //sum_count += coef; //Kahan summation allows single precision arithmetics with error compensation //http://en.wikipedia.org/wiki/Kahan_summation_algorithm - sum_data_K = kahan_sum(sum_data_K, pown(coef, coef_power) * data); + sum_data_K = kahan_sum(sum_data_K, ((coef_power == 2) ? coef*coef: coef) * data); sum_count_K = kahan_sum(sum_count_K, coef); };//end if dummy };//for j