So this padding is so that if we have (say) two threads, and declare
````c
T foo_l[2][padding_size]
```
we arrange for `foo_l[0][...]` and `foo_l[1][...]` to live on different cache lines, right?  That means we need:

````c
addressof(foo_l[1][0]) - addressof(foo_l[0][0])
````
to be greater than or equal to 64 bytes (on most CPUs), 128 bytes on Xeon Phis.  So I think, this 'dim' argument wants to be:
````python
self.padding(self.data.cdim) * (_padding / self.data.dtype.itemsize)
````

So that if the global is a float32 we generate with cdim=1.

so perhaps write the padding function as
````python
def padding(self):
    return int(_padding * (self.data.cdim / _padding + 1) * _padding / self.data.dtype.itemsize)
````

````c
float foo_l[2][16]
````
whereas if it has type float64 we generate
````c
double foo_l[2][8]
````

Currently, we'd generate `foo_l[2][8]` in both cases, which would still result in false sharing in the float32 case.