Commit 5bfa7251 authored by Téo Mazars's avatar Téo Mazars

opencl: fix a bunch of opencl compilation error with pocl

parent 1ff66f59
......@@ -103,8 +103,8 @@ void compute_envelopes(const __global float4 *src_buf,
range_sum += range;
}
float4 relative_brightness = relative_brightness_sum / iterations;
float4 range = range_sum / iterations;
float4 relative_brightness = relative_brightness_sum / (float4)(iterations);
float4 range = range_sum / (float4)(iterations);
if(max_envelope)
*max_envelope = pixel + (1.0f - relative_brightness) * range;
......
......@@ -104,8 +104,8 @@ static const char* c2g_cl_source =
" range_sum += range; \n"
" } \n"
" \n"
" float4 relative_brightness = relative_brightness_sum / iterations; \n"
" float4 range = range_sum / iterations; \n"
" float4 relative_brightness = relative_brightness_sum / (float4)(iterations);\n"
" float4 range = range_sum / (float4)(iterations); \n"
" \n"
" if(max_envelope) \n"
" *max_envelope = pixel + (1.0f - relative_brightness) * range; \n"
......
......@@ -3,7 +3,7 @@
#define POW2(a) ((a)*(a))
#define GEN_METRIC(before, center, after) POW2((center) * 2 - (before) - (after))
#define GEN_METRIC(before, center, after) POW2((center) * (float4)(2.0f) - (before) - (after))
#define BAIL_CONDITION(new,original) ((new) < (original))
......@@ -60,7 +60,7 @@ __kernel void noise_reduction_cl (__global float4 *src_buf,
after_pix);
mask = BAIL_CONDITION (metric_new, metric_reference[axis]) & mask;
}
sum += mask >0 ? value : 0;
sum += mask >0 ? value : (float4)(0.0);
count += mask >0 ? 1 : 0;
}
dst_buf[dst_offset] = (sum/convert_float4(count));
......
......@@ -4,7 +4,7 @@ static const char* noise_reduction_cl_source =
" \n"
"#define POW2(a) ((a)*(a)) \n"
" \n"
"#define GEN_METRIC(before, center, after) POW2((center) * 2 - (before) - (after))\n"
"#define GEN_METRIC(before, center, after) POW2((center) * (float4)(2.0f) - (before) - (after))\n"
" \n"
"#define BAIL_CONDITION(new,original) ((new) < (original)) \n"
" \n"
......@@ -61,7 +61,7 @@ static const char* noise_reduction_cl_source =
" after_pix); \n"
" mask = BAIL_CONDITION (metric_new, metric_reference[axis]) & mask;\n"
" } \n"
" sum += mask >0 ? value : 0; \n"
" sum += mask >0 ? value : (float4)(0.0); \n"
" count += mask >0 ? 1 : 0; \n"
" } \n"
" dst_buf[dst_offset] = (sum/convert_float4(count)); \n"
......
......@@ -62,7 +62,7 @@ __kernel void snn_mean (__global const float4 *src_buf,
break;
}
}
dst_buf[offset] = accumulated/count;
dst_buf[offset] = accumulated/(float4)(count);
return;
}
else if(pairs==1)
......@@ -108,7 +108,7 @@ __kernel void snn_mean (__global const float4 *src_buf,
break;
}
}
dst_buf[offset] = accumulated/count;
dst_buf[offset] = accumulated / (float4)(count);
return;
}
return;
......
......@@ -63,7 +63,7 @@ static const char* snn_mean_cl_source =
" break; \n"
" } \n"
" } \n"
" dst_buf[offset] = accumulated/count; \n"
" dst_buf[offset] = accumulated/(float4)(count); \n"
" return; \n"
" } \n"
" else if(pairs==1) \n"
......@@ -109,7 +109,7 @@ static const char* snn_mean_cl_source =
" break; \n"
" } \n"
" } \n"
" dst_buf[offset] = accumulated/count; \n"
" dst_buf[offset] = accumulated / (float4)(count); \n"
" return; \n"
" } \n"
" return; \n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment