Open GoogleCodeExporter opened 9 years ago
It is also worth noting that the value returned is contingent on the array's
datatype. When test[] is a double[], .length returns: -1.34217543E8.
Original comment by adri...@caloiaro.com
on 26 Mar 2014 at 2:54
Interesting.
This code returns 100 for me as expected. On two platforms.
Are you running with -D-UseCompressedOops ?
Basically the length of an array is a field of the instance and it's offset
changes based on whether you are using compressed oops or not.
Can you send me the HSAIL output by setting
-Dcom.amd.aparapi.enableShowGeneratedHSAIL=true
Mine looks like this....
version 0:95: $full : $large;
kernel &run(
kernarg_u64 %_arg0,
kernarg_s32 %_arg1
){
ld_kernarg_u64 $d0, [%_arg0];
ld_kernarg_s32 $s1, [%_arg1];
workitemabsid_s32 $s2, 0;
// 0000_0000 aload_0 var#0(oref_0 [I)
add_s32 $s1, $s1, $s2;
mov_b64 $d2, $d0;
// 0000_0001 iconst_0.0
mov_b32 $s3, 0;
// 0000_0002 aload_0 var#0(oref_0 [I)
mov_b64 $d4, $d0;
// 0000_0003 arraylength
ld_global_s32 $s4, [$d4+16];
// 0000_0004 iastore
cvt_u64_s32 $d3, $s3;
mad_u64 $d3, $d3, 4, $d2;
st_global_s32 $s4, [$d3+24];
// 0000_0005 return
ret;
};
Original comment by frost.g...@gmail.com
on 26 Mar 2014 at 7:47
Thank you once again, Gary. This also cleared up the other issue that I was
reluctant to post about until I tested more thoroughly: indexing into an
Object[] array and getting very unexpected results!
Original comment by adri...@caloiaro.com
on 26 Mar 2014 at 7:57
So -D-UseCompressedOops=false worked?
Nice.
Actually I though that Aparapi would dump an error message if this was not set.
Let me check that code.
Gary
Original comment by frost.g...@gmail.com
on 26 Mar 2014 at 9:46
Original issue reported on code.google.com by
adri...@caloiaro.com
on 26 Mar 2014 at 2:49