Brahma.FSharp icon indicating copy to clipboard operation
Brahma.FSharp copied to clipboard

Ambiguous call of OpenCL math functions in some cases

Open dpanfilyonok opened this issue 3 years ago • 1 comments

Describe the bug OpenCL's compilation fails with error: call to 'max' is ambiguous on kernel

<@
    fun (range: Range1D) (buf: int16 clarray) ->
        buf.[0] <- max buf.[0] 1s
@>

which translates to

__kernel void brahmaKernel (__global short * buf)
{buf [0] = max (buf [0], 1) ;}

Expected behavior Compilation is successful.

dpanfilyonok avatar Jan 02 '22 22:01 dpanfilyonok

Looks like we should carefully translate constant literals.

gsvgit avatar Jan 03 '22 10:01 gsvgit