summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-11-25 14:54:13 -0500
committerErik Schnetter <schnetter@gmail.com>2013-11-25 14:54:13 -0500
commit942b1fa0654668576d3990c9c3ad721aaf703f7e (patch)
treee42ecbef9e0bc836528db5c33259fe80b3a783e2
parentec33e3b30b4324cad3f5c26186cc2d2620708a0f (diff)
downloadvecmathlib-942b1fa0654668576d3990c9c3ad721aaf703f7e.zip
vecmathlib-942b1fa0654668576d3990c9c3ad721aaf703f7e.tar.gz
If VML_NO_IOSTREAM is set, then don’t provide any iostream operations
This reduces the size of the library.
-rw-r--r--floatprops.h2
-rw-r--r--vec_base.h6
-rw-r--r--vec_builtin.h6
-rw-r--r--vec_pseudo.h6
-rw-r--r--vec_test.h5
5 files changed, 20 insertions, 5 deletions
diff --git a/floatprops.h b/floatprops.h
index 99fefbd..5304ad7 100644
--- a/floatprops.h
+++ b/floatprops.h
@@ -8,9 +8,7 @@
#include <cassert>
#include <cmath>
#include <cstring>
-#include <iostream>
#include <limits>
-#include <sstream>
diff --git a/vec_base.h b/vec_base.h
index 643359c..737a1e0 100644
--- a/vec_base.h
+++ b/vec_base.h
@@ -3,7 +3,9 @@
#ifndef VEC_BASE_H
#define VEC_BASE_H
-#include <iostream>
+#ifndef VML_NO_IOSTREAM
+# include <iostream>
+#endif
#include "vec_mask.h"
@@ -621,6 +623,7 @@ namespace vecmathlib {
+#ifndef VML_NO_IOSTREAM
template<typename real_t, int size>
std::ostream& operator<<(std::ostream& os, boolvec<real_t, size> const& x)
{
@@ -656,6 +659,7 @@ namespace vecmathlib {
os << "]";
return os;
}
+#endif
} // namespace vecmathlib
diff --git a/vec_builtin.h b/vec_builtin.h
index d8a8a45..7d99deb 100644
--- a/vec_builtin.h
+++ b/vec_builtin.h
@@ -11,7 +11,9 @@
#include <algorithm>
#include <cmath>
#include <cstring>
-#include <sstream>
+#ifndef VML_NO_IOSTREAM
+# include <sstream>
+#endif
#include <string>
@@ -320,6 +322,7 @@ namespace vecmathlib {
static_assert(size * sizeof(real_t) == sizeof(vector_t),
"vector size is wrong");
+#ifndef VML_NO_IOSTREAM
static const char* name()
{
static std::string name_;
@@ -331,6 +334,7 @@ namespace vecmathlib {
return name_.c_str();
}
void barrier() { volatile vector_t x __attribute__((__unused__)) = v; }
+#endif
typedef boolbuiltinvec<real_t, size> boolvec_t;
typedef intbuiltinvec<real_t, size> intvec_t;
diff --git a/vec_pseudo.h b/vec_pseudo.h
index 8fa80dc..2424d40 100644
--- a/vec_pseudo.h
+++ b/vec_pseudo.h
@@ -11,8 +11,10 @@
#include <cmath>
#include <climits>
#include <cstdlib>
+#ifndef VML_NO_IOSTREAM
+# include <sstream>
+#endif
#include <string>
-#include <sstream>
@@ -483,6 +485,7 @@ namespace vecmathlib {
typedef real_t vector_t[size];
static int const alignment = sizeof(real_t);
+#ifndef VML_NO_IOSTREAM
static char const* name()
{
static std::string name_;
@@ -493,6 +496,7 @@ namespace vecmathlib {
}
return name_.c_str();
}
+#endif
void barrier()
{
#if defined __GNUC__ && !defined __clang__ && !defined __ICC
diff --git a/vec_test.h b/vec_test.h
index 7906801..8222919 100644
--- a/vec_test.h
+++ b/vec_test.h
@@ -8,6 +8,9 @@
#include "vec_base.h"
#include <cmath>
+#ifndef VML_NO_IOSTREAM
+# include <sstream>
+#endif
@@ -417,6 +420,7 @@ namespace vecmathlib {
typedef real_t vector_t[size];
static int const alignment = sizeof(real_t);
+#ifndef VML_NO_IOSTREAM
static char const* name()
{
static std::string name_;
@@ -427,6 +431,7 @@ namespace vecmathlib {
}
return name_.c_str();
}
+#endif
void barrier()
{
#if defined __GNUC__ && !defined __clang__ && !defined __ICC
OpenPOWER on IntegriCloud