hwaccel.go 797 B

123456789101112131415161718192021222324252627282930
  1. // hwaccel.go - Hardware acceleration hooks
  2. //
  3. // To the extent possible under law, Yawning Angel has waived all copyright
  4. // and related or neighboring rights to the software, using the Creative
  5. // Commons "CC0" public domain dedication. See LICENSE or
  6. // <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
  7. package hs1siv
  8. const implReference = "Reference"
  9. var (
  10. isHardwareAccelerated = false
  11. hardwareAccelImpl = implReference
  12. )
  13. func forceDisableHardwareAcceleration() {
  14. isHardwareAccelerated = false
  15. hardwareAccelImpl = implReference
  16. }
  17. // IsHardwareAccelerated returns true iff the HS1-SIV implementation will use
  18. // hardware acceleration (eg: AVX2).
  19. func IsHardwareAccelerated() bool {
  20. return isHardwareAccelerated
  21. }
  22. func init() {
  23. initHardwareAcceleration()
  24. }