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

Allow test/3 drivers to use default ind_t method. #804

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 8 additions & 3 deletions test/3/test_gemm.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ int main( int argc, char** argv )
bli_copym( &c, &c_save );

#ifdef BLIS
// Switch to the induced method specified by ind.
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
// Switch to the induced method specified by ind, unless the 'auto'
// option was given, in which case we leave the induced method
// unchanged.
if ( params.im_is_auto == FALSE )
{
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
}
#endif

#ifdef EIGEN
Expand Down
11 changes: 8 additions & 3 deletions test/3/test_hemm.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@ int main( int argc, char** argv )
bli_copym( &c, &c_save );

#ifdef BLIS
// Switch to the induced method specified by ind.
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
// Switch to the induced method specified by ind, unless the 'auto'
// option was given, in which case we leave the induced method
// unchanged.
if ( params.im_is_auto == FALSE )
{
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
}
#endif

dtime_save = DBL_MAX;
Expand Down
11 changes: 8 additions & 3 deletions test/3/test_herk.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@ int main( int argc, char** argv )
bli_copym( &c, &c_save );

#ifdef BLIS
// Switch to the induced method specified by ind.
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
// Switch to the induced method specified by ind, unless the 'auto'
// option was given, in which case we leave the induced method
// unchanged.
if ( params.im_is_auto == FALSE )
{
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
}
#endif

dtime_save = DBL_MAX;
Expand Down
11 changes: 8 additions & 3 deletions test/3/test_trmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,14 @@ int main( int argc, char** argv )
bli_copym( &c, &c_save );

#ifdef BLIS
// Switch to the induced method specified by ind.
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
// Switch to the induced method specified by ind, unless the 'auto'
// option was given, in which case we leave the induced method
// unchanged.
if ( params.im_is_auto == FALSE )
{
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
}
#endif

dtime_save = DBL_MAX;
Expand Down
11 changes: 8 additions & 3 deletions test/3/test_trsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,14 @@ int main( int argc, char** argv )
bli_copym( &c, &c_save );

#ifdef BLIS
// Switch to the induced method specified by ind.
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
// Switch to the induced method specified by ind, unless the 'auto'
// option was given, in which case we leave the induced method
// unchanged.
if ( params.im_is_auto == FALSE )
{
bli_ind_disable_all_dt( dt );
bli_ind_enable_dt( ind, dt );
}
#endif

dtime_save = DBL_MAX;
Expand Down
23 changes: 16 additions & 7 deletions test/3/test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// Global string constants.
const char* GLOB_DEF_DT_STR = "d";
const char* GLOB_DEF_SC_STR = "ccc";
const char* GLOB_DEF_IM_STR = "native";
const char* GLOB_DEF_IM_STR = "auto";

const char* GLOB_DEF_PS_STR = "50 1000 50";
const char* GLOB_DEF_M_STR = "-1";
Expand Down Expand Up @@ -365,9 +365,10 @@ void parse_cl_params( int argc, char** argv, init_fp fp, params_t* params )
}
printf( "\n" );
printf( " -i im\n" );
printf( " Use native execution if im is 'native' (or 'nat'). Otherwise,\n" );
printf( " if im is '1m', use the 1m method to induce complex computation\n" );
printf( " using the equivalent real-domain microkernels.\n" );
printf( " Use native execution if im is 'native' (or 'nat'). If im is '1m',\n" );
printf( " use the 1m method to induce complex computation using the\n" );
printf( " equivalent real-domain microkernels. If im is 'auto', do not\n" );
printf( " explicitly set the induced method and instead use the default.\n" );
printf( "\n" );
printf( " -p 'lo hi in'\n" );
printf( " Perform a sweep of measurements of problem sizes ranging from \n" );
Expand Down Expand Up @@ -609,13 +610,21 @@ void proc_params( params_t* params )
bli_param_map_char_to_blis_dt( params->dt_str[0], &params->dt );

// Parse the induced method to the corresponding ind_t.
if ( strncmp( params->im_str, "native", 6 ) == 0 )
if ( strncmp( params->im_str, "native", 6 ) == 0 ||
strncmp( params->im_str, "nat", 3 ) == 0 )
{
params->im = BLIS_NAT;
params->im = BLIS_NAT;
params->im_is_auto = FALSE;
}
else if ( strncmp( params->im_str, "1m", 2 ) == 0 )
{
params->im = BLIS_1M;
params->im = BLIS_1M;
params->im_is_auto = FALSE;
}
else if ( strncmp( params->im_str, "auto", 4 ) == 0 )
{
params->im = BLIS_1M;
params->im_is_auto = TRUE;
}
else
{
Expand Down
1 change: 1 addition & 0 deletions test/3/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ typedef struct params_s

const char* im_str;
ind_t im;
bool im_is_auto;

// Problem size range and dimension specifiers.
const char* ps_str;
Expand Down