These functions are here called with int arguments, but the accept only floating point arguments. The compiler has to convert the type of the argument. I don't know off-hand what rules it should apply for that -- probably convert to double if available, otherwise to float. It seems the compiler also sees the possible vector arguments, and then considers this conversion ambiguous, although it actually isn't.
If this is indeed wrong in pocl, then the type conversion or argument matching rules on clang need to be adapted. We could instead also provide int prototypes for all scalar math functions, although this is probably against the language standard. As a work-around, the example could use double precision arguments, as in 16.0 and 2.0. For the 0.8 release, this seems the only workable approach. Apart from this: the example should really use clz and << instead of log2 and pow: log2(16) = 31-clz(16) pow(2,i) = 1<<i -erik On 2013-07-18, at 8:16 , Jianbin Fang - EWI <[email protected]> wrote: > Hi, > > Now I am testing pocl (v0.8) with Rodinia benchmark suite. I tried to > compile and run the {backprop} in Rodinia. > > This benchmark {backprop} is using {CL_DEVICE_TYPE_GPU} in default (see line > 115 of backprop_ocl.cpp), so we need to change it manually. After changing it > to the CPU type, it then encountered the kernel compiling error as follows. > When looking into the kernel backprop_kernel.cl, I found that the kernel > tries to call two functions: log2() and pow(). Since I know that these two > functions are the build-in function of OpenCL specification, I guess there > might be something wrong with the implementation? > > Regards, > > Jianbin > > > --------------------------------------------------------------------------------------------------------- > > /tmp/pocl8caZIf//program.cl:40:28: error: call to '_cl_log2' is ambiguous > for ( int i = 1 ; i <= _cl_log2(16) ; i++){ > > ---- > /tmp/pocl8caZIf//program.cl:42:22: error: call to '_cl_pow' is ambiguous > int power_two = _cl_pow(2, i); > ^~~~~~~ > > --------------------------------------------------------------------------------------------------------- > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > pocl-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/pocl-devel -- Erik Schnetter <[email protected]> http://www.perimeterinstitute.ca/personal/eschnetter/ My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://keys.gnupg.net. ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ pocl-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pocl-devel
