Beispiel #1
0
 public void TestSWAPInVectorWhole()
 {
     CreateRandomData(_hostInput1);
     CreateRamp(_hostInput2);
     _gpu.CopyToDevice(_hostInput2, _devPtr2);
     _gpu.CopyToDevice(_hostInput1, _devPtr1);
     _blas.SWAP(_devPtr1, _devPtr2);
     _gpu.CopyFromDevice(_devPtr2, _hostOutput2);
     _gpu.CopyFromDevice(_devPtr1, _hostOutput1);
     for (int i = 0; i < ciN; i++)
     {
         Assert.AreEqual(_hostInput1[i], _hostOutput2[i]);
     }
     for (int i = 0; i < ciN; i++)
     {
         Assert.AreEqual(_hostInput2[i], _hostOutput1[i]);
     }
 }