You cannot modify code memory other than to insert a “breakpoint” which you won’t see when reading the code memory. You will only see that execution has stopped. The CUDA Debugger API does not support arbitrary code modification or binary instrumentation, it is merely for run control and inspection, exactly what a debugger does. We do not plan to allow this kind of patching in the near future.