mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-24 06:44:36 +00:00
* update online kernel wrapper bundle all descriptors in a tuple
* change __CONSTANT__ to CONSTANT
* rename
* adding tuning
* added IsValidCompileParameter
* reorginze
* adding tunable for fp16 and int8
* fix kernel compile warning and bug fixes
* suppress warning about cast CONSTANT (address space 4) pointer
* fix building issue
[ROCm/composable_kernel commit: f63a23acb1]
45 lines
726 B
C++
45 lines
726 B
C++
#ifndef ONLINE_DRIVER_COMMON_HPP
|
|
#define ONLINE_DRIVER_COMMON_HPP
|
|
|
|
namespace ck_driver {
|
|
|
|
// greatest common divisor, aka highest common factor
|
|
inline int gcd(int x, int y)
|
|
{
|
|
if(x < 0)
|
|
{
|
|
return gcd(-x, y);
|
|
}
|
|
else if(y < 0)
|
|
{
|
|
return gcd(x, -y);
|
|
}
|
|
else if(x == y || x == 0)
|
|
{
|
|
return y;
|
|
}
|
|
else if(y == 0)
|
|
{
|
|
return x;
|
|
}
|
|
else if(x > y)
|
|
{
|
|
return gcd(x % y, y);
|
|
}
|
|
else
|
|
{
|
|
return gcd(x, y % x);
|
|
}
|
|
}
|
|
|
|
template <typename X,
|
|
typename... Ys,
|
|
typename std::enable_if<sizeof...(Ys) >= 2, bool>::type = false>
|
|
auto gcd(X x, Ys... ys)
|
|
{
|
|
return gcd(x, gcd(ys...));
|
|
}
|
|
|
|
} // namespace ck_driver
|
|
#endif
|