Hi @alanzhai219,
I believe this should work though you might need to make one additional change such that the queues are created with the same context (this is because by the exact wording of the spec, it is necessary, but the underlying backend might not require it).
I haven’t compiled this but I believe that’s correct, and it indicates that the queues should share a device and context. Contexts can have multiple devices on them. The functions you’re describing take a queue as a shortcut to get both the context and device.
In short: should work, but you can guarantee it by fixing the device and context.