1 | initial version |
Hi,
I found the reason for this issue, but still i have some doubts,first i will explain how i got this issue solved, later i will point out my doubt.
1) I was getting this issue when clbuildprogram is being called by passing program object, this program object is created using clcreateprogramwithsource, and the source being passed to this is having four kernel functions.
2) In the file where those kernel functions are present some macros are there, those macros are as follows:
3) Based on these macros, in each kernel function they are creating local variables as shown below. __local int4 lm_sum[2][LSIZE + LOG_LSIZE]; __local float4 lm_sqsum[2][LSIZE + LOG_LSIZE]; __local int* sum_p; __local float* sqsum_p;
4) that means total size of 0.5MB(540704B) is being allocated in local memory region, i have changed macros such a way that, total local memory being used by 4 kernel functions became 0.1MB(131104B), and with this change the issue CL_OUT_OF_HOST_MEMORY got cleared.
i understood that this issue is because of local memory, but my doubt is that, when i queried for local memory device is having it showed as it is having only 8kB, then why i got problem with 0.5MB local memory, and why the same is not happening with 0.1MB, how it is managing, can any one explain me this.
Thanks, Shabuddin.
2 | No.2 Revision |
Hi,
I found the reason for this issue, but still i have some doubts,first i will explain how i got this issue solved, later i will point out my doubt.
1) I was getting this issue when clbuildprogram is being called by passing program object, this program object is created using clcreateprogramwithsource, and the source being passed to this is having four kernel functions.
2) In the file where those kernel functions are present some macros are there, those macros are as follows:
#define
LSIZE 3) Based on these macros, in each kernel function they are creating local variables as shown below.
below.
__local int4 lm_sum[2][LSIZE + LOG_LSIZE];
__local float4 lm_sqsum[2][LSIZE + LOG_LSIZE];
__local int* sum_p;
__local float* sqsum_p;sqsum_p;
4) that means total size of 0.5MB(540704B) is being allocated in local memory region, i have changed macros such a way that, total local memory being used by 4 kernel functions became 0.1MB(131104B), and with this change the issue CL_OUT_OF_HOST_MEMORY got cleared.
i understood that this issue is because of local memory, but my doubt is that, when i queried for local memory device is having it showed as it is having only 8kB, then why i got problem with 0.5MB local memory, and why the same is not happening with 0.1MB, how it is managing, can any one explain me this.
Thanks, Shabuddin.