memory problem

Hello experts,

i am new in OpenCL programing and until now everything worked fine.

In my kernel i need to set up a double array with 10k elements. The code compiles fine but I get the runtime error CL_OUT_OF_HOST_MEMORY.

The needed memory of the array should be ~80kB if I calculated it right. The local memory of my device is 16kB, global 4GB (Tesla 1060).

Does OpenCL allocate the memory of a work item in the global or in the local address space and if it allocates in local space, is it possible to do this in global space but private for each work item? The following source code is the part of the kernel I am working on, the array which causes the problem named Matrix:

[codebox]const char * spai =

"#pragma OPENCL EXTENSION cl_khr_fp64: enable\n"

"__kernel void spai(\n"

"          __global const size_t * A_RowIndices,\n"

"          __global const size_t * A_Columns, \n"

"          __global const double * A_Values,\n"

"          __global double * M_Values,  \n"

"          __global double * help,  \n"

"          unsigned int size) \n"

"{ \n"

"  const size_t MaxIterates = 300;\n"

"  double Matrix[10000];\n"

"  size_t Idx, i_begin, i_end, j_begin, j_end, n;\n"

"  for (Idx = get_global_id(0); Idx < size; Idx += get_global_size(0))\n"

"  {\n"

"    i_begin = A_RowIndices[Idx];\n"

"    i_end = A_RowIndices[Idx + 1];\n"

"    n = i_end - i_begin;\n"

"    for ( size_t i1 = i_begin; i1 < i_end; i1++ )\n"

"    {\n"

"      size_t j = A_Columns[i1];\n"

"      j_begin = A_RowIndices[j];\n"

"      j_end = A_RowIndices[j + 1];\n"

"      for ( size_t i2 = i_begin; i2 < i_end; i2++ )\n"

"      {\n"

"        Matrix[ ( i1 - i_begin ) * n + ( i2 - i_begin ) ] = 0.00;\n"

"        for ( size_t i3 = j_begin; i3 < j_end; i3++ )\n"

"	     {\n"

"          if ( A_Columns[i3] == A_Columns[i2] )\n"

"          {\n"

"            //if ( (( i1 - i_begin ) * n + ( i2 - i_begin )) > help[0] ) \n"

"               //help[0] = ( i1 - i_begin ) * n + ( i2 - i_begin ); \n"

"            Matrix[ ( i1 - i_begin ) * n + ( i2 - i_begin ) ] = A_Values[i3];\n"

"            break;\n"

"          }\n"

"        }\n"

"      }\n"

"      //if ( j == Idx)\n"

"      //B[i1 - i_begin] = 1.00;\n"

"      //else\n"

"      //B[i1 - i_begin] = 0.00;\n"

"    }\n"

"  }\n"

"};\n";[/codebox]

Thank You

Marco E.