From 0b25bed13e1e4e01b1afaa431f83b97c921a81b4 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 2 Mar 2016 08:12:16 +0800 Subject: Backend: Add Pipe Builtin support Add pipe builtin functions. v2: Refine type size to be system determined. v3: Remove legacy code. Signed-off-by: Pan Xiuli Reviewed-by: Yang Rong --- src/cl_command_queue.c | 5 ++++- src/cl_kernel.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cl_command_queue.c b/src/cl_command_queue.c index c16c6ac5..5d527152 100644 --- a/src/cl_command_queue.c +++ b/src/cl_command_queue.c @@ -161,7 +161,10 @@ cl_command_queue_bind_surface(cl_command_queue queue, cl_kernel k, cl_gpgpu gpgp for (i = 0; i < k->arg_n; ++i) { int32_t offset; // location of the address in the curbe arg_type = interp_kernel_get_arg_type(k->opaque, i); - if (!(arg_type == GBE_ARG_GLOBAL_PTR || (arg_type == GBE_ARG_CONSTANT_PTR && ocl_version >= 200)) || !k->args[i].mem) + if (!(arg_type == GBE_ARG_GLOBAL_PTR || + (arg_type == GBE_ARG_CONSTANT_PTR && ocl_version >= 200) || + arg_type == GBE_ARG_PIPE) || + !k->args[i].mem) continue; offset = interp_kernel_get_curbe_offset(k->opaque, GBE_CURBE_KERNEL_ARGUMENT, i); if (offset < 0) diff --git a/src/cl_kernel.c b/src/cl_kernel.c index 59e6cade..969bebaf 100644 --- a/src/cl_kernel.c +++ b/src/cl_kernel.c @@ -164,7 +164,8 @@ cl_kernel_set_arg(cl_kernel k, cl_uint index, size_t sz, const void *value) return CL_INVALID_SAMPLER; } else { // should be image, GLOBAL_PTR, CONSTANT_PTR - if (UNLIKELY(value == NULL && arg_type == GBE_ARG_IMAGE)) + if (UNLIKELY(value == NULL && (arg_type == GBE_ARG_IMAGE || + arg_type == GBE_ARG_PIPE))) return CL_INVALID_ARG_VALUE; if(value != NULL) mem = *(cl_mem*)value; @@ -389,6 +390,8 @@ cl_get_kernel_arg_info(cl_kernel k, cl_uint arg_index, cl_kernel_arg_info param_ type_qual = type_qual | CL_KERNEL_ARG_TYPE_VOLATILE; if (strstr((char*)ret_info, "restrict")) type_qual = type_qual | CL_KERNEL_ARG_TYPE_RESTRICT; + if (strstr((char*)ret_info, "pipe")) + type_qual = CL_KERNEL_ARG_TYPE_PIPE; *(cl_kernel_arg_type_qualifier *)param_value = type_qual; return CL_SUCCESS; -- cgit v1.2.1