[Beignet] [PATCH 5/6] Fix get kernel_names bug.
junyan.he at inbox.com
junyan.he at inbox.com
Fri Jun 23 10:18:28 UTC 2017
From: Junyan He <junyan.he at intel.com>
The cl_program_get_kernel_names should use size_t rather than int.
Signed-off-by: Junyan He <junyan.he at intel.com>
---
runtime/cl_api_program.c | 5 +++--
runtime/cl_program.c | 2 +-
runtime/cl_program.h | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/runtime/cl_api_program.c b/runtime/cl_api_program.c
index 18f48ce..e4ce5bb 100644
--- a/runtime/cl_api_program.c
+++ b/runtime/cl_api_program.c
@@ -32,8 +32,9 @@ clGetProgramInfo(cl_program program,
size_t src_size = 0;
const char *ret_str = "";
cl_int ref;
- cl_uint num_dev, kernels_num;
+ cl_uint num_dev;
cl_int i;
+ size_t kernels_num;
if (!CL_OBJECT_IS_PROGRAM(program)) {
return CL_INVALID_PROGRAM;
@@ -61,7 +62,7 @@ clGetProgramInfo(cl_program program,
return err;
src_ptr = &kernels_num;
- src_size = sizeof(cl_uint);
+ src_size = sizeof(size_t);
} else if (param_name == CL_PROGRAM_SOURCE) {
if (!program->source) {
src_ptr = ret_str;
diff --git a/runtime/cl_program.c b/runtime/cl_program.c
index a9eaedd..a22ee8b 100644
--- a/runtime/cl_program.c
+++ b/runtime/cl_program.c
@@ -656,7 +656,7 @@ cl_program_link(cl_context context, cl_uint num_devices, const cl_device_id *dev
}
LOCAL cl_int
-cl_program_get_kernel_names(cl_program p, cl_uint *kerne_num, size_t size, char *names, size_t *name_ret)
+cl_program_get_kernel_names(cl_program p, size_t *kerne_num, size_t size, char *names, size_t *name_ret)
{
/* This function will get all possible kernel names, at least one device has it */
char **known_kernel_list = NULL;
diff --git a/runtime/cl_program.h b/runtime/cl_program.h
index 7b2196a..6d4d8d6 100644
--- a/runtime/cl_program.h
+++ b/runtime/cl_program.h
@@ -74,7 +74,7 @@ extern cl_int cl_program_compile(cl_program p, cl_uint num_input_headers, const
extern cl_program cl_program_link(cl_context context, cl_uint num_devices, const cl_device_id *device_list,
cl_uint num_input_programs, const cl_program *input_programs,
const char *options, cl_int *errcode_ret);
-extern cl_int cl_program_get_kernel_names(cl_program p, cl_uint *kerne_num, size_t size, char *names, size_t *name_ret);
+extern cl_int cl_program_get_kernel_names(cl_program p, size_t *kerne_num, size_t size, char *names, size_t *name_ret);
extern cl_program cl_program_create_with_built_in_kernles(cl_context context, cl_uint num_devices,
const cl_device_id *device_list, const char *kernel_names,
cl_int *errcode_ret);
--
2.7.4
More information about the Beignet
mailing list