mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-04 05:31:24 +00:00
N-D Tensor Contraction example, instance, and client example (#270)
* adding contraction * add contraction example * update examle * update example * format * update readme * clean header * clean header * contraction with multiple D * rename * fix naming issue; add instances for contraction+bilinear * change assumed virtual layout of contraction; add client example * update example * update * contraction+scale * use type_convert * rename
This commit is contained in:
@@ -24,9 +24,25 @@ struct PassThrough
|
||||
};
|
||||
};
|
||||
|
||||
struct Scale
|
||||
{
|
||||
__host__ __device__ Scale(float scale) : scale_(scale) {}
|
||||
|
||||
template <typename Y, typename X>
|
||||
__host__ __device__ void operator()(Y& y, const X& x) const;
|
||||
|
||||
template <>
|
||||
__host__ __device__ void operator()<float, float>(float& y, const float& x) const
|
||||
{
|
||||
y = scale_ * x;
|
||||
};
|
||||
|
||||
float scale_;
|
||||
};
|
||||
|
||||
struct UnaryDivide
|
||||
{
|
||||
__host__ __device__ UnaryDivide(const int32_t divider = 1) : divider_(divider){};
|
||||
__host__ __device__ UnaryDivide(const int32_t divider = 1) : divider_(divider) {}
|
||||
|
||||
template <typename T>
|
||||
__host__ __device__ void operator()(T& y, const T& x) const
|
||||
|
||||
Reference in New Issue
Block a user