Fixed compilation while using the old compiler
authorbsegovia <devnull@localhost>
Tue, 29 Nov 2011 05:01:22 +0000 (05:01 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:15:06 +0000 (16:15 -0700)
src/cl_kernel.c

index 4b67d7d..8f77ebb 100644 (file)
@@ -364,12 +364,22 @@ cl_kernel_setup_patch_list(cl_kernel k, const char *patch, size_t sz)
           arg_info->offset = from->offset;
           arg_info->type = OCLRT_ARG_TYPE_CONST;
         }
+#if USE_OLD_COMPILER
+        else if (item->token == PATCH_TOKEN_IMAGE_MEMORY_KERNEL_ARGUMENT) {
+          cl_global_memory_object_arg_t *from = (cl_global_memory_object_arg_t *) patch;
+          arg_info->arg_index = from->index;
+          arg_info->offset = from->offset;
+          arg_info->type = OCLRT_ARG_TYPE_IMAGE;
+        }
+#else
         else if (item->token == PATCH_TOKEN_IMAGE_MEMORY_KERNEL_ARGUMENT) {
           cl_image_memory_object_arg_t *from = (cl_image_memory_object_arg_t *) patch;
           arg_info->arg_index = from->index;
           arg_info->offset = from->offset;
           arg_info->type = OCLRT_ARG_TYPE_IMAGE;
-        } else
+        }
+#endif
+        else
           assert(0);
 
         arg_info->sz = sizeof(cl_mem);