Skip to content

Commit

Permalink
Update deviceimpl.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
caikun-pjlab authored Mar 31, 2024
1 parent 99bd01c commit 0f98da3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dipu/torch_dipu/csrc_dipu/vendor/ascend/deviceimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ void finalizeVendor() { DIPU_CALLACLRT(aclFinalize()); }

deviceId_t current_device() {
if (currentDeviceIndex < 0) {
setDevice(-1); // need fix......
int device_index = 0;
DIPU_CALLACLRT(::aclrtGetDevice(&device_index))
return device_index;
// setDevice(-1); // need fix......
// DIPU_CALLACLRT(::aclrtGetDevice(&currentDeviceIndex))
}
return static_cast<deviceId_t>(currentDeviceIndex);
Expand Down

0 comments on commit 0f98da3

Please sign in to comment.