gpu_info_darwin.m 327 Bytes
Newer Older
mashun1's avatar
v1  
mashun1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
// go:build darwin
#include "gpu_info_darwin.h"

uint64_t getRecommendedMaxVRAM() {
  id<MTLDevice> device = MTLCreateSystemDefaultDevice();
  uint64_t result = device.recommendedMaxWorkingSetSize;
  CFRelease(device);
  return result;
}

uint64_t getPhysicalMemory() {
  return [[NSProcessInfo processInfo] physicalMemory];
}