Skip to content

Commit

Permalink
Merge pull request #218 from hosseinmoein/Hossein/Allocator
Browse files Browse the repository at this point in the history
Implemented AlignedAllocator
  • Loading branch information
hosseinmoein authored Jan 2, 2023
2 parents 66f9e24 + 1ffcad1 commit e36fd31
Show file tree
Hide file tree
Showing 143 changed files with 15,742 additions and 4,413 deletions.
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

0 comments on commit e36fd31

Please sign in to comment.