You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

NativeLibraryMetadata.cs 1.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 
  2. namespace LLama.Native
  3. {
  4. /// <summary>
  5. /// Information of a native library file.
  6. /// </summary>
  7. /// <param name="NativeLibraryName">Which kind of library it is.</param>
  8. /// <param name="UseCuda">Whether it's compiled with cublas.</param>
  9. /// <param name="AvxLevel">Which AvxLevel it's compiled with.</param>
  10. public record class NativeLibraryMetadata(NativeLibraryName NativeLibraryName, bool UseCuda, AvxLevel AvxLevel)
  11. {
  12. public override string ToString()
  13. {
  14. return $"(NativeLibraryName: {NativeLibraryName}, UseCuda: {UseCuda}, AvxLevel: {AvxLevel})";
  15. }
  16. }
  17. /// <summary>
  18. /// Avx support configuration
  19. /// </summary>
  20. public enum AvxLevel
  21. {
  22. /// <summary>
  23. /// No AVX
  24. /// </summary>
  25. None,
  26. /// <summary>
  27. /// Advanced Vector Extensions (supported by most processors after 2011)
  28. /// </summary>
  29. Avx,
  30. /// <summary>
  31. /// AVX2 (supported by most processors after 2013)
  32. /// </summary>
  33. Avx2,
  34. /// <summary>
  35. /// AVX512 (supported by some processors after 2016, not widely supported)
  36. /// </summary>
  37. Avx512,
  38. }
  39. }