That error can come up for many different reasons, not to mention that if this was the case it would also crash on other cards which do have support for 32bit.
>>...That error can come up for many different reasons...
Of course it could and that is why any processsing, benchmarking in that case, needs to be done after a set of verifications.
In
OpenCL programming world the set of verifications need to be completed during initialization and This is how it looks like in my codes:
...
iOk =
OclGetDeviceInfo( clDeviceId[ uiCurrentDevice ],
CL_DEVICE_MAX_COMPUTE_UNITS,
sizeof( CLuint ), ( CLvoid * )&ulPropValue, &uiRetValue );
OclPrintf2( OTU("\t\
tCL_DEVICE_MAX_COMPUTE_UNITS : %12u\n"), ( CLuint )ulPropValue );
...
iOk =
OclGetDeviceInfo( clDeviceId[ uiCurrentDevice ],
CL_DEVICE_MAX_MEM_ALLOC_SIZE,
sizeof( CLulong ), ( CLvoid * )&ulPropValue, &uiRetValue );
OclPrintf2( OTU("\t\
tCL_DEVICE_MAX_MEM_ALLOC_SIZE: %12.0f bytes\n"), ( CLfloat )ulPropValue );
...
iOk =
OclGetDeviceInfo( clDeviceId[ uiCurrentDevice ],
CL_DEVICE_GLOBAL_MEM_SIZE,
sizeof( CLulong ), ( CLvoid * )&ulPropValue, &uiRetValue );
OclPrintf2( OTU("\t\
tCL_DEVICE_GLOBAL_MEM_SIZE : %12.0f bytes\n"), ( CLfloat )ulPropValue );
...
iOk =
OclGetDeviceInfo( clDeviceId[ uiCurrentDevice ],
CL_DEVICE_LOCAL_MEM_SIZE,
sizeof( CLulong ), ( CLvoid * )&ulPropValue, &uiRetValue );
OclPrintf2( OTU("\t\
tCL_DEVICE_LOCAL_MEM_SIZE : %12.0f bytes\n"), ( CLfloat )ulPropValue );
...
In my
OpenCL codes as soon as these steps completed some Run-Time values updated and
Only After That processing continues.
It is very important to pay attention to all memory size related values because they are different for
32-bit and
64-bit OpenCL drivers for an
OpenCL platform!
32-bit memory related values are
usually lower than
64-bit values for
the OpenCL platform.
As I've already mentioned the
OpenCL device initialization is a Multi-Step process and memory is allocated
after all these steps successfully completed:
...
iOk =
OclGetPlatformIDs( 0, RTnull, &uiNumOfPlatforms );
if( iOk !=
CL_SUCCESS )
break;
if( uiNumOfPlatforms > _RTNUMBER_OF_PLATFORMS )
break;
iOk =
OclGetPlatformIDs( uiNumOfPlatforms, &clPlatformId[0], RTnull );
if( iOk !=
CL_SUCCESS )
break;
iOk =
OclGetPlatformInfo( clPlatformId[ iPlatformId ], CL_PLATFORM_NAME, 64, &g_szPlatformName[0], RTnull );
if( iOk !=
CL_SUCCESS )
break;
OclPrintf2( OTU("\tPlatform Name : %s\n"), &g_szPlatformName[0] );
iOk =
OclGetDeviceIDs( clPlatformId[ iPlatformId ], iDeviceType, 1, &clDeviceId, RTnull );
if( iOk !=
CL_SUCCESS )
{
OclPrintf2( OTU("\tDevice of selected type is Not supported: %d\n"), iOk );
break;
}
iOk =
OclGetDeviceInfo( clDeviceId, CL_DEVICE_NAME, 64, &g_szDeviceName[0], RTnull );
if( iOk !=
CL_SUCCESS )
break;
RTint n = 0;
while( g_szDeviceName[n] == ' ' )
n += 1;
OclPrintf2( OTU("\tDevice Name : %s\n"), &g_szDeviceName[n] );
clContext =
OclCreateContext( RTnull, 1, &clDeviceId, RTnull, RTnull, &iOk );
if( iOk !=
CL_SUCCESS )
break;
if( clContext == RTnull )
break;
CLCommandQueueProperties clQueueProps = 0;
clQueueProps |=
CL_QUEUE_PROFILING_ENABLE;
clCommandQueue =
OclCreateCommandQueue( clContext, clDeviceId, clQueueProps, &iOk );
if( iOk !=
CL_SUCCESS )
break;
if( clCommandQueue == RTnull )
break;
clProgram =
OclCreateProgramWithSource( clContext, 1, &szKernelFunction02I, RTnull, &iOk );
if( iOk !=
CL_SUCCESS )
break;
if( clProgram == RTnull )
break;
iOk =
OclBuildProgram( clProgram, 1, &clDeviceId, RTnull, RTnull, RTnull );
if( iOk !=
CL_SUCCESS )
break;
clKernel =
OclCreateKernel( clProgram, "KernelMemSetI", &iOk );
if( iOk !=
CL_SUCCESS )
break;
if( clKernel == RTnull )
break;
if( iDataSetSize == 0 )
break;
piDataSet1 = ( CLint * )CrtMalloc( iDataSetSize * sizeof( CLint ) );
if( piDataSet1 == RTnull )
break;
for( i = 0; i < iDataSetSize; i += 1 )
piDataSet1
= 0;
...
I remember that error
CL_OUT_OF_RESOURCES ( -5 ) was always related to an attempt to allocate the device memory that exceeds numbers for
CL_DEVICE_MAX_MEM_ALLOC_SIZE, or
CL_DEVICE_GLOBAL_MEM_SIZE, or
CL_DEVICE_LOCAL_MEM_SIZE params.