cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

gchudov
Journeyman III

OpenCL compiler glitch?

A very simple code produces unexpected results

Kernel which includes this code produces the following output:

k[0] = 3
k[1] = 3
k[2] = 2
k[3] = 2
k[4] = 1
k[5] = 1
k[6] = 1
k[7] = 1
k[8] = 0

Note that k[0] should have been 4.

Platform ID:                                   00000000012B3568
Name:                                          Cedar
Vendor:                                        Advanced Micro Devices, Inc.
Driver version:                                CAL 1.4.739
Profile:                                       FULL_PROFILE
Version:                                       OpenCL 1.1 ATI-Stream-v2.2 (302)

 

int k = 0; for (int sh = 3; sh >= 0; sh --) { if (get_local_id(0) < (1 << sh)) k ++; } if (get_local_id(0) <= 😎 printf("k[%d] = %d\n", get_local_id(0), k);

0 Likes
2 Replies
karbous
Journeyman III

I wonder, what would be the result (1 << 0) on your graphic card? On CPU with OpenCL 1.1 Ati-Stream-v2.2 the code runs as expected and k[0] is 4.

0 Likes

hi gchudov,

Thanks for reporting the issue.I also find the same results on my juniper.You can send a test case at streamdeveloper@amd.com.

0 Likes