mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-27 08:25:46 +00:00
Fixing most of the cppcheck errors. (#1142)
* fix cppcheck errors, first pass
* fix format
* fix returned value in examples
* add macro definitions for cppcheck
* fix the profile_gemm logic
* update the gemm profiler logic
* add more difinitions to cppcheck, fix couple more errors
* replace runtime error with message in device function
* fix a couple of int4 issues
* no return for fill function
* fix errors in data_types.hpp
* fix format
* fix few remaining errors
* fix errors in data_types.hpp
* fix last couple of errors in datat_types.hpp
[ROCm/composable_kernel commit: 180e572076]
This commit is contained in:
@@ -265,6 +265,8 @@ struct ReferenceColumnToImage : public device::BaseOperator
|
||||
|
||||
return 0;
|
||||
}
|
||||
throw std::runtime_error("Col2Img: number of dimensions should be between 1 and 3.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
float Run(const device::BaseArgument* p_arg,
|
||||
|
||||
@@ -313,6 +313,9 @@ struct ReferenceConvBwdData : public device::BaseOperator
|
||||
|
||||
return 0;
|
||||
}
|
||||
throw std::runtime_error(
|
||||
"Conv_bwd_data: number of dimensions must be between 1 and 3.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
float Run(const device::BaseArgument* p_arg,
|
||||
|
||||
@@ -265,6 +265,8 @@ struct ReferenceConvBwdWeight : public device::BaseOperator
|
||||
|
||||
return 0;
|
||||
}
|
||||
throw std::runtime_error("Conv_bwd: number of dimensions must be between 1 and 3.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
float Run(const device::BaseArgument* p_arg,
|
||||
|
||||
@@ -360,6 +360,8 @@ struct ReferenceConvFwd : public device::BaseOperator
|
||||
|
||||
return 0;
|
||||
}
|
||||
throw std::runtime_error("Conv_fwd: number of dimensions must be between 1 and 3.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
float Run(const device::BaseArgument* p_arg,
|
||||
|
||||
@@ -63,12 +63,11 @@ struct ReferenceGemm : public device::BaseOperator
|
||||
const int K = arg.a_m_k_.mDesc.GetLengths()[1];
|
||||
|
||||
AccDataType v_acc = 0;
|
||||
ComputeTypeA v_a = 0;
|
||||
ComputeTypeB v_b = 0;
|
||||
|
||||
for(int k = 0; k < K; ++k)
|
||||
{
|
||||
ComputeTypeA v_a;
|
||||
ComputeTypeB v_b;
|
||||
|
||||
// use PassThrough instead of ConvertBF16RTN for reference calculation
|
||||
if constexpr(is_same_v<AElementwiseOperation,
|
||||
ck::tensor_operation::element_wise::ConvertBF16RTN>)
|
||||
@@ -94,7 +93,7 @@ struct ReferenceGemm : public device::BaseOperator
|
||||
ck::type_convert<AccDataType>(v_a) * ck::type_convert<AccDataType>(v_b);
|
||||
}
|
||||
|
||||
CDataType v_c;
|
||||
CDataType v_c = 0;
|
||||
|
||||
arg.c_element_op_(v_c, v_acc);
|
||||
|
||||
|
||||
@@ -230,6 +230,8 @@ struct ReferenceImageToColumn : public device::BaseOperator
|
||||
|
||||
return 0;
|
||||
}
|
||||
throw std::runtime_error("Img2Col: number of dimensions should be between 1 and 3.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
float Run(const device::BaseArgument* p_arg,
|
||||
|
||||
@@ -106,9 +106,8 @@ struct DeviceOperationInstanceFactory<
|
||||
return op_ptrs;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
} // namespace instance
|
||||
} // namespace device
|
||||
} // namespace tensor_operation
|
||||
} // namespace ck
|
||||
#endif
|
||||
|
||||
@@ -114,9 +114,8 @@ struct DeviceOperationInstanceFactory<ck::tensor_operation::device::DeviceGemmSt
|
||||
return op_ptrs;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
} // namespace instance
|
||||
} // namespace device
|
||||
} // namespace tensor_operation
|
||||
} // namespace ck
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user