ROCm / MIOpen

AMD's Machine Intelligence Library
https://rocm.docs.amd.com/projects/MIOpen/en/latest/
Other
1.05k stars 219 forks source link

Move repetitive code into a dedicated header #2748

Open CAHEK7 opened 7 months ago

CAHEK7 commented 7 months ago

Based on https://github.com/ROCm/MIOpen/pull/2737#discussion_r1486010993 discussion. The project contains lots of copy-pasted functions like integer division with ceil rounding or various power of 2 checks, it would be nice to move that code into dedicated header and reuse it everywhere. Ideally it should be generalized and templated.

Kirpich30000 commented 7 months ago

There might be a use case for uin64_t versions as well. Also it would be good if we can improve naming if it's possible.

CAHEK7 commented 1 month ago

It's probably a good place for all those functions. https://github.com/ROCm/MIOpen/blob/develop/src/include/miopen/mlo_internal.hpp