[Beignet] [PATCH 1/5] Runtime: implement clGetSamplerInfo.
Yang, Rong R
rong.r.yang at intel.com
Wed Nov 6 22:21:52 PST 2013
This patchset looks good to me.
-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Thursday, November 07, 2013 9:55 AM
To: beignet at lists.freedesktop.org
Cc: Gong, Zhigang
Subject: [Beignet] [PATCH 1/5] Runtime: implement clGetSamplerInfo.
Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
src/cl_api.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/cl_api.c b/src/cl_api.c index 70a8d09..73c5641 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -735,8 +735,25 @@ clGetSamplerInfo(cl_sampler sampler,
void * param_value,
size_t * param_value_size_ret)
{
- NOT_IMPLEMENTED;
- return 0;
+ cl_int err = CL_SUCCESS;
+ CHECK_SAMPLER (sampler);
+
+ if (param_name == CL_SAMPLER_REFERENCE_COUNT) {
+ FILL_GETINFO_RET (cl_uint, 1, (cl_uint*)&sampler->ref_n,
+ CL_SUCCESS); } else if (param_name == CL_SAMPLER_CONTEXT) {
+ FILL_GETINFO_RET (cl_context, 1, &sampler->ctx, CL_SUCCESS); }
+ else if (param_name == CL_SAMPLER_NORMALIZED_COORDS) {
+ FILL_GETINFO_RET (cl_bool, 1, &sampler->normalized_coords,
+ CL_SUCCESS); } else if (param_name == CL_SAMPLER_ADDRESSING_MODE) {
+ FILL_GETINFO_RET (cl_addressing_mode, 1, &sampler->address,
+ CL_SUCCESS); } else if (param_name == CL_SAMPLER_FILTER_MODE ) {
+ FILL_GETINFO_RET (cl_filter_mode, 1, &sampler->filter, CL_SUCCESS);
+ } else{
+ return CL_INVALID_VALUE;
+ }
+
+error:
+ return err;
}
cl_program
--
1.7.9.5
_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list