Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented AlignedAllocator #218

Merged
merged 27 commits into from
Jan 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f8daec1
Implemented AlignedAllocator
hosseinmoein Dec 9, 2022
67845e3
Changed default alignment value for AlignedAllocator
hosseinmoein Dec 10, 2022
1304d86
minor change
hosseinmoein Dec 10, 2022
269aa5f
Toward aligned memory 1 -- not building yet
hosseinmoein Dec 11, 2022
5f9fc9b
Toward aligned memory 2 -- not building yet
hosseinmoein Dec 11, 2022
28bddef
Finished a lot of boilerplate crap -- it builds now
hosseinmoein Dec 13, 2022
4067a64
Tweaked the boilerplate crap further
hosseinmoein Dec 13, 2022
d496090
Introduced the AlignAllocator to the code. all gen function have to b…
hosseinmoein Dec 18, 2022
852780e
Lot of boilerplate clean ups
hosseinmoein Dec 19, 2022
ecdc9ca
Merge branch 'master' into Hossein/Allocator
hosseinmoein Dec 19, 2022
5ba60a9
sofar dataframe_tester.cc builds
hosseinmoein Dec 22, 2022
802975f
Everything compiles. next vistors and tests
hosseinmoein Dec 23, 2022
09d0676
Added align parameter to visitors. Next adding tests ...
hosseinmoein Dec 24, 2022
4f6f590
Corrected some over use of StlVecType
hosseinmoein Dec 24, 2022
4ee41cf
Corrected some over use of StlVecType 2
hosseinmoein Dec 24, 2022
6f26f29
Corrected some over use of StlVecType 3
hosseinmoein Dec 24, 2022
9597735
Added tests for DataFrame with aligned allocator
hosseinmoein Dec 25, 2022
56424ec
code reformatting
hosseinmoein Dec 25, 2022
ae13ad6
code reformatting 2
hosseinmoein Dec 25, 2022
ca2032f
code reformatting 3
hosseinmoein Dec 25, 2022
8ac0e88
Adjusted docs for aligned memory allocator
hosseinmoein Dec 29, 2022
9ef87f9
Adjusted docs for aligned memory allocator 2
hosseinmoein Dec 29, 2022
b75f262
Adjusted docs for aligned memory allocator 3
hosseinmoein Dec 31, 2022
934d010
Merge branch 'master' into Hossein/Allocator
hosseinmoein Jan 1, 2023
c901004
Adjusted docs for aligned memory allocator 4 + code clean up
hosseinmoein Jan 1, 2023
f40e0c3
Fixed stupid Windows compiler problem
hosseinmoein Jan 1, 2023
1ffcad1
Adjusted docs for aligned memory allocator 5
hosseinmoein Jan 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ add_library(DataFrame::DataFrame ALIAS DataFrame)
target_sources(DataFrame
PRIVATE
src/Utils/DateTime.cc
src/Vectors/HeteroVector.cc
src/Vectors/HeteroView.cc
src/Vectors/HeteroConstView.cc
src/Vectors/HeteroPtrView.cc
src/Vectors/HeteroConstPtrView.cc
)

target_compile_features(DataFrame PUBLIC cxx_std_17)
Expand Down
17 changes: 11 additions & 6 deletions benchmarks/dataframe_performance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#pragma omp declare simd clauses

#include <DataFrame/DataFrame.h>
#include <DataFrame/DataFrameStatsVisitors.h>
#include <DataFrame/RandGen.h>
Expand All @@ -33,7 +35,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using namespace hmdf;

typedef StdDataFrame<time_t> MyDataFrame;
constexpr std::size_t ALIGNMENT = 256;

typedef StdDataFrame256<time_t> MyDataFrame;

// -----------------------------------------------------------------------------

Expand All @@ -43,15 +47,16 @@ int main(int, char *[]) {

const auto first = time(nullptr);
auto index_vec =
MyDataFrame::gen_datetime_index("01/01/1970", "08/15/2019",
MyDataFrame::gen_datetime_index("01/01/1980", "08/15/2019",
time_frequency::secondly, 1);
const auto index_sz = index_vec.size();
MyDataFrame df;

df.load_data(std::move(index_vec),
std::make_pair("normal", gen_normal_dist<double>(index_sz)),
std::make_pair("log_normal", gen_lognormal_dist<double>(index_sz)),
std::make_pair("exponential", gen_exponential_dist<double>(index_sz)));
df.load_data(
std::move(index_vec),
std::make_pair("normal", gen_normal_dist<double, ALIGNMENT>(index_sz)),
std::make_pair("log_normal", gen_lognormal_dist<double, ALIGNMENT>(index_sz)),
std::make_pair("exponential", gen_exponential_dist<double, ALIGNMENT>(index_sz)));

const auto second = time(nullptr);

Expand Down
9 changes: 6 additions & 3 deletions docs/HTML/AccumDistVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct AccumDistVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using ad_v = AccumDistVisitor&lt;T, I&gt;;
</B></PRE></font>
</td>
Expand All @@ -51,7 +53,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions docs/HTML/AffinityPropVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameMLVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct AffinityPropVisitor;
</B></PRE></font>
</td>
Expand All @@ -61,7 +62,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/ArnaudLegouxMAVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct ArnaudLegouxMAVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using alma_v = ArnaudLegouxMAVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using alma_v = ArnaudLegouxMAVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -63,7 +65,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions docs/HTML/AutoCorrVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameStatsVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct AutoCorrVisitor;
</B></PRE></font>
</td>
Expand All @@ -44,7 +45,8 @@
</td>
<td width="15%">
<B>T</B>: Column data type. T must be an arithmetic-enabled type<BR>
<B>I</B>: Index type.
<B>I</B>: Index type.<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/AvgDirMovIdxVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct AvgDirMovIdxVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using adx_v = AvgDirMovIdxVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using adx_v = AvgDirMovIdxVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -51,7 +53,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/BalanceOfPowerVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct BalanceOfPowerVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using bop_v = BalanceOfPowerVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using bop_v = BalanceOfPowerVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -61,7 +63,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/BiasVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
<PRE><B>#include &lt;DataFrame/DataFrameStatsVisitors.h&gt;

template&lt;typename A, typename T,
typename I = unsigned long&gt;
typename I = unsigned long,
std::size_t A = 0&gt;
struct BiasVisitor;

// -------------------------------------

template&lt;typename A, typename T,
typename I = unsigned long&gt;
using bias_v = BiasVisitor&lt;A, T, I&gt;;
typename I = unsigned long,
std::size_t A = 0&gt;
using bias_v = BiasVisitor&lt;A, T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -58,7 +60,8 @@
<td width="12%">
<B>A</B>: Mean visitor type.<BR>
<B>T</B>: Column data type.<BR>
<B>I</B>: Index type.
<B>I</B>: Index type.<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions docs/HTML/BollingerBand.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct BollingerBand;
</B></PRE></font>
</td>
Expand Down Expand Up @@ -65,7 +66,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/BoxCoxVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameStatsVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct BoxCoxVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using bcox_v = BoxCoxVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using bcox_v = BoxCoxVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -93,7 +95,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type.<BR>
<B>I</B>: Index type.
<B>I</B>: Index type.<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions docs/HTML/CCIVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct CCIVisitor;
</B></PRE></font>
</td>
Expand All @@ -53,7 +54,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
6 changes: 4 additions & 2 deletions docs/HTML/CategoryVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameStatsVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct CategoryVisitor;
</B></PRE></font>
</td>
Expand All @@ -51,7 +52,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type.<BR>
<B>I</B>: Index type.
<B>I</B>: Index type.<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/CenterOfGravityVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct CenterOfGravityVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using cog_v = CenterOfGravityVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using cog_v = CenterOfGravityVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -57,7 +59,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
11 changes: 7 additions & 4 deletions docs/HTML/ChaikinMoneyFlowVisitor.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<td bgcolor="maroon"> <font color="white">
<PRE><B>#include &lt;DataFrame/DataFrameFinancialVisitors.h&gt;

template&lt;typename T, typename I = unsigned long&gt;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
struct ChaikinMoneyFlowVisitor;

// -------------------------------------

template&lt;typename T, typename I = unsigned long&gt;
using cmf_v = ChaikinMoneyFlowVisitor&lt;T, I&gt;;
template&lt;typename T, typename I = unsigned long,
std::size_t A = 0&gt;
using cmf_v = ChaikinMoneyFlowVisitor&lt;T, I, A&gt;;
</B></PRE></font>
</td>
<td>
Expand All @@ -51,7 +53,8 @@
</td>
<td width="12%">
<B>T</B>: Column data type<BR>
<B>I</B>: Index type
<B>I</B>: Index type<BR>
<B>A</B>: Memory alignment boundary for vectors. Default is system default alignment<BR>
</td>
</tr>

Expand Down
Loading