Improvement forNvccCompilerOptions.AddArchOptions?

Nov 15, 2012 at 10:04 PM
Edited Nov 15, 2012 at 10:14 PM

Hi Nick,

Might I suggest implementing this routine as below, to simplify the upgrade path:

  private static void AddArchOptions(CompilerOptions co, eArchitecture arch)
  {
      co.AddOption("-arch=" + arch.ToString());
  }

instead of the current

  private static void AddArchOptions(CompilerOptions co, eArchitecture arch)
  {
      if (arch == eArchitecture.sm_11)
          co.AddOption("-arch=sm_11");
      else if (arch == eArchitecture.sm_12)
           co.AddOption("-arch=sm_12");
       else if (arch == eArchitecture.sm_13)
           co.AddOption("-arch=sm_13");
       else if (arch == eArchitecture.sm_20)
           co.AddOption("-arch=sm_20");
       else if (arch == eArchitecture.sm_21)
           co.AddOption("-arch=sm_21");
       else if (arch == eArchitecture.sm_30)
           co.AddOption("-arch=sm_30");
       else if (arch == eArchitecture.sm_35)
          co.AddOption("-arch=sm_35");
      else
          throw new NotImplementedException(arch.ToString());
  }
Coordinator
Nov 16, 2012 at 5:43 PM

So obvious it hurts ... consider it done! Thanks.

Nov 17, 2012 at 5:05 PM

I have every confidence tha you will return the favour, once you see a larger sample of my code.

;-)