| 43 | namespace { |
| 44 | |
| 45 | bool IsGDRAvailable() { |
| 46 | #if defined(__APPLE__) |
| 47 | return false; |
| 48 | #elif defined(PLATFORM_WINDOWS) |
| 49 | return false; |
| 50 | #else |
| 51 | std::ifstream ifs("/proc/modules"); |
| 52 | string line; |
| 53 | while (std::getline(ifs, line)) { |
| 54 | auto sep = line.find(' '); |
| 55 | CHECK_NE(sep, std::string::npos); |
| 56 | if (line.substr(0, sep) == "nv_peer_mem") { |
| 57 | return true; |
| 58 | } |
| 59 | } |
| 60 | return false; |
| 61 | #endif |
| 62 | } |
| 63 | |
| 64 | int TryToReadNumaNode(ibv_device* device) { |
| 65 | #if defined(__APPLE__) |