#pragma once #include "common.cuh" template struct ConstantMatrixDescriptor { __host__ __device__ ConstantMatrixDescriptor() { static_assert(NCol <= RowStride, "wrong! NCol > RowStride!"); } __host__ __device__ constexpr unsigned GetNumberOfRow() const { return NRow; } __host__ __device__ constexpr unsigned GetNumberOfColumn() const { return NCol; } __host__ __device__ constexpr unsigned GetRowStride() const { return RowStride; } __host__ __device__ constexpr unsigned GetElementSize() const { return NRow * NCol; } __host__ __device__ constexpr unsigned GetElementSpace() const { return NRow * RowStride; } __host__ __device__ unsigned Get1dIndex(unsigned irow, unsigned icol) const { return irow * RowStride + icol; } template __host__ __device__ constexpr auto MakeSubMatrixDescriptor(Number, Number) const { return ConstantMatrixDescriptor{}; } }; template __host__ __device__ constexpr auto make_ConstantMatrixDescriptor(Number, Number) { return ConstantMatrixDescriptor{}; } template __host__ __device__ constexpr auto make_ConstantMatrixDescriptor(Number, Number, Number) { return ConstantMatrixDescriptor{}; }