Hello Everyone !
My code is as follows.
******* host code******
//some declarations
cl_mem Curr_domain = NULL;
cl_mem dMobj = NULL;
//created check, AvgBlk of type structure domainBlock
// now creating buffers for above datatypes
dMobj = clCreateBuffer(context, CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR, dCount * sizeof(struct domainBlock), AvgBlk, &ret);
Curr_domain = clCreateBuffer(context, CL_MEM_READ_WRITE, dCount *sizeof(struct domainBlock), check, &ret);
//passed these 2 objects to the kernel
******* kernel code******
__kernel void calculateRms( __global struct domainBlock* dMobj, __global struct domainBlock* Curr_domain )
{
int l = get_global_id(0);
int i=0;
int iType=0;
for(iType =0; iType<8;iType++)
{
if(iType==0)
{
Curr_domain = dMobj;
}
}
}
This gives me build failure error!
But if I initialize Curr_domain = dMobj; before the loop it won’t. But I want to do this for 6 more times.
So how can I fix this issue?
I’m using Intel® HD Graphics 4000 for executing this program.