private long[] getDevices(int deviceType) {
        int[] count = new int[1];
        int errcode = CL10.clGetDeviceIDs(platform, deviceType, null, count);
        if (errcode == CL10.CL_DEVICE_NOT_FOUND) {
            return new long[0];
        }
        Utils.checkError(errcode, "clGetDeviceIDs");

        int num_devices = count[0];
        if (num_devices == 0) {
            return new long[0];
        }

        PointerBuffer devices = PointerBuffer.allocateDirect(num_devices);

        errcode = CL10.clGetDeviceIDs(platform, deviceType, devices, (IntBuffer) null);
        Utils.checkError(errcode, "clGetDeviceIDs");

        long[] deviceIDs = new long[num_devices];
        devices.rewind();
        for (int i = 0; i < num_devices; i++) {
            deviceIDs[i] = devices.get();
        }

        return deviceIDs;
    }
Returns a list of the available devices on this platform that match the
specified type, filtered by the specified filter.

Copied from the old release.

@param deviceType the device type
@return the available devices
jme3-lwjgl3/src/main/java/com/jme3/opencl/lwjgl/LwjglPlatform.java