Closed GoogleCodeExporter closed 9 years ago
Thanks for finding this.
Maybe we can add a distinct wrapper for float/double log (flog?, dlog?)
We already do this for other Math wrappers.
A bit embarassed we missed this. I am out of office for a week or so, but will
look at this again next week.
Original comment by frost.g...@gmail.com
on 26 Oct 2011 at 1:48
I was just about to work on this when I read the code again.
Kernel code should not call Math.log(float || double) it should use the
Kernel.log(float||double) method. This method will then delegate to the
correct Math.log(float||double) or OpenCL log(float||double).
So your example should use:
public class LogKernel extends Kernel {
private float[] data;
private int offset;
@Override public void run(){
int i= getGlobalId();
data[offset+i]=log(data[offset+i]);
}
}
And should not require double support.
Original comment by frost.g...@gmail.com
on 3 Nov 2011 at 2:35
For the moment I am re-assigning this to WontFix. Until I hear back from the
bug reporter.
Original comment by frost.g...@gmail.com
on 3 Nov 2011 at 2:37
Ah, I had not found that function. (Actually I did, but I assumed it had
something to do with logging).
I think that solution is fine, as it would be a impossible to determine if the
compiler had auto-converted to float or the user wanted to use a double.
Original comment by kenneth@hexad.dk
on 7 Nov 2011 at 11:44
Original issue reported on code.google.com by
kenneth@hexad.dk
on 25 Oct 2011 at 9:19