Skip to content

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

@kpet

Description

@kpet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions