Пример #1
0
        public void TestMAXInVectorWhole()
        {
            CreateRandomData(_hostInput1);
            _gpu.CopyToDevice(_hostInput1, _devPtr1);
            int   index = _blas.IAMAX(_devPtr1);
            float max   = _hostInput1.Max();

            Assert.AreEqual(max, _hostInput1[index <= 0 ? 0 : index - 1]); // 1-indexed
        }
Пример #2
0
        public void TestMAXInVectorWhole()
        {
            CreateRandomData(_hostInput);
            DebugBuffer(_hostInput);
            _gpu.CopyToDevice(_hostInput, _devPtr);
            float[] castDevPtr = _gpu.Cast(_devPtr, ciTOTAL);
            int     index      = _blas.IAMAX(castDevPtr);
            var     list       = _hostInput.Cast <float>().ToList();
            float   max        = list.Max();

            Debug.WriteLine(index);
            Debug.WriteLine(max);
            Assert.AreEqual(max, list[index - 1]); // 1-indexed
        }