mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-03 05:01:25 +00:00
Add int4 example for convnd_fwd_bias_relu_add (#375)
* Add int4 example for convnd_fwd_bias_relu_add * Fix AddReluAdd for building without int4 support * Update CMakeLists.txt * Format * Convert int4 tensors for int8 kernel * Fix device memory allocation * Format * Format
This commit is contained in:
@@ -98,6 +98,18 @@ struct AddReluAdd
|
||||
int32_t c = b + x2;
|
||||
y = c;
|
||||
}
|
||||
|
||||
#ifdef CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4
|
||||
template <>
|
||||
__host__ __device__ constexpr void operator()<int4_t, int8_t, int4_t, int4_t>(
|
||||
int4_t& y, const int8_t& x0, const int4_t& x1, const int4_t& x2) const
|
||||
{
|
||||
int32_t a = x0 + x1;
|
||||
int32_t b = a > 0 ? a : 0;
|
||||
int32_t c = b + x2;
|
||||
y = c;
|
||||
}
|
||||
#endif // CK_EXPERIMENTAL_BIT_INT_EXTENSION_INT4
|
||||
};
|
||||
|
||||
struct AddHardswishAdd
|
||||
|
||||
Reference in New Issue
Block a user