diff --git a/loopy/type_inference.py b/loopy/type_inference.py
index 6ffc1dff5220ab48c6c87ec29fec6e44d57ba133..0f58ae64e1789ebe9b9b5ca37a3f7dae534e0a2a 100644
--- a/loopy/type_inference.py
+++ b/loopy/type_inference.py
@@ -588,6 +588,9 @@ def infer_unknown_types(kernel, expect_completion=False):
             failed = not result
             if not failed:
                 new_dtype, = result
+                if new_dtype.target is None:
+                    new_dtype = new_dtype.with_target(kernel.target)
+
                 debug("     success: %s", new_dtype)
                 if new_dtype != item.dtype:
                     debug("     changed from: %s", item.dtype)