MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / GetPinnedHostMemoryCase

Function GetPinnedHostMemoryCase

oneflow/core/memory/memory_case_util.cpp:30–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void GetPinnedHostMemoryCase(const MemoryCase& mem_case, MemoryCase* ret) {
31 ret->set_device_type(DeviceType::kCPU);
32 ret->set_device_id(0);
33 if (!IsHostMem(mem_case)) {
34 ret->set_pinned_device_type(mem_case.device_type());
35 ret->set_pinned_device_id(mem_case.device_id());
36 }
37}
38
39MemoryCase GetPinnedHostMemoryCase(const MemoryCase& mem_case) {
40 MemoryCase ret;

Calls 4

IsHostMemFunction · 0.85
set_device_typeMethod · 0.80
device_typeMethod · 0.45
device_idMethod · 0.45

Tested by

no test coverage detected