My OpenCL program involves having about 7 billion work-items. In my C++ program, I would set this to my global\_item\_size:

```
size_t global_item_size = 7200000000;

```

If my program is compiled to 64-bit systems (x64), this global size is OK, since SIZE\_MAX (the maximum value of size\_t) is much larger than 7 billion. However, to ensure backwards compatibility I want to make sure that my program is able to compile to 32-bit systems (x86). On 32-bit systems, SIZE\_MAX is about 4 billion, less than my global size, 7 billion. If I would try to set the global size to 7 billion, it would result in an overflow. What can I do in this case?

One of the solutions I was thinking about was to make a multi-dimensional global size and local size. However, this solution requires the kernel to calculate the original global size (because my kernel heavily depends on the global and local size), which would result in a performance loss.

The other solution I considered was to launch multiple kernels. I think this solution would be a little "sloppy" and synchronizing kernels also wouldn't be the best solution.

So my question basically is: **How can I (if possible) make the global size larger than the maximum size of size\_t? If this is not possible, what are some workarounds?**
['https://Stackoverflow.com/questions/62804224', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6702334/']
`proc_res_field` doesn't know anything about `i` or `a`

```
Function proc_res_field(Tstruct As TestMDate)
    Debug.Print Tstruct.MonthS
    Debug.Print Tstruct.MonthD
    Debug.Print Tstruct.StartD
    Debug.Print Tstruct.EndD
    proc_res_field = 1 '?
End Function

```
It is a common error, I forgot it too, but functions return something.

```
Function proc_res_field(Tstruct As TestMDate) as integer

   proc_res_field=7

End Function

```

And at the call:

```
a=proc_res_field(your_tstruct)

```

Just as example, setup the correct params and return types that you want to use.