Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leaks in loader_test. #233

Merged
merged 1 commit into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/driver_stub/cl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,11 +1835,13 @@ clEnqueueNativeKernel(cl_command_queue command_queue ,
return return_value;
}

static void extFunc(void) { }

CL_API_ENTRY void * CL_API_CALL
clGetExtensionFunctionAddressForPlatform(cl_platform_id platform ,
const char * func_name) CL_API_SUFFIX__VERSION_1_2
{
void *return_value = (void *) malloc(sizeof(void *));
void *return_value = (void *)(size_t)&extFunc;
test_icd_stub_log("clGetExtensionFunctionAddressForPlatform(%p, %p)\n",
platform,
func_name);
Expand Down
4 changes: 4 additions & 0 deletions test/loader_test/test_create_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,12 +780,16 @@ int test_create_calls()

test_clCreateBuffer(clCreateBufferData);

test_clReleaseMemObject(clReleaseMemObjectData);

test_clCreateBufferWithProperties(clCreateBufferWithPropertiesData);

test_clCreateSubBuffer(clCreateSubBufferData);

test_clCreateImage(clCreateImageData);

test_clReleaseMemObject(clReleaseMemObjectDataImage);

test_clCreateImageWithProperties(clCreateImageWithPropertiesData);

test_clReleaseMemObject(clReleaseMemObjectDataImage);
Expand Down
5 changes: 5 additions & 0 deletions test/loader_test/test_program_objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ int test_clCompileProgram(const struct clCompileProgram_st *data)
int test_clLinkProgram(const struct clLinkProgram_st *data)
{
cl_program program;
cl_int ret_val;
test_icd_app_log("clLinkProgram(%p, %u, %p, %p, %u, %p, %p, %p, %p)\n",
context,
data->num_devices,
Expand All @@ -147,6 +148,10 @@ int test_clLinkProgram(const struct clLinkProgram_st *data)

test_icd_app_log("Value returned: %p\n", program);

test_icd_app_log("clReleaseProgram(%p)\n", program);
ret_val = clReleaseProgram(program);
test_icd_app_log("Value returned: %d\n", ret_val);

return 0;

}
Expand Down
Loading