OpenCL-CTS icon indicating copy to clipboard operation
OpenCL-CTS copied to clipboard

Added comparability verification for GL associated devices query

Open shajder opened this issue 11 months ago • 3 comments

Fixes #1485 according to work plan from issue description.

shajder avatar Jan 17 '25 13:01 shajder

I've tested this PR with linux and windows, currently I am not able to launch the test on MacOS - I will appreciate confirmation from this platform.

GLES version does not work for me, neither on ubuntu nor on windows. Is this sample operational ?

shajder avatar Jan 20 '25 10:01 shajder

@bashbaug thanks for your feedback. The confusion around cl_context_properties comes from the differencies in creating context between platforms. Please note that for OSX and X11 existing setup does not use CL_CONTEXT_PLATFORM property to create context. Then, if I will use clGetContextInfo(CL_CONTEXT_PROPERTIES) to collect properties to be used later with clGetGLContextInfoKHR the test fails at my machine. I am aware this is inconsistency either in spec or driver implementation (most probably clGetGLContextInfoKHR implementation in my nvidia driver). Spec for clGetGLContextInfoKHR says:

properties points to an property list whose format and valid contents are identical to the properties argument of clCreateContext

which means your suggestion should work. Now if I extend list of properties for creation of a context with CL_CONTEXT_PLATFORM my X11 setup passes the test so we could try unifying properties list among platforms but I have no OSX device to verify that (thus I separated clCreateContext and clGetGLContextInfoKHR props). Can you do OSX test so I could extend props list with CL_CONTEXT_PLATFORM ?

shajder avatar Feb 20 '25 13:02 shajder

I think this question is in reference to https://github.com/KhronosGroup/OpenCL-CTS/pull/2231#discussion_r1960998417 - is that correct? If so, note that replying to review comments tends to thread better, and then we can resolve the discussion once it's closed.

This seems like a problem:

Please note that for OSX and X11 existing setup does not use CL_CONTEXT_PLATFORM property to create context.

When CL_CONTEXT_PLATFORM is not specified in the properties, the default platform is "implementation-defined", so if this is working currently then we are getting lucky. It sounds like if we fix this and pass a CL_CONTEXT_PLATFORM then we can use the CL_CONTEXT_PROPERTIES query to make the new test more self-contained, so this definitely gets my vote.

I don't have an OSX system setup to test with. If no other working group members do either, I think we should just do our best, which probably means including the CL_CONTEXT_PLATFORM for OSX as well.

bashbaug avatar Feb 20 '25 16:02 bashbaug

Merging as discussed in the June 10th teleconference.

bashbaug avatar Jun 10 '25 15:06 bashbaug