Kalle,

I see.

So the root cause is the discrepancy of sizeof(long) between C and 
OpenCL on PPC/ARM/etc.

Just a quick thought, how about using "long long" type to replace "long" 
for OpenCL on 32b platform(s) only?

I checked, on Ubuntu/ARM, long long is 8 byte.
The apparent part that needs to fix is string format: %d vs. %lld, etc.
Do people like this idea?

This is not an elegant solution, but may work in the short term.

Pekka's "slong" type didn't seem to make into pocl-0.8rc8 tree.

Can you post me to the place where configuration fails and disables 
support for int64_t and double?

Thank you

Chuck

On 7/30/2013 12:03 PM, Kalle Raiskila wrote:
> On 30.07.2013 19:57, Chuck Zhao wrote:
>> So, what was the root cause that POCL didn't support long/double on ARM?
> I *think* the root cause was a confusion in clang and/or pocl on
> platforms where (in C) sizeof(long)==4. C specifies 'long' to be no
> shorter than 'int'. Opencl specifies 'long' as 8-bytes. Pocl assumes
> somewhere that sizeof(long)==8.
>
> This, and the fact that all platforms with sizeof(long)==4 not being the
> main focus of anybody's work :)
>
>
> Actually, a quick test (below) shows this is a clang bug: on x86 and
> PPC32, the value returned below is 4, on x86_64 (and PPC64) it is 8. I
> don't have my ARM board to test with right now, but I bet it would
> return 4, too. This is with LLVM 3.3.
>
> $ cat test.cl
> int foo()
> {
>       return sizeof(long);
> }     
>
> $ clang -x cl test.cl -S -emit-llvm -o -
> ; ModuleID = 'test.cl'
> target datalayout =
> "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
> target triple = "i386-pc-linux-gnu"
>
> define i32 @foo() nounwind readnone {
> entry:
>     ret i32 4
> }
>
>
> kalle
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> _______________________________________________
> pocl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pocl-devel
>


------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel

Reply via email to