MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / Set

Method Set

paddle/phi/backends/device_code.cc:34–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32DeviceCodePool* DeviceCodePool::pool = nullptr;
33
34void DeviceCodePool::Set(std::unique_ptr<DeviceCode>&& code) {
35 Place place = code->GetPlace();
36 std::string name = code->GetName();
37
38 auto iter = device_codes_.find(place);
39 if (iter == device_codes_.end()) {
40 PADDLE_THROW(common::errors::NotFound(
41 "Place %s is not supported for runtime compiling.", place));
42 }
43
44 auto& codes_map = iter->second;
45 codes_map.emplace(name, std::move(code));
46}
47
48DeviceCode* DeviceCodePool::Get(const Place& place, const std::string& name) {
49 auto iter = device_codes_.find(place);

Callers 15

TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TestMainFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45
TESTFunction · 0.45

Calls 5

GetPlaceMethod · 0.45
GetNameMethod · 0.45
findMethod · 0.45
endMethod · 0.45
emplaceMethod · 0.45

Tested by 15

TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TestMainFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36
TESTFunction · 0.36