[PATCH] [NVPTX] noop when kernel pointers are already global

Tobias Grosser tobias at grosser.es
Tue Jun 30 09:30:00 PDT 2015


On 06/30/2015 06:26 PM, Justin Holewinski wrote:
> Hi Tobias,
>
> One thing to keep in mind is that the CUDA interface expects kernel parameters to be in the generic address space.  If you write kernels that pass arguments as global memory pointers, you are technically violating the contract between host and device.  Now, this just so happens to work since the global->generic and generic->global pointer conversions are no-ops, but as far as I know this is not actually guaranteed and may not be true in the future.

Interesting. Then maybe the right solution is not to allow this, but 
rather to give a proper error message in the backend (instead of just 
crashing)?

Tobias



More information about the llvm-commits mailing list