diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py
index a78d7dfeaa8d9393d2000d57ce8a78973d177916..e0fdb7c806e80067fae2d0fc0faedb6171659d7d 100644
--- a/pyopencl/algorithm.py
+++ b/pyopencl/algorithm.py
@@ -628,7 +628,7 @@ class ListOfListsBuilder:
 
         from pyopencl.algorithm import ListOfListsBuilder
         builder = ListOfListsBuilder(context, [("mylist", np.int32)], \"\"\"
-                void generate(USER_ARG_DECL LIST_ARG_DECL index_type i)
+                void generate(LIST_ARG_DECL USER_ARG_DECL index_type i)
                 {
                     int count = i % 4;
                     for (int j = 0; j < count; ++j)