Skip to content

Instantly share code, notes, and snippets.

@keveman
Created July 19, 2019 21:51
Show Gist options
  • Save keveman/94da194efb62e346cb973ab85d2a4ce6 to your computer and use it in GitHub Desktop.
Save keveman/94da194efb62e346cb973ab85d2a4ce6 to your computer and use it in GitHub Desktop.
outer product
#include <iostream>
#include "peg.inl.h"
@macro void foo(const char* str) {
@meta auto x = parse(str);
@meta x.dump(std::cout);
}
float W[32][16], x[32], y[16];
void outer_product() {
@macro foo(`
all(i, j) in (32, 16)
W[i][j] = x[i] * y[j]
`);
}
int main() {
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment