diff --git a/test/mixeddt/matlab/output/.gitkeep b/test/mixeddt/matlab/output/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/test/mixeddt/matlab/plot_case_all.m b/test/mixeddt/matlab/plot_dom_all.m similarity index 80% rename from test/mixeddt/matlab/plot_case_all.m rename to test/mixeddt/matlab/plot_dom_all.m index 05f54e6ea..f2fe7df4e 100644 --- a/test/mixeddt/matlab/plot_case_all.m +++ b/test/mixeddt/matlab/plot_dom_all.m @@ -1,4 +1,4 @@ -function r_val = plot_case_all( is_mt ) +function r_val = plot_dom_all( is_mt ) cases( 1, : ) = [ 'rrr' ]; cases( 2, : ) = [ 'rrc' ]; @@ -15,7 +15,7 @@ for i = 1:n_cases thecase = cases( i, : ); - plot_case_md( thecase, is_mt ); + plot_dom_case( thecase, is_mt ); end r_val = 0; diff --git a/test/mixeddt/matlab/plot_case_md.m b/test/mixeddt/matlab/plot_dom_case.m similarity index 88% rename from test/mixeddt/matlab/plot_case_md.m rename to test/mixeddt/matlab/plot_dom_case.m index 492f9c2ca..e0147d049 100644 --- a/test/mixeddt/matlab/plot_case_md.m +++ b/test/mixeddt/matlab/plot_dom_case.m @@ -1,4 +1,4 @@ -function r_val = plot_case_md( mdcase, is_mt ) +function r_val = plot_dom_case( mdcase, is_mt ) if is_mt == 1 thr_str = 'mt'; @@ -27,9 +27,7 @@ filetemp_open = '../output_%s_%sgemm_openblas.m'; % the data files, and finally save the results to different variable names. file_blis_sref = sprintf( filetemp_blis, thr_str, 'ssss' ); file_open_sref = sprintf( filetemp_open, thr_str, 'ssss' ); -%str = sprintf( ' Loading %s', file_blis_sref ); disp(str); run( file_blis_sref ) -%str = sprintf( ' Loading %s', file_open_sref ); disp(str); run( file_open_sref ) data_gemm_asm_blis_sref( :, : ) = data_gemm_asm_blis( :, : ); data_gemm_openblas_sref( :, : ) = data_gemm_openblas( :, : ); @@ -38,9 +36,7 @@ data_gemm_openblas_sref( :, : ) = data_gemm_openblas( :, : ); % the data files, and finally save the results to different variable names. file_blis_dref = sprintf( filetemp_blis, thr_str, 'dddd' ); file_open_dref = sprintf( filetemp_open, thr_str, 'dddd' ); -%str = sprintf( ' Loading %s', file_blis_dref ); disp(str); run( file_blis_dref ) -%str = sprintf( ' Loading %s', file_open_dref ); disp(str); run( file_open_dref ) data_gemm_asm_blis_dref( :, : ) = data_gemm_asm_blis( :, : ); data_gemm_openblas_dref( :, : ) = data_gemm_openblas( :, : ); @@ -49,9 +45,7 @@ data_gemm_openblas_dref( :, : ) = data_gemm_openblas( :, : ); % the data files, and finally save the results to different variable names. file_blis_cref = sprintf( filetemp_blis, thr_str, 'cccs' ); file_open_cref = sprintf( filetemp_open, thr_str, 'cccs' ); -%str = sprintf( ' Loading %s', file_blis_cref ); disp(str); run( file_blis_cref ) -%str = sprintf( ' Loading %s', file_open_cref ); disp(str); run( file_open_cref ) data_gemm_asm_blis_cref( :, : ) = data_gemm_asm_blis( :, : ); data_gemm_openblas_cref( :, : ) = data_gemm_openblas( :, : ); @@ -60,9 +54,7 @@ data_gemm_openblas_cref( :, : ) = data_gemm_openblas( :, : ); % the data files, and finally save the results to different variable names. file_blis_zref = sprintf( filetemp_blis, thr_str, 'zzzd' ); file_open_zref = sprintf( filetemp_open, thr_str, 'zzzd' ); -%str = sprintf( ' Loading %s', file_blis_zref ); disp(str); run( file_blis_zref ) -%str = sprintf( ' Loading %s', file_open_zref ); disp(str); run( file_open_zref ) data_gemm_asm_blis_zref( :, : ) = data_gemm_asm_blis( :, : ); data_gemm_openblas_zref( :, : ) = data_gemm_openblas( :, : ); @@ -142,7 +134,7 @@ end %set(gcf,'PaperOrientation','landscape'); %end -outfile = sprintf( 'gemm_%s', mdcase ); +outfile = sprintf( 'output/gemm_%s', mdcase ); print(gcf, outfile,'-bestfit','-dpdf'); %print(gcf, 'gemm_md','-fillpage','-dpdf'); diff --git a/test/mixeddt/matlab/plot_all_md.m b/test/mixeddt/matlab/plot_dt_all.m similarity index 98% rename from test/mixeddt/matlab/plot_all_md.m rename to test/mixeddt/matlab/plot_dt_all.m index 8d417da82..865d578bb 100644 --- a/test/mixeddt/matlab/plot_all_md.m +++ b/test/mixeddt/matlab/plot_dt_all.m @@ -1,4 +1,4 @@ -function r_val = plot_all_md( is_mt ) +function r_val = plot_dt_all( is_mt ) if is_mt == 1 thr_str = 'mt'; @@ -139,5 +139,5 @@ set(gcf,'PaperPosition', [0 0 48 22]); set(gcf,'PaperPositionMode','manual'); set(gcf,'PaperOrientation','landscape'); end -print(gcf, 'gemm_md','-bestfit','-dpdf'); +print(gcf, 'output/gemm_md','-bestfit','-dpdf'); %print(gcf, 'gemm_md','-fillpage','-dpdf'); diff --git a/test/mixeddt/matlab/plot_dt_select.m b/test/mixeddt/matlab/plot_dt_select.m new file mode 100644 index 000000000..38c8d3cd1 --- /dev/null +++ b/test/mixeddt/matlab/plot_dt_select.m @@ -0,0 +1,148 @@ +function r_val = plot_dt_select( dom, is_mt ) + +if is_mt == 1 + thr_str = 'mt'; +else + thr_str = 'st'; +end + +if dom == 'r' + + dt_combos( 1, : ) = [ 'dsss' ]; + dt_combos( 2, : ) = [ 'sddd' ]; + dt_combos( 3, : ) = [ 'sdds' ]; + dt_combos( 4, : ) = [ 'dssd' ]; + dt_combos( 5, : ) = [ 'ddds' ]; + dt_combos( 6, : ) = [ 'sssd' ]; + +else + + dt_combos( 1, : ) = [ 'csss' ]; + dt_combos( 2, : ) = [ 'zddd' ]; + dt_combos( 3, : ) = [ 'ccss' ]; + dt_combos( 4, : ) = [ 'zzdd' ]; + dt_combos( 5, : ) = [ 'cscs' ]; + dt_combos( 6, : ) = [ 'zdzd' ]; +end + +n_combos = size(dt_combos,1); + +filetemp_blis = '../output_%s_%sgemm_asm_blis.m'; +filetemp_open = '../output_%s_%sgemm_openblas.m'; + +% Construct filenames for the "reference" (single real) data, then load +% the data files, and finally save the results to different variable names. +file_blis_sref = sprintf( filetemp_blis, thr_str, 'ssss' ); +file_open_sref = sprintf( filetemp_open, thr_str, 'ssss' ); +run( file_blis_sref ) +run( file_open_sref ) +data_gemm_asm_blis_sref( :, : ) = data_gemm_asm_blis( :, : ); +data_gemm_openblas_sref( :, : ) = data_gemm_openblas( :, : ); + +% Construct filenames for the "reference" (double real) data, then load +% the data files, and finally save the results to different variable names. +file_blis_dref = sprintf( filetemp_blis, thr_str, 'dddd' ); +file_open_dref = sprintf( filetemp_open, thr_str, 'dddd' ); +run( file_blis_dref ) +run( file_open_dref ) +data_gemm_asm_blis_dref( :, : ) = data_gemm_asm_blis( :, : ); +data_gemm_openblas_dref( :, : ) = data_gemm_openblas( :, : ); + +% Construct filenames for the "reference" (single complex) data, then load +% the data files, and finally save the results to different variable names. +file_blis_cref = sprintf( filetemp_blis, thr_str, 'cccs' ); +file_open_cref = sprintf( filetemp_open, thr_str, 'cccs' ); +run( file_blis_cref ) +run( file_open_cref ) +data_gemm_asm_blis_cref( :, : ) = data_gemm_asm_blis( :, : ); +data_gemm_openblas_cref( :, : ) = data_gemm_openblas( :, : ); + +% Construct filenames for the "reference" (double complex) data, then load +% the data files, and finally save the results to different variable names. +file_blis_zref = sprintf( filetemp_blis, thr_str, 'zzzd' ); +file_open_zref = sprintf( filetemp_open, thr_str, 'zzzd' ); +run( file_blis_zref ) +run( file_open_zref ) +data_gemm_asm_blis_zref( :, : ) = data_gemm_asm_blis( :, : ); +data_gemm_openblas_zref( :, : ) = data_gemm_openblas( :, : ); + +%fig = figure; +fig = figure('Position', [100, 100, 1024, 1300]); +orient( fig, 'portrait' ); +%set(gcf,'Position',[0 0 2000 900]); +set(gcf,'PaperUnits', 'inches'); +%set(gcf,'PaperSize', [16 12.4]); +%set(gcf,'PaperPosition', [0 0 16 12.4]); +set(gcf,'PaperSize', [9 11.0]); +set(gcf,'PaperPosition', [0 0 9 11.0]); +%set(gcf,'PaperPositionMode','auto'); +set(gcf,'PaperPositionMode','manual'); +set(gcf,'PaperOrientation','portrait'); + +for dti = 1:n_combos +%for dti = 1:1 + + % Grab the current datatype combination. + combo = dt_combos( dti, : ); + + str = sprintf( 'Plotting %d: %s', dti, combo ); disp(str); + + if combo(4) == 's' + data_gemm_asm_blis_ref( :, : ) = data_gemm_asm_blis_sref( :, : ); + data_gemm_openblas_ref( :, : ) = data_gemm_openblas_sref( :, : ); + refch = 's'; + else %if combo(4) == 'd' + data_gemm_asm_blis_ref( :, : ) = data_gemm_asm_blis_dref( :, : ); + data_gemm_openblas_ref( :, : ) = data_gemm_openblas_dref( :, : ); + refch = 'd'; + end + + if ( combo(1) == 'c' || combo(1) == 'z' ) && ... + ( combo(2) == 'c' || combo(2) == 'z' ) && ... + ( combo(3) == 'c' || combo(3) == 'z' ) + if combo(4) == 's' + data_gemm_asm_blis_ref( :, : ) = data_gemm_asm_blis_cref( :, : ); + data_gemm_openblas_ref( :, : ) = data_gemm_openblas_cref( :, : ); + refch = 'c'; + else %if combo(4) == 'd' + data_gemm_asm_blis_ref( :, : ) = data_gemm_asm_blis_zref( :, : ); + data_gemm_openblas_ref( :, : ) = data_gemm_openblas_zref( :, : ); + refch = 'z'; + end + end + + % Construct filenames for the data files from templates. + file_blis = sprintf( filetemp_blis, thr_str, combo ); + file_open = sprintf( filetemp_open, thr_str, combo ); + + % Load the data files. + %str = sprintf( ' Loading %s', file_blis ); disp(str); + run( file_blis ) + %str = sprintf( ' Loading %s', file_open ); disp(str); + run( file_open ) + + % Plot the result. + plot_gemm_perf( combo, ... + data_gemm_asm_blis, ... + data_gemm_asm_blis_ref, ... + data_gemm_openblas, ... + data_gemm_openblas_ref, ... + is_mt, refch, 3, 2, dti ); + +end + + +%if 0 +%set(gcf,'Position',[0 0 2000 900]); +%set(gcf,'PaperUnits', 'inches'); +%set(gcf,'PaperSize', [48 22]); +%set(gcf,'PaperPosition', [0 0 48 22]); +%%set(gcf,'PaperPositionMode','auto'); +%set(gcf,'PaperPositionMode','manual'); +%set(gcf,'PaperOrientation','landscape'); +%end + +outfile = sprintf( 'output/gemm_select_%c', dom ); + +print(gcf, outfile,'-bestfit','-dpdf'); +%print(gcf, 'gemm_md','-fillpage','-dpdf'); diff --git a/test/mixeddt/matlab/plot_gemm_perf.m b/test/mixeddt/matlab/plot_gemm_perf.m index a93daa22e..f30cc7da5 100644 --- a/test/mixeddt/matlab/plot_gemm_perf.m +++ b/test/mixeddt/matlab/plot_gemm_perf.m @@ -124,77 +124,115 @@ ylim( ax1, [y_begin y_end] ); if rows == 8 && cols == 16 -if theid == 1 -leg = legend( ... -[ ... - blis_ref ... - blis_md ... - open_md ... -], ... -blis_sref_legend, ... -blis_legend, ... -open_legend, ... -'Location', 'best' ); -%'Location', legend_loc ); -set( leg,'Box','off' ); -set( leg,'Color','none' ); -set( leg,'FontSize',fontsize-2 ); -set( leg,'Units','inches' ); -elseif theid == 9 -leg = legend( ... -[ ... - blis_ref ... - blis_md ... - open_md ... -], ... -blis_dref_legend, ... -blis_legend, ... -open_legend, ... -'Location', 'best' ); -%'Location', legend_loc ); -set( leg,'Box','off' ); -set( leg,'Color','none' ); -set( leg,'FontSize',fontsize-2 ); -set( leg,'Units','inches' ); -end + if theid == 1 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_sref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', 'best' ); + %'Location', legend_loc ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + elseif theid == 9 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_dref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', 'best' ); + %'Location', legend_loc ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + end -else % rows == 4 && cols == 4 +elseif rows == 4 && cols == 4 -if theid == 1 -leg = legend( ... -[ ... - blis_ref ... - blis_md ... - open_md ... -], ... -blis_ref_legend, ... -blis_legend, ... -open_legend, ... -'Location', legend_loc ); -%'Location', 'best' ); -set( leg,'Box','off' ); -set( leg,'Color','none' ); -set( leg,'FontSize',fontsize-2 ); -set( leg,'Units','inches' ); -set( leg,'Position',[1.03 3.46 0.7 0.3 ] ); -elseif theid == 3 -leg = legend( ... -[ ... - blis_ref ... - blis_md ... - open_md ... -], ... -blis_ref_legend, ... -blis_legend, ... -open_legend, ... -'Location', legend_loc ); -%'Location', 'best' ); -set( leg,'Box','off' ); -set( leg,'Color','none' ); -set( leg,'FontSize',fontsize-2 ); -set( leg,'Units','inches' ); -set( leg,'Position',[3.51 3.46 0.7 0.3 ] ); -end + if theid == 1 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_ref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', legend_loc ); + %'Location', 'best' ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + set( leg,'Position',[1.03 3.46 0.7 0.3 ] ); + elseif theid == 3 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_ref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', legend_loc ); + %'Location', 'best' ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + set( leg,'Position',[3.51 3.46 0.7 0.3 ] ); + end + +elseif rows == 3 && cols == 2 + + if theid == 1 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_ref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', legend_loc ); + %'Location', 'best' ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + %set( leg,'Position',[1.03 3.46 0.7 0.3 ] ); + elseif theid == 2 + leg = legend( ... + [ ... + blis_ref ... + blis_md ... + open_md ... + ], ... + blis_ref_legend, ... + blis_legend, ... + open_legend, ... + 'Location', legend_loc ); + %'Location', 'best' ); + set( leg,'Box','off' ); + set( leg,'Color','none' ); + set( leg,'FontSize',fontsize-2 ); + set( leg,'Units','inches' ); + %set( leg,'Position',[3.51 3.46 0.7 0.3 ] ); + end end diff --git a/test/mixeddt/matlab/testrand.pdf b/test/mixeddt/matlab/testrand.pdf deleted file mode 100644 index b97c17528..000000000 Binary files a/test/mixeddt/matlab/testrand.pdf and /dev/null differ