-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add demo for comparison with libtorch (and pytorch) #1002
base: master
Are you sure you want to change the base?
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
@@ -0,0 +1,10 @@ | |||
cmake_minimum_required(VERSION 3.18 FATAL_ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a bot to run this as part of the CI?
} | ||
|
||
// Benchmark the time for 100 matrix multiplications. | ||
void benchmark_matrix_multiply(double x[M + N], double y[M]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it matters, but shouldn't x
's size be [M * N]
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also y
seems to be unused here.
std::mt19937 gen(42); | ||
|
||
// Generate random input data and labels. | ||
double x[M * N], y[M]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of the demos seem to benchmark the multiplication XX, which I believe only makes sense if M=N. Maybe transpose one of them so that it's always valid?
No description provided.