KhronosGroup / KhronosGroup/OpenCL-CTS

test_kernel_attributes test is not correct

Open
#1,284 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
232
Forks
235
Avg merge
8d 7h
Merged PRs (30d)
18

Description

OpenCL spec (https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_KERNEL_ATTRIBUTES): For kernels not created from OpenCL C source and the clCreateProgramWithSource API call the string returned from this query will be empty.

But in test_kernel_attributes test, it read from bc binary and expect to get kernel attribute, which is not consistent with OpenCL spec. Related test code:
static bool
test_kernel_attributes(cl_device_id device, cl_uint width, const char *folder)
{
...
get_bc_file_path(folder, "kernel_attributes", bc_file_path, width);
clProgramWrapper bcprog = create_program_from_bc(context, bc_file_path);
...
// Querying the kernel for its attributes.
kernel = create_kernel_helper(bcprog, "test");
cl_int err_code = clGetKernelInfo(kernel, CL_KERNEL_ATTRIBUTES, sizeof(attributes), attributes, &res_size);
...
// Building the expected attributes vector.
std::vector expected;
expected.push_back(std::string("work_group_size_hint(64,1,1)"));
expected.push_back(std::string("vec_type_hint(float4)"));

Please have a check. Thanks.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with test_kernel_attributes and its create_program_from_bc path, then compare the CL_KERNEL_ATTRIBUTES expectation with the linked OpenCL specification. Check whether the binary-based test should expect an empty string, and update the test so its result matches the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.