Files
kvcache-ai--ktransformers/kt-kernel/operators/moe_kernel/test/mat_test.cpp
T
wehub-resource-sync ec436095dd
Book-CI / test (macos-latest) (push) Has been cancelled
Book-CI / test (ubuntu-latest) (push) Has been cancelled
Book-CI / test (windows-latest) (push) Has been cancelled
Release Fake Tag / publish (push) Has been cancelled
Deploy / deploy (macos-latest) (push) Has been cancelled
Deploy / deploy (ubuntu-latest) (push) Has been cancelled
Deploy / deploy (windows-latest) (push) Has been cancelled
Release to PyPI / Build & publish sglang-kt (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.11) (push) Has been cancelled
Release to PyPI / Build kt-kernel (Python 3.12) (push) Has been cancelled
Release to PyPI / Publish kt-kernel to PyPI (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:30:03 +08:00

23 lines
733 B
C++

#include "arm_kml.hpp"
int main() {
const size_t M = 128, N = 64;
float16_t* a = new float16_t[M * N];
float16_t* b = new float16_t[M * N];
float16_t* c = new float16_t[M * M];
float16_t* c_check = new float16_t[M * M];
for (size_t i = 0; i < M * N; i++) {
a[i] = static_cast<double>(std::rand()) / RAND_MAX / 10.0;
b[i] = static_cast<double>(std::rand()) / RAND_MAX / 10.0;
}
arm_kml::MatRef<float16_t> aref(a, M, N, M, CblasColMajor);
arm_kml::MatRef<float16_t> bref(b, N, M, M, CblasColMajor);
arm_kml::MatRef<float16_t> cref(c, M, M, M, CblasColMajor);
{
memset(c, 0, M * M * sizeof(float16_t));
memset(c_check, 0, M * M * sizeof(float16_t));
arm_kml::mul_mat(aref, bref, cref);
}
}