Extend vector type capabilities and add tests to reflect it. (#1656)

This commit is contained in:
Alex Voicu
2019-11-20 16:02:32 +00:00
committed by Maneesh Gupta
parent 153a959280
commit b5b3d1bbaa
3 changed files with 70 additions and 0 deletions
+19
View File
@@ -34,6 +34,7 @@ THE SOFTWARE.
#include <assert.h>
#include <iostream>
#include <string>
#include <sstream>
#include <type_traits>
using namespace std;
@@ -157,6 +158,24 @@ bool TestVectorType() {
if (f1 == f2) return false;
if (!(f1 != f2)) return false;
using T = typename V::value_type;
const T& x = f1.x;
T& y = f2.x;
const volatile T& z = f3.x;
volatile T& w = f2.x;
if (x != T{3}) return false;
if (y != T{4}) return false;
if (z != T{3}) return false;
if (w != T{4}) return false;
stringstream str;
str << f1.x;
str >> f2.x;
if (f1.x != f2.x) return false;
return true;
}
@@ -149,6 +149,20 @@ bool TestVectorType() {
if (f1 == f2) return false;
if (!(f1 != f2)) return false;
#if 0 // TODO: investigate on GFX8
using T = typename V::value_type;
const T& x = f1.x;
T& y = f2.x;
const volatile T& z = f3.x;
volatile T& w = f2.x;
if (x != T{3}) return false;
if (y != T{4}) return false;
if (z != T{3}) return false;
if (w != T{4}) return false;
#endif
return true;
}