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

Missing negative case for clCreateContext function

Open shajder opened this issue 1 year ago • 2 comments

Attempt to create context with multiple devices associated with different platforms should have separate negative case, something like:

CL_INVALID_DEVICE if the platform associated with devices in devices list is not the same.

Additional remarks:

  1. Creating multi-device-platform context is impossible. I think spec could do more about explaining such a case. Description from the devices argument could be extended, currently it says:

devices is a pointer to a list of unique devices returned by clGetDeviceIDs or sub-devices created by clCreateSubDevices for a platform.

2)  At my machine attempt to create context with two devices from nvidia and intel platform crashes. I could only presume this is not an isolated case. Here is my branch to test such case with test_context:

https://github.com/shajder/OpenCL-CTS/tree/context_negative_create

shajder avatar Sep 13 '24 06:09 shajder

I also saw this behavior, but in my case, I have a proper Nvidia driver + Intel OpenCL driver on an AMD CPU.

If I make Intel driver primary (place CPU device from their platform first in the list) - I get CL_INVALID_DEVICE as expected.

But if I make NVidia driver primary - my .Net app crashes with System.AccessViolationException.

SunSerega avatar Sep 13 '24 07:09 SunSerega

Sounds like we might want a CTS test for this in addition to a spec clarification.

bashbaug avatar Sep 13 '24 18:09 bashbaug