#ifndef _RKNN_MATMUL_API_DEMO_UTILS_H_ #define _RKNN_MATMUL_API_DEMO_UTILS_H_ #include #include #include namespace rknpu2 { template void generate_random_buffer(T *buffer, size_t size, std::vector range = {0.0f, 1.0f}); template void norm_layout_to_perf_layout(Ti *src, To *dst, int32_t M, int32_t K, int32_t subK, bool isInt4Type); template void norm_layout_to_native_layout(Ti *src, To *dst, int32_t K, int32_t N, int32_t subN, int32_t subK, bool isInt4Type); template void perf_layout_to_norm_layout(Ti *src, To *dst, int32_t M, int32_t K, int32_t K_remain, int32_t subK); template bool arraysEqual(const std::vector &arr1, const std::vector &arr2, float eps = 0.0001f); template bool arraysCosineSimilarity(const std::vector &arr1, const std::vector &arr2, float eps = 0.9999f); template void transposeB(const T *input, T *output, int32_t K, int32_t N); void transpose4bit(const int8_t *input, int8_t *output, int32_t K, int32_t N); } // namespace rknpu2 #endif