static string TestCopyFloatsDeviceToDevice() { string testName = "TestCopyFloatsDeviceToDevice"; uint arrayLen = 1000; var alist = Enumerable.Range(4, (int)arrayLen).Select(t => (float)t).ToArray(); var aa = new CudaArray(); IntPtr devDataA = new System.IntPtr(); IntPtr devDataB = new System.IntPtr(); var retlist = new float[(int)arrayLen]; try { var res = aa.ResetDevice(); res = res + aa.MallocFloatsOnDevice(ref devDataA, arrayLen); res = res + aa.MallocFloatsOnDevice(ref devDataB, arrayLen); res = res + aa.CopyFloatsToDevice(alist, devDataA, arrayLen); res = res + aa.CopyFloatsDeviceToDevice(devDataB, devDataA, arrayLen); res = res + aa.CopyFloatsFromDevice(retlist, devDataB, arrayLen); res = res + aa.ReleaseDevicePtr(devDataA); res = res + aa.ReleaseDevicePtr(devDataB); if (!alist.SequenceEqual(retlist)) { return(testName + " fail: sequences do not match"); } if (res != String.Empty) { return(testName + " fail: " + res); } return(testName + " pass"); } catch (Exception ex) { return(testName + " exception " + ex.Message); } finally { aa.ReleaseDevicePtr(devDataA); aa.ReleaseDevicePtr(devDataB); aa.ResetDevice(); } }