[Beignet] [PATCH 18/18] Silent some compilation warnings.
Zhigang Gong
zhigang.gong at intel.com
Fri Mar 28 00:10:56 PDT 2014
Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
src/cl_event.c | 4 ++--
src/cl_mem.h | 2 ++
src/intel/intel_driver.c | 5 ++++-
utests/utest_helper.cpp | 1 +
4 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/cl_event.c b/src/cl_event.c
index f838a3a..727ee1f 100644
--- a/src/cl_event.c
+++ b/src/cl_event.c
@@ -449,6 +449,7 @@ void cl_event_set_status(cl_event event, cl_int status)
/* All user events complete, now wait enqueue events */
ret = cl_event_wait_events(enqueue_cb->num_events, enqueue_cb->wait_list,
enqueue_cb->event->queue);
+ ret = ret;
assert(ret != CL_ENQUEUE_EXECUTE_DEFER);
cb = enqueue_cb;
@@ -520,7 +521,6 @@ cl_int cl_event_get_timestamp(cl_event event, cl_profiling_info param_name)
cl_gpgpu_event_get_exec_timestamp(event->gpgpu_event, 1, &ret_val);
event->timestamp[param_name - CL_PROFILING_COMMAND_QUEUED] = ret_val;
return CL_SUCCESS;
- } else {
- return CL_INVALID_VALUE;
}
+ return CL_INVALID_VALUE;
}
diff --git a/src/cl_mem.h b/src/cl_mem.h
index e325fa1..47a30dc 100644
--- a/src/cl_mem.h
+++ b/src/cl_mem.h
@@ -266,6 +266,8 @@ extern cl_mem cl_mem_new_libva_image(cl_context ctx,
cl_image_format fmt,
size_t row_pitch,
cl_int *errcode);
+extern cl_int cl_mem_get_fd(cl_mem mem, int* fd);
+
#endif /* __CL_MEM_H__ */
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index c2308da..2a2335b 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -643,11 +643,14 @@ static int32_t get_intel_tiling(cl_int tiling, uint32_t *intel_tiling)
static int intel_buffer_set_tiling(cl_buffer bo,
cl_image_tiling_t tiling, size_t stride)
{
- uint32_t intel_tiling, required_tiling;
+ uint32_t intel_tiling;
int ret;
if (UNLIKELY((get_intel_tiling(tiling, &intel_tiling)) < 0))
return -1;
+#ifndef NDEBUG
+ uint32_t required_tiling;
required_tiling = intel_tiling;
+#endif
ret = drm_intel_bo_set_tiling((drm_intel_bo*)bo, &intel_tiling, stride);
assert(intel_tiling == required_tiling);
return ret;
diff --git a/utests/utest_helper.cpp b/utests/utest_helper.cpp
index 162c47b..a9e270e 100644
--- a/utests/utest_helper.cpp
+++ b/utests/utest_helper.cpp
@@ -531,6 +531,7 @@ int *cl_read_bmp(const char *filename, int *width, int *height)
char magic[2];
int ret;
ret = fread(&magic[0], 1, 2, fp);
+ ret = ret;
assert(2 == ret);
assert(magic[0] == 'B' && magic[1] == 'M');
--
1.8.3.2
More information about the Beignet
mailing list