Hello all,
I would like to ask for a help with access violation while running application. Building the OpenCL code in function:
cl_int status = clBuildProgram(program, devicesCount, devices, options, NULL, NULL);
generates Unhandled exception at 0x692EE6FA (aticaldd.dll) in sylog.exe: 0xC0000005: Access violation writing location 0x00000008.
When line
removed++; //BUG ?!?
is commented out, the application runs correctly.
OpenCL program:
__kernel void Equation( __constant int* neqs,
__global int* nsolsvars,
__global int* solsvars,
__constant int* matrixnvars,
__global int* matrix,
__global int* tmpMem,
__global int* outNsolsvars,
__global int* outSolsvars,
__global int* newBanCounts)
{
uint tid = get_global_id(0);
if(tid >= *neqs)
return;
int* _sols;
int* _vars;
int* pSol;
__global int* banned;
__global int* toRemove;
int removed = 0;
int iban = -2;
__global int* banptr;
__global int* _Xn;
__global int* _Yn;
removed++;
removed--;
// Parse nsolsvars
int _nsols = nsolsvars[tid*2];
int _nvars = nsolsvars[(tid*2)+1];
// Parse solsvars
int solsvarsOffset = 0;
for (int i = 0; i < tid; i++)
solsvarsOffset += (nsolsvars[2*i] * nsolsvars[(2*i)+1]) + nsolsvars[(2*i)+1];
_vars = solsvars[solsvarsOffset];
_sols = solsvars[solsvarsOffset + _nvars];
// Parse tmpMem: Assign pointer's address at allocated memory: banned, toRemove, _Xn, _Yn
int tmpMemOffset = 0;
for(int i = 0; i < tid; i++)
tmpMemOffset += nsolsvars[2*i] + (4*nsolsvars[(2*i)+1]*nsolsvars[(2*i)+1]) + (2*(2*(*matrixnvars) + 1));
toRemove= tmpMem + tmpMemOffset + 0;
banned = tmpMem + tmpMemOffset + _nsols;
_Xn = tmpMem + tmpMemOffset + _nsols + (4*_nvars*_nvars);
_Yn = tmpMem + tmpMemOffset + _nsols + (4*_nvars*_nvars) + (2*(*matrixnvars) + 1);
for(int i = 0; i < 4*_nvars*_nvars; i++)
banned = -1;
pSol = _sols;
for (int sol = 0; sol < _nsols; sol++, pSol+=_nvars)
{
toRemove[sol] = 0;
for (int i = 0; toRemove[sol] == 0 && i < _nvars; i++)
{
banptr = banned + i * (_nvars+1) * 4 + 2*pSol;
for (int j = i; j < _nvars; j++, banptr+=4)
{
if (banptr[pSol
{
removed++; //BUG ?!?
}
}
}
if(removed > 0)
return;
//TODO: ...
}
}
//---------------------------------------------------------------------------
Configuration
Win7 x64
Catalyst Version: 12.7
Catalyst Control Center Version: 2012.0704.122.388
StreamSDK v2.8 win64
//---------------------------------------------------------------------------
1. Do I missing something, or is it a bug?
Install the latest Catalyst - 13.1 http://support.amd.com/us/gpudownload/windows/Pages/radeonaiw_vista64.aspx