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

Missing coverage for CL_PROGRAM_* queries whose value can change after a rebuild #2163

Open
kpet opened this issue Nov 26, 2024 · 0 comments
Labels
missing-coverage mobica-triage Issue proposed for addition to Mobica's backlog (needs WG approval)

Comments

@kpet
Copy link
Contributor

kpet commented Nov 26, 2024

The following queries to clGetProgramInfo require a built program and their value can change when the program is rebuilt. We do not test these cases adequately.

  • CL_PROGRAM_NUM_KERNELS
  • CL_PROGRAM_KERNEL_NAMES
  • CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT (Added in 2.2, deprecated in 3.0)
  • CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT (Added in 2.2, deprecated in 3.0)

We should extend/replace the test_get_program_info_kernel_names test to cover the following:

  • Create a program from source (the source contains multiple kernels with at least one of them defined under a preprocessor macro)
  • Query CL_PROGRAM_NUM_KERNELS and check that it fails with CL_INVALID_PROGRAM_EXECUTABLE
  • Query CL_PROGRAM_KERNEL_NAMES and check that it fails with CL_INVALID_PROGRAM_EXECUTABLE
  • Build the program with the preprocessor macro undefined
  • Query CL_PROGRAM_NUM_KERNELS and check that the correct number is returned
  • Query CL_PROGRAM_KERNEL_NAMES and check that the right kernel names are returned
  • Build the program again with the preprocessor macro defined
  • Query CL_PROGRAM_NUM_KERNELS and check that the correct number is returned
  • Query CL_PROGRAM_KERNEL_NAMES and check that the right kernel names are returned

I suggest we do not cover CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT and CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT under this issue given OpenCL support for program scope constructors and destructors is only required on 2.2, which nobody really supports.

Also consider adding a variant using clCompileProgram/clLinkProgram.

@kpet kpet added missing-coverage mobica-triage Issue proposed for addition to Mobica's backlog (needs WG approval) labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing-coverage mobica-triage Issue proposed for addition to Mobica's backlog (needs WG approval)
Projects
None yet
Development

No branches or pull requests

1 participant