public async Task IndexOfGreaterThan()
        {
            var comparand = 99 - Saturation;
            var eventId   = await _indexOf.IndexOfGreaterThan(_queueId, _width, _height,
                                                              new OclBuffer <int>(_sourceBufferId), new OclBuffer <int>(_resultBufferId), new OclBuffer <int>(_counterBufferId), comparand);

            Flush(_queueId);
            WaitForEvents(eventId);
            ReleaseEvent(eventId);
        }
        public async Task IndexOf_greaterThan_simple()
        {
            // Arrange:
            var source = new int[] { 0, 0, 1, 1, 1, 0 };
            var result = new int[source.Length * 2];
            var count  = new int[1] {
                0
            };
            var w = 3;
            var h = 2;

            var platformId = GetPlatforms().First();
            var deviceId   = GetPlatformDevices(platformId).First();
            var contextId  = CreateContext(platformId, new[] { deviceId });
            var queueId    = CreateCommandQueue(contextId, deviceId);

            var srcBufferId = CopyBuffer(contextId, source.AsSpan());
            var dstBufferId = CreateBuffer <int>(contextId, result.Length);
            var cntBufferId = CreateBuffer <int>(contextId, 1);

            // Act:
            var indexOf = new OclIndexOfAlgorithms();
            var eventId = await indexOf.IndexOfGreaterThan(queueId, w, h,
                                                           new OclBuffer <int>(srcBufferId), new OclBuffer <int>(dstBufferId), new OclBuffer <int>(cntBufferId), comparand : 0);

            // Assert:
            WaitForEvents(eventId);

            var readDstId = EnqueueReadBuffer(queueId, dstBufferId, false, 0, result.Length, result.AsSpan());
            var readCntId = EnqueueReadBuffer(queueId, cntBufferId, false, 0, 1, count.AsSpan());

            WaitForEvents(readDstId, readCntId);

            ReleaseContext(contextId);

            var cnt = count[0];

            cnt.Should().Be(3);

            var indexes = new HashSet <(int, int)>();

            for (var i = 0; i < result.Length; i += 2)
            {
                indexes.Add((result[i], result[i + 1]));
            }

            indexes.Should().BeEquivalentTo(new [] { (2, 0), (0, 1), (1, 1), (0, 0) });