Browse code

clean up linter warnings

Tom Sherman authored on 24/06/2019 19:44:02
Showing1 changed files
... ...
@@ -1,49 +1,38 @@
1 1
 #ifndef __COGAPS_HYBRID_VECTOR_H__
2 2
 #define __COGAPS_HYBRID_VECTOR_H__
3 3
 
4
-#include "../utils/Archive.h"
5
-
6
-#include "boost/align/aligned_allocator.hpp"
7 4
 #include <vector>
5
+#include <stdint.h>
6
+#pragma GCC diagnostic push
7
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
8
+#include <boost/align/aligned_allocator.hpp>
9
+#pragma GCC diagnostic pop
8 10
 
9 11
 // need to align data for SIMD
10 12
 namespace bal = boost::alignment;
11 13
 typedef std::vector<float, bal::aligned_allocator<float,32> > aligned_vector;
12 14
 
13
-class SparseIteratorTwo;
14
-class SparseIteratorThree;
15
+class Archive;
15 16
 
16 17
 // stored as a dense vector (efficient setting of values) but maintains
17 18
 // index bit flags of non-zeros so it can be used with SparseIterator
18 19
 class HybridVector
19 20
 {
20 21
 public:
21
-
22
-    friend class SparseIteratorTwo;
23
-    friend class SparseIteratorThree;
24
-    
25
-    template <unsigned N>
26
-    friend class SparseIterator;
27
-
28 22
     explicit HybridVector(unsigned sz);
29 23
     explicit HybridVector(const std::vector<float> &v);
30
-
31
-    bool empty() const;
32
-    unsigned size() const;
33
-
34 24
     bool add(unsigned i, float v); // true if zeros out data
35 25
     bool set(unsigned i, float v); // true if zeros out data
36
-    float operator[](unsigned i) const;
37
-
26
+    bool empty() const;
27
+    unsigned size() const;
38 28
     const float* ptr() const;
39
-
29
+    float operator[](unsigned i) const;
40 30
     const std::vector<uint64_t>& getBitFlags() const { return mIndexBitFlags; }
41
-
42 31
     friend Archive& operator<<(Archive &ar, const HybridVector &vec);
43 32
     friend Archive& operator>>(Archive &ar, HybridVector &vec);
44
-
45 33
 private:
46
-
34
+    template <unsigned N>
35
+    friend class SparseIterator;
47 36
     std::vector<uint64_t> mIndexBitFlags;
48 37
     aligned_vector mData;
49 38
     unsigned mSize;
Browse code

removed internal tests option - this behavior should be tested in debug mode

Tom Sherman authored on 24/06/2019 14:14:03
Showing1 changed files
... ...
@@ -42,9 +42,7 @@ public:
42 42
     friend Archive& operator<<(Archive &ar, const HybridVector &vec);
43 43
     friend Archive& operator>>(Archive &ar, HybridVector &vec);
44 44
 
45
-#ifndef GAPS_INTERNAL_TESTS
46 45
 private:
47
-#endif
48 46
 
49 47
     std::vector<uint64_t> mIndexBitFlags;
50 48
     aligned_vector mData;
Browse code

tests mostly passing, except when running on many threads and using the sparseOptimization flag there is not consistent results for the same seed

Tom Sherman authored on 21/06/2019 19:44:45
Showing1 changed files
... ...
@@ -32,6 +32,7 @@ public:
32 32
     unsigned size() const;
33 33
 
34 34
     bool add(unsigned i, float v); // true if zeros out data
35
+    bool set(unsigned i, float v); // true if zeros out data
35 36
     float operator[](unsigned i) const;
36 37
 
37 38
     const float* ptr() const;
Browse code

wrap boost

Tom Sherman authored on 14/11/2018 23:56:03
Showing1 changed files
... ...
@@ -3,7 +3,7 @@
3 3
 
4 4
 #include "../utils/Archive.h"
5 5
 
6
-#include <boost/align/aligned_allocator.hpp>
6
+#include "boost/align/aligned_allocator.hpp"
7 7
 #include <vector>
8 8
 
9 9
 // need to align data for SIMD
Browse code

cleaned up dot product functions with templates

Tom Sherman authored on 07/11/2018 17:55:51
Showing1 changed files
... ...
@@ -34,7 +34,7 @@ public:
34 34
     bool add(unsigned i, float v); // true if zeros out data
35 35
     float operator[](unsigned i) const;
36 36
 
37
-    const float* densePtr() const;
37
+    const float* ptr() const;
38 38
 
39 39
     const std::vector<uint64_t>& getBitFlags() const { return mIndexBitFlags; }
40 40
 
Browse code

Merge branch 'develop' into sparse_cogaps

Tom Sherman authored on 06/11/2018 13:53:13
Showing0 changed files
Browse code

cleaned up version and regenerated vignette

Tom Sherman authored on 02/11/2018 20:05:05
Showing1 changed files
... ...
@@ -25,7 +25,7 @@ public:
25 25
     template <unsigned N>
26 26
     friend class SparseIterator;
27 27
 
28
-    explicit HybridVector(unsigned size);
28
+    explicit HybridVector(unsigned sz);
29 29
     explicit HybridVector(const std::vector<float> &v);
30 30
 
31 31
     bool empty() const;
Browse code

working versions of three different iteration schemes

Tom Sherman authored on 30/10/2018 19:43:42
Showing1 changed files
... ...
@@ -36,6 +36,8 @@ public:
36 36
 
37 37
     const float* densePtr() const;
38 38
 
39
+    const std::vector<uint64_t>& getBitFlags() const { return mIndexBitFlags; }
40
+
39 41
     friend Archive& operator<<(Archive &ar, const HybridVector &vec);
40 42
     friend Archive& operator>>(Archive &ar, HybridVector &vec);
41 43
 
Browse code

updated config to commit file permissions

Tom Sherman authored on 29/10/2018 19:56:14
Showing1 changed files
1 1
old mode 100644
2 2
new mode 100755
Browse code

tests passing

Tom Sherman authored on 25/10/2018 22:31:44
Showing1 changed files
... ...
@@ -39,7 +39,9 @@ public:
39 39
     friend Archive& operator<<(Archive &ar, const HybridVector &vec);
40 40
     friend Archive& operator>>(Archive &ar, HybridVector &vec);
41 41
 
42
+#ifndef GAPS_INTERNAL_TESTS
42 43
 private:
44
+#endif
43 45
 
44 46
     std::vector<uint64_t> mIndexBitFlags;
45 47
     aligned_vector mData;
Browse code

renamed template iterator to SparseIterator

Tom Sherman authored on 24/10/2018 20:52:02
Showing1 changed files
... ...
@@ -23,7 +23,7 @@ public:
23 23
     friend class SparseIteratorThree;
24 24
     
25 25
     template <unsigned N>
26
-    friend class TemplatedSparseIterator;
26
+    friend class SparseIterator;
27 27
 
28 28
     explicit HybridVector(unsigned size);
29 29
     explicit HybridVector(const std::vector<float> &v);
Browse code

use free functions instead of class for gaps runner

Tom Sherman authored on 23/10/2018 21:37:09
Showing1 changed files
... ...
@@ -36,7 +36,7 @@ public:
36 36
 
37 37
     const float* densePtr() const;
38 38
 
39
-    friend Archive& operator<<(Archive &ar, HybridVector &vec);
39
+    friend Archive& operator<<(Archive &ar, const HybridVector &vec);
40 40
     friend Archive& operator>>(Archive &ar, HybridVector &vec);
41 41
 
42 42
 private:
Browse code

added templated version of sparse iterator; use this one after benchmarking performance

Tom Sherman authored on 19/10/2018 21:41:06
Showing1 changed files
... ...
@@ -21,6 +21,9 @@ public:
21 21
 
22 22
     friend class SparseIteratorTwo;
23 23
     friend class SparseIteratorThree;
24
+    
25
+    template <unsigned N>
26
+    friend class TemplatedSparseIterator;
24 27
 
25 28
     explicit HybridVector(unsigned size);
26 29
     explicit HybridVector(const std::vector<float> &v);
Browse code

basic infrastructure for sparse cogaps

Tom Sherman authored on 17/10/2018 00:45:29
Showing1 changed files
... ...
@@ -40,6 +40,7 @@ private:
40 40
 
41 41
     std::vector<uint64_t> mIndexBitFlags;
42 42
     aligned_vector mData;
43
+    unsigned mSize;
43 44
 };
44 45
 
45 46
 #endif // __COGAPS_HYBRID_VECTOR_H__
46 47
\ No newline at end of file
Browse code

dense sampler appears to be working

Tom Sherman authored on 15/10/2018 20:52:28
Showing1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,45 @@
1
+#ifndef __COGAPS_HYBRID_VECTOR_H__
2
+#define __COGAPS_HYBRID_VECTOR_H__
3
+
4
+#include "../utils/Archive.h"
5
+
6
+#include <boost/align/aligned_allocator.hpp>
7
+#include <vector>
8
+
9
+// need to align data for SIMD
10
+namespace bal = boost::alignment;
11
+typedef std::vector<float, bal::aligned_allocator<float,32> > aligned_vector;
12
+
13
+class SparseIteratorTwo;
14
+class SparseIteratorThree;
15
+
16
+// stored as a dense vector (efficient setting of values) but maintains
17
+// index bit flags of non-zeros so it can be used with SparseIterator
18
+class HybridVector
19
+{
20
+public:
21
+
22
+    friend class SparseIteratorTwo;
23
+    friend class SparseIteratorThree;
24
+
25
+    explicit HybridVector(unsigned size);
26
+    explicit HybridVector(const std::vector<float> &v);
27
+
28
+    bool empty() const;
29
+    unsigned size() const;
30
+
31
+    bool add(unsigned i, float v); // true if zeros out data
32
+    float operator[](unsigned i) const;
33
+
34
+    const float* densePtr() const;
35
+
36
+    friend Archive& operator<<(Archive &ar, HybridVector &vec);
37
+    friend Archive& operator>>(Archive &ar, HybridVector &vec);
38
+
39
+private:
40
+
41
+    std::vector<uint64_t> mIndexBitFlags;
42
+    aligned_vector mData;
43
+};
44
+
45
+#endif // __COGAPS_HYBRID_VECTOR_H__
0 46
\ No newline at end of file