[arrayfire] 21/41: array test cleanup required for windows
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Mar 21 14:56:22 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch debian/experimental
in repository arrayfire.
commit c39e4b77322071cc4b5d6decf23304034e414e34
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Mon Mar 14 17:08:36 2016 -0400
array test cleanup required for windows
---
test/array.cpp | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/test/array.cpp b/test/array.cpp
index e08e604..b712df3 100644
--- a/test/array.cpp
+++ b/test/array.cpp
@@ -466,25 +466,30 @@ TEST(DeviceId, Different)
{
int ndevices = getDeviceCount();
if (ndevices < 2) return;
-
int id0 = getDevice();
int id1 = (id0 + 1) % ndevices;
- array a = randu(5,5);
- ASSERT_EQ(getDeviceId(a), id0);
- setDevice(id1);
+ {
+ array a = randu(5,5);
+ ASSERT_EQ(getDeviceId(a), id0);
+ setDevice(id1);
+
+ array b = randu(5,5);
- array b = randu(5,5);
+ ASSERT_EQ(getDeviceId(a), id0);
+ ASSERT_EQ(getDeviceId(b), id1);
+ ASSERT_NE(getDevice(), getDeviceId(a));
+ ASSERT_EQ(getDevice(), getDeviceId(b));
- ASSERT_EQ(getDeviceId(a), id0);
- ASSERT_EQ(getDeviceId(b), id1);
- ASSERT_NE(getDevice(), getDeviceId(a));
- ASSERT_EQ(getDevice(), getDeviceId(b));
+ af_array c;
+ af_err err = af_matmul(&c, a.get(), b.get(), AF_MAT_NONE, AF_MAT_NONE);
+ ASSERT_EQ(err, AF_ERR_DEVICE);
+ }
- af_array c;
- af_err err = af_matmul(&c, a.get(), b.get(), AF_MAT_NONE, AF_MAT_NONE);
- ASSERT_EQ(err, AF_ERR_DEVICE);
+ setDevice(id1);
+ af::deviceGC();
setDevice(id0);
+ af::deviceGC();
}
TEST(Device, empty)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list