cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

evanzzz
Journeyman III

Dig out memory usage by using CodeXL

Hi there,

I am new CodeXL, and I was wondering is there anyway by using it to dig out the memory usage of the kernel.

The memory usage section in the debugger here only indicate the memory usage by the buffer.

Basically I declare an array in the kernel, like

float array[100];

By default this array pointer would be placed in the private memory of each work-item.

But what about the data chunk? Where did they put this data chunk.

Are they kept in the private memory or spilled into other sort of memory?

Is there anyway that might help me to dig this out?

Thanks.

Evan

0 Likes
1 Reply
maxdz8
Elite

float array[100];

This is not an "array pointer" as there's no such thing. This is an array declaration and will go around your code with a tag attached: shall you access say [100] you should get an out of bounds.

An array is an array. Your confusion likely arises from the fact it will become a pointer at the earliest convenience.

Back to your point.

If you use this array in a fully predictable way (say, based on a loop index from a unrollable loop) odds are this array won't exist. The compiler might inline it in instruction immediates. Or not. It really depends on a case by case. If the addressing is complicated, it will overspill to some memory (usually global) to support the relative addressing.

So the best thing to do is to try the static analyzer or even better, profile the running program (as the driver might give different results).

0 Likes