Are float ---> double and double----> float conversion supported in V2.2?
I ask this becasue i has a lot of problems with double float conversion.
Modifing Template to feed float instead of unsigned int
/*!
* Sample kernel which multiplies every element of the input array with
* a constant and stores it at the corresponding output array
*/
#pragma OPENCL EXTENSION cl_amd_fp64 : enable
__kernel void templateKernel(__global float * output,
__global float * input,
const unsigned int multiplier)
{
double shift = (double)input[7];
double ztmp;
ztmp = (shift * shift) + 1.0;
output[0] = (float)ztmp;
}
on CPU i get 50 ( input[7] = 7 ) OK
on GPU i get 1 FAIL
( same result with convert_double() convert_float() )
where is a work around ?
Done
/*!
* Sample kernel which multiplies every element of the input array with
* a constant and stores it at the corresponding output array
*/
#pragma OPENCL EXTENSION cl_amd_fp64 : enable
__kernel void templateKernel(__global float * output,
__global float * input,
const unsigned int multiplier)
{
double shift = convert_double(input[7]);
double ztmp;
ztmp = (shift * shift) + 1.0;
output[0] = convert_float(ztmp);
}
same result
on CPU i get 50 ( input[7] = 7 ) OK
on GPU i get 1 FAIL
Can we expect the next SDK release this year?
IMHO yes. but it is just speculation from me.