Commit f19e41bb authored by Alan Turner's avatar Alan Turner
Browse files

Fix cppcheck + other cleanup

parent 4acc55c3
...@@ -49,12 +49,12 @@ struct gemm_softmax_gemm ...@@ -49,12 +49,12 @@ struct gemm_softmax_gemm
return pack(f(self.op, "op"), f(self.scale, "scale")); return pack(f(self.op, "op"), f(self.scale, "scale"));
} }
std::string name() const { return "pre_gemm_softmax_gemm"; } std::string name() const { return "gemm_softmax_gemm"; }
void check_gemm_shape(const shape& s) const void check_gemm_shape(const shape& s) const
{ {
if(not contains(range(s.strides().rbegin(), s.strides().rbegin() + 3), 1)) if(not contains(range(s.strides().rbegin(), s.strides().rbegin() + 3), 1))
MIGRAPHX_THROW("Invalid shape for ck_gemm_softmax_gemm"); MIGRAPHX_THROW("Invalid shape for " + name());
} }
shape compute_shape(std::vector<shape> inputs, const std::vector<module_ref>&) const shape compute_shape(std::vector<shape> inputs, const std::vector<module_ref>&) const
......
...@@ -83,6 +83,7 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler> ...@@ -83,6 +83,7 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
const auto& b_shape = inputs[1]; const auto& b_shape = inputs[1];
const auto& c_shape = inputs.back(); const auto& c_shape = inputs.back();
// cppcheck-suppress unreadVariable
auto rank = a_shape.ndim(); auto rank = a_shape.ndim();
auto batch_count = get_batch_count(c_shape); auto batch_count = get_batch_count(c_shape);
auto m = c_shape.lens()[rank - 2]; auto m = c_shape.lens()[rank - 2];
......
...@@ -90,6 +90,7 @@ struct ck_gemm_softmax_gemm_compiler : compiler<ck_gemm_softmax_gemm_compiler> ...@@ -90,6 +90,7 @@ struct ck_gemm_softmax_gemm_compiler : compiler<ck_gemm_softmax_gemm_compiler>
const auto& b1_shape = inputs[2]; const auto& b1_shape = inputs[2];
const auto& c_shape = inputs.back(); const auto& c_shape = inputs.back();
// cppcheck-suppress unreadVariable
auto rank = a_shape.ndim(); auto rank = a_shape.ndim();
auto batch_count = get_batch_count(c_shape); auto batch_count = get_batch_count(c_shape);
auto m = c_shape.lens()[rank - 2]; auto m = c_shape.lens()[rank - 2];
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#ifndef MIGRAPHX_GUARD_KERNELS_CK_GEMM_HPP #ifndef MIGRAPHX_GUARD_KERNELS_CK_GEMM_SOFTMAX_GEMM_HPP
#define MIGRAPHX_GUARD_KERNELS_CK_GEMM_HPP #define MIGRAPHX_GUARD_KERNELS_CK_GEMM_SOFTMAX_GEMM_HPP
#include <migraphx/kernels/index.hpp> #include <migraphx/kernels/index.hpp>
#include <migraphx/kernels/algorithm.hpp> #include <migraphx/kernels/algorithm.hpp>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment