Skip to content

Commit

Permalink
Add cu::Device::getPower
Browse files Browse the repository at this point in the history
  • Loading branch information
csbnw committed Sep 24, 2024
1 parent 6736c37 commit fd144e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
`cu::DeviceMemory` object
- Added `cu::DeviceMemory::memset()`
- Added `cu::Stream::memsetAsync()`
- Added `cu::Device::getPower()`

### Changed

Expand Down
8 changes: 7 additions & 1 deletion include/cudawrappers/nvml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ class Device {
return clockMhz;
}

unsigned int getPower() {
unsigned int power;
checkNvmlCall(nvmlDeviceGetPowerUsage(device_, &power));
return power;
}

private:
nvmlDevice_t device_;
};
} // namespace nvml

#endif // __HIP_PLATFORM_AMD__
#endif // NVML_H
#endif // NVML_H

0 comments on commit fd144e0

Please sign in to comment.