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

Function LoadCustomRuntimeLib

paddle/phi/backends/custom/custom_device.cc:1480–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1478}
1479
1480void LoadCustomRuntimeLib(const CustomRuntimeParams& runtime_params,
1481 std::unique_ptr<C_DeviceInterface> device_interface,
1482 const std::string& dso_lib_path,
1483 void* dso_handle) {
1484 if (ValidCustomCustomRuntimeParams(&runtime_params)) {
1485 auto device = std::make_unique<CustomDevice>(runtime_params.device_type,
1486 255,
1487 true,
1488 std::move(device_interface),
1489 dso_handle);
1490 if (false == DeviceManager::Register(std::move(device))) {
1491 LOG(WARNING) << "Skipped lib [" << dso_lib_path
1492 << "]. Register failed!!! there may be a "
1493 "Custom Runtime with the same name.";
1494 }
1495 if (runtime_params.pir_default_passes != nullptr) {
1496 CustomDevicePassManager::Instance()->SetCustomDevicePass(
1497 *(reinterpret_cast<std::vector<std::string>*>(
1498 runtime_params.pir_default_passes)));
1499 }
1500 } else {
1501 LOG(WARNING) << "Skipped lib [" << dso_lib_path
1502 << "]. Wrong Runtime parameters!!! please check the version "
1503 "compatibility between PaddlePaddle and Custom Runtime.";
1504 }
1505}
1506
1507#undef INTERFACE_UNIMPLEMENT
1508

Callers 3

LoadCustomLibFunction · 0.85
RegisterDeviceFunction · 0.85
RegisterDeviceFunction · 0.85

Calls 4

InstanceFunction · 0.85
SetCustomDevicePassMethod · 0.80
RegisterFunction · 0.50

Tested by 2

RegisterDeviceFunction · 0.68
RegisterDeviceFunction · 0.68