cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

viscocoa
Adept I

local memory address starts 0

I am not sure how OpenCL specification regulates this, but in the current AMD implementation 0 is a valid local address. I think the address 0 or NULL pointer should be reserved, since a GPU has 32k, a pretty large, local memory, so that we can use the same code for CPU, like:

If (ptr)

   ptr = ptr->next;

Just a fancy idea

0 Likes
1 Solution

viscocoa,

This is technically invalidundefined code. Since 0 is a valid address, you must compare against NULL directly and not just check the value of the pointer against 0 as NULL is not guaranteed to be zero. This is a problem with OpenCL in general and something that the Khronos group needs to fix.

View solution in original post

0 Likes
2 Replies

viscocoa,

This is technically invalidundefined code. Since 0 is a valid address, you must compare against NULL directly and not just check the value of the pointer against 0 as NULL is not guaranteed to be zero. This is a problem with OpenCL in general and something that the Khronos group needs to fix.

0 Likes

thank you micah!

0 Likes