Skip to content

Commit

Permalink
fix custom_tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny1996 committed Oct 13, 2023
1 parent 8d8764a commit e263809
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/platform/profiler/custom_device/custom_tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ namespace platform {

CustomTracer::CustomTracer(const std::string& dev_type) : dev_type_(dev_type) {
#ifdef PADDLE_WITH_CUSTOM_DEVICE
auto selected_devices = phi::DeviceManager::GetSelectedDeviceList(dev_type_);
if (selected_devices.size()) {
phi::DeviceManager::SetDevice(dev_type_, selected_devices[0]);
}
phi::DeviceManager::ProfilerInitialize(dev_type_, &collector_, &context_);
#endif
}
Expand Down

0 comments on commit e263809

Please sign in to comment.