@@ -489,60 +489,70 @@ void Options::setOption(vISAOptions option, const char* str)
489489 setOptionInternally (option, str);
490490}
491491
492- std::stringstream& Options::getArgString ()
492+ //
493+ // return full set of arguments ever set by user, either through
494+ // string options or the various setOptions()
495+ //
496+ std::string Options::getFullArgString ()
493497{
494- if (argString.str ().empty ())
498+ std::stringstream args;
499+ // Collect all user-set options.
500+ // This is for igc. When igc invokes vISA, it sets options
501+ // via setOption() api instead of options string, thus leave
502+ // argString empty. Here, we re-generate this options strings
503+ // (This is for debugging)
504+ for (int i = vISA_OPTIONS_UNINIT + 1 ; i < vISA_NUM_OPTIONS; ++i)
495505 {
496- // Collect all user-set options.
497- // This is for igc. When igc invokes vISA, it sets options
498- // via setOption() api instead of options string, thus leave
499- // argString empty. Here, we re-generate this options strings
500- // (This is for debugging)
501- for (int i = vISA_OPTIONS_UNINIT + 1 ; i < vISA_NUM_OPTIONS; ++i)
506+ vISAOptions o = (vISAOptions)i;
507+ if (isOptionSetByUser (o))
502508 {
503- vISAOptions o = (vISAOptions)i;
504- if (isOptionSetByUser (o))
505- {
506- EntryType type = m_vISAOptions.getType (o);
507- switch (type) {
508- case ET_BOOL:
509- if (m_vISAOptions.getBool (o) != m_vISAOptions.getDefaultBool (o))
510- {
511- // Boolean option means the reverse of the default!
512- // (Probably should avoid such reverse handling)
513- argString << m_vISAOptions.getArgStr (o) << " " ;
514- }
515- break ;
516- case ET_INT32:
517- argString << m_vISAOptions.getArgStr (o) << " "
518- << m_vISAOptions.getUint32 (o) << " " ;
519- break ;
520- case ET_INT64:
521- argString << m_vISAOptions.getArgStr (o) << " "
522- << m_vISAOptions.getUint64 (o) << " " ;
523- break ;
524- case ET_2xINT32:
525- {
526- uint32_t lo32, hi32;
527- uint64_t val = m_vISAOptions.getUint64 (o);
528- lo32 = (uint32_t )val;
529- hi32 = (uint32_t )(val >> 32 );
530- argString << m_vISAOptions.getArgStr (o) << " "
531- << hi32 << " " << lo32 << " " ;
532- }
533- break ;
534- case ET_CSTR:
535- argString << m_vISAOptions.getArgStr (o) << " "
536- << m_vISAOptions.getCstr (o) << " " ;
537- break ;
538- default :
539- assert (false && " Invalid vISA option type!" );
540- argString << " UNDEFINED " ;
541- break ;
509+ EntryType type = m_vISAOptions.getType (o);
510+ switch (type) {
511+ case ET_BOOL:
512+ if (m_vISAOptions.getBool (o) != m_vISAOptions.getDefaultBool (o))
513+ {
514+ // Boolean option means the reverse of the default!
515+ // (Probably should avoid such reverse handling)
516+ args << m_vISAOptions.getArgStr (o) << " " ;
542517 }
518+ break ;
519+ case ET_INT32:
520+ args << m_vISAOptions.getArgStr (o) << " "
521+ << m_vISAOptions.getUint32 (o) << " " ;
522+ break ;
523+ case ET_INT64:
524+ args << m_vISAOptions.getArgStr (o) << " "
525+ << m_vISAOptions.getUint64 (o) << " " ;
526+ break ;
527+ case ET_2xINT32:
528+ {
529+ uint32_t lo32, hi32;
530+ uint64_t val = m_vISAOptions.getUint64 (o);
531+ lo32 = (uint32_t )val;
532+ hi32 = (uint32_t )(val >> 32 );
533+ args << m_vISAOptions.getArgStr (o) << " "
534+ << hi32 << " " << lo32 << " " ;
535+ }
536+ break ;
537+ case ET_CSTR:
538+ args << m_vISAOptions.getArgStr (o) << " "
539+ << m_vISAOptions.getCstr (o) << " " ;
540+ break ;
541+ default :
542+ assert (false && " Invalid vISA option type!" );
543+ args << " UNDEFINED " ;
544+ break ;
543545 }
544546 }
545547 }
548+ return args.str ();
549+ }
550+
551+ //
552+ // this returns the options string explicitly passed in by user
553+ //
554+ std::stringstream& Options::getUserArgString ()
555+ {
546556 return argString;
547557}
548558
0 commit comments