Pointer type checking on buffer var breaks buffer type casting

We are catching up on upstream development in our local repo, and we ran into an issue: pointer annotation on buffer variables blocks buffer type casting. See Type casting a buffer for more details. In short, given a buffer of one data type, we want to be able to access it using different data types. What we do is that we create a new buffer (via decl_buffer), and use the same buffer variable, but with different data type.

How can we get this to work with the annotations in place?

Have you found a solution to this? I am having the same trouble. Much appreciated!

Same problem. Can someone help with this?

Sorry, I don’t really understand the problem. It would be great if you can give some more explanation and even an example showing what do you want and what’s the problem.

Because we want to manipulate the buffer by ourselves rather than relay on the pass storage rewrite. In my case, buffer reuse is tough to analysis because of extern calls. So when we write the kernel with dynamic inputs, a common method is to allocate the buffer with maximum size, then add the offset during the computation. But when you encounter a case in which data type is different, you have to cast that full -size buffer into another data type.