-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize sizeof dims_t and raw_matrix types
- Loading branch information
Showing
4 changed files
with
57 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,3 +58,8 @@ exe rgb2grayscale | |
rgb2grayscale.cpp | ||
libpng12 | ||
; | ||
|
||
exe sizeof | ||
: | ||
sizeof.cpp | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <mitrax/matrix.hpp> | ||
|
||
#include <iostream> | ||
|
||
|
||
int main(){ | ||
using namespace mitrax; | ||
using namespace mitrax::literals; | ||
|
||
auto dcc = dims(2_C, 4_R); | ||
auto drc = dims(2_C_rt, 4_R); | ||
auto dcr = dims(2_C, 4_R_rt); | ||
auto drr = dims(2_C_rt, 4_R_rt); | ||
|
||
auto mcc = make_matrix_v< std::uint8_t >(2_C, 4_R); | ||
auto mrc = make_matrix_v< std::uint8_t >(2_C_rt, 4_R); | ||
auto mcr = make_matrix_v< std::uint8_t >(2_C, 4_R_rt); | ||
auto mrr = make_matrix_v< std::uint8_t >(2_C_rt, 4_R_rt); | ||
|
||
auto hcc = make_matrix_v(2_C, 4_R, std::uint8_t(), memory_heap); | ||
|
||
std::cout << "sizeof(dcc) = " << sizeof(dcc) << std::endl; | ||
std::cout << "sizeof(drc) = " << sizeof(drc) << std::endl; | ||
std::cout << "sizeof(dcr) = " << sizeof(dcr) << std::endl; | ||
std::cout << "sizeof(drr) = " << sizeof(drr) << std::endl; | ||
|
||
std::cout << "sizeof(mcc) = " << sizeof(mcc) << std::endl; | ||
std::cout << "sizeof(hcc) = " << sizeof(hcc) << std::endl; | ||
std::cout << "sizeof(mrc) = " << sizeof(mrc) << std::endl; | ||
std::cout << "sizeof(mcr) = " << sizeof(mcr) << std::endl; | ||
std::cout << "sizeof(mrr) = " << sizeof(mrr) << std::endl; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters