weight_cache_stub.go 620 B

123456789101112131415161718192021222324252627282930313233
  1. //go:build !cuda
  2. package compute
  3. import (
  4. "unsafe"
  5. "makarna/pkg/backend/cpu"
  6. "makarna/pkg/backend/cuda"
  7. )
  8. type GPUWeightCache struct{}
  9. type cachedWeight struct{}
  10. func GetWeightCache(gpu int) *GPUWeightCache {
  11. return &GPUWeightCache{}
  12. }
  13. func (c *GPUWeightCache) Get(key string) (unsafe.Pointer, bool) {
  14. return nil, false
  15. }
  16. func (c *GPUWeightCache) GetTensor(key string) (*cuda.Tensor, bool) {
  17. return nil, false
  18. }
  19. func (c *GPUWeightCache) Upload(key string, _ *cpu.Tensor) (unsafe.Pointer, error) {
  20. return nil, nil
  21. }
  22. // LogWeightCacheSummary is a no-op in CPU-only builds.
  23. func LogWeightCacheSummary() {}