<div dir="ltr">Hello OpenMP dev,<div><br></div><div>Our deviceRTL has a collection of per-workgroup variables in omp_data. Mostly integers, a couple of classes. These are __shared__ and at program scope. It's great that they're all in a single source file. I am seeking suggestions on how to make this work on OpenCL.</div><div><br></div><div>- This works on nvptx. I'm quite impressed by that.</div><div>- On OpenCL, we can use __local, but that doesn't compile. Local variables can't be at program scope, and they can't have constructors. Primitive types only</div><div>- In HIP, the branch I use implements this by inlining everything. Trunk HIP doesn't support file scope shared variables yet. I could be persuaded it never should.</div><div><br></div><div>I'm therefore interested in moving these __shared__ variables out of program scope. Possibly to a function local variable at the top of the device side call tree, passed down to the functions that use it by pointer. Better ideas are very welcome - this feels like a problem opencl devs will have run into before.</div><div><br></div><div></div><div>Thanks!<br></div><div><br></div><div>Jon</div><div><br></div><div>Closely related, workgroup scope memory is fast and therefore scarce, so longer term it would be nice to specialise kernels based on which parts of this state they actually use. Without just inlining everything.<br></div></div>