Ask Your Question
1

cl_out_of_host_memory

asked 2015-03-09 22:53:41 -0500

Shabuddin Shaik gravatar image

Hi,

I am running opencv test suite with opencl on qualcomm 800 series 8074 board (android ), for some test clBuildProgram is returning CL_OUT_OF_HOST_MEMORY error. unable to find out the exact reason, can any one help me in finding out the exact reason for this issue and so that i can be able to find out solution for it.

Thanks, Shabuddin.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-04-09 01:08:01 -0500

Shabuddin Shaik gravatar image

updated 2015-04-09 01:11:05 -0500

berak gravatar image

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 256
#define LSIZE_1 255
#define LSIZE_2 254
#define HF_LSIZE 128
#define LOG_LSIZE 8
#define LOG_NUM_BANKS 5
#define NUM_BANKS 32
#define GET_CONFLICT_OFFSET(lid) ((lid) >> LOG_NUM_BANKS)

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-03-09 22:53:41 -0500

Seen: 393 times

Last updated: Apr 09 '15