The following pattern is repeating throughout the test suite:
// Testing for exception "INVALID_CONTEXT"
var webCLPlatform = wtu.getPlatform();
var devices = wtu.getDevices(webCLPlatform, webcl.DEVICE_TYPE_ALL);
if (devices.length > 1) {
// create contexts on two different devices, try to use them
// interchangeably, and check that INVALID_CONTEXT is thrown
}
The tests inside the if clause will get skipped if there's only one device on the platform, which is the typical situation on Windows and Linux systems.
Luckily there's an easy solution: The contexts don't need to be on different devices. You can create two separate contexts on the same device and keep the rest of the code as it is.
The following pattern is repeating throughout the test suite:
The tests inside the
if
clause will get skipped if there's only one device on the platform, which is the typical situation on Windows and Linux systems.Luckily there's an easy solution: The contexts don't need to be on different devices. You can create two separate contexts on the same device and keep the rest of the code as it is.