Skip to content

Commit

Permalink
Cleaned code with fht_dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
aryamanjeendgar committed Oct 10, 2024
1 parent e601309 commit 7b8b134
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions RandBLAS/trig_skops.hh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ namespace RandBLAS {
}

void fht_dispatch(
bool left,
blas::Layout layout,
double* buff,
int64_t log_n,
Expand All @@ -322,6 +323,14 @@ namespace RandBLAS {
)
{
//TODO:
if(left && layout == blas::Layout::ColMajor)
fht_left_col_major(buff, log_n, num_rows, num_cols);
else if(left && layout == blas::Layout::RowMajor)
fht_left_row_major(buff, log_n, num_rows, num_cols);
else if(!left && layout == blas::Layout::ColMajor)
fht_right_col_major(buff, log_n, num_rows, num_cols);
else
fht_right_row_major(buff, log_n, num_rows, num_cols);
}

enum class TrigDistName: char {
Expand Down Expand Up @@ -523,11 +532,7 @@ inline void lmiget(
// applyDiagonalRademacher(layout, m, n, A, diag);

//Step 2: Apply the Hadamard transform
//TODO: Clean via `fht_dispatch`
// fht_left_col_major(A, std::log2(MAX(m, n)), m, n);
// fht_right_row_major(A, std::log2(MAX(m, n)), m, n);
// fht_left_row_major(A, std::log2(MAX(m, n)), m, n);
fht_right_col_major(A, std::log2(MAX(m, n)), m, n);
fht_dispatch(true, layout, A, std::log2(MAX(m, n)), m, n);

//Step 3: Permute the rows
std::vector<sint_t> idxs_minor(d); // Placeholder
Expand Down

0 comments on commit 7b8b134

Please sign in to comment.