This project is read-only.

error: more than one instance of overloaded function "abs" matches the argument list

Jun 4, 2014 at 7:37 AM
Edited Jun 4, 2014 at 7:41 AM
Hi Nick,
This is a follow on question from the previous problem. Once again it is working on my nvidia card, then I try it on the AMD card and get the above error.

I get this error at the line:
gpu[i].LoadModule(km, true);
Obviously the "abs" it refers to is converted from where I call GMath.Abs() within my c# code.

The full error looks like this:
      more than one instance of overloaded function "abs" matches the argument list:
        function "abs(char) C++"
        function "abs(char2) C++"
        function "abs(char3) C++"
        function "abs(char4) C++"
        function "abs(char8) C++"
        function "abs(char16) C++"
        function "abs(uchar) C++"
        function "abs(uchar2) C++"
        function "abs(uchar3) C++"
        function "abs(uchar4) C++"
        function "abs(uchar8) C++"
        function "abs(uchar16) C++"
        function "abs(short) C++"
        function "abs(short2) C++"
        function "abs(short3) C++"
        function "abs(short4) C++"
        function "abs(short8) C++"
        function "abs(short16) C++"
        function "abs(ushort) C++"
        function "abs(ushort2) C++"
        function "abs(ushort3) C++"
        function "abs(ushort4) C++"
        function "abs(ushort8) C++"
        function "abs(ushort16) C++"
        function "abs(int) C++"
        function "abs(int2) C++"
        function "abs(int3) C++"
        function "abs(int4) C++"
        function "abs(int8) C++"
        function "abs(int16) C++"
        function "abs(uint) C++"
        function "abs(uint2) C++"
        function "abs(uint3) C++"
        function "abs(uint4) C++"
        function "abs(uint8) C++"
        function "abs(uint16) C++"
        function "abs(long) C++"
        function "abs(long2) C++"
        function "abs(long3) C++"
        function "abs(long4) C++"
        function "abs(long8) C++"
        function "abs(long16) C++"
        function "abs(ulong) C++"
        function "abs(ulong2) C++"
        function "abs(ulong3) C++"
        function "abs(ulong4) C++"
        function "abs(ulong8) C++"
        function "abs(ulong16) C++"
        argument types are: (float)
            num19 = Ifb(num19 == 0.0f, abs(num18), 0.9f * num19 + 0.1f * abs(num18));
                                       ^


Any ideas here?
thanks
Ben
Jun 6, 2014 at 7:52 PM
Hi
None of those seem to accept a float arg, which is odd. That's why you get the error, btw.
Jun 6, 2014 at 10:18 PM
I didn't even notice that, thanks.
For now I've written my own fabs fn, and calling that.
Is that something to be added to Cudafy, or is it in the underlying OpenCL layer?