This source file includes following definitions.
- main
#include "Halide.h"
#include <stdio.h>
#include <thread>
using namespace Halide;
int main(int argc, char **argv) {
constexpr int total_iters = 1024;
constexpr int num_threads = 8;
std::vector<std::thread> threads;
for (int i = 0; i < num_threads; i++) {
threads.emplace_back([=]{
for (int i = 0; i < (total_iters / num_threads); i++) {
Func f;
Var x;
f(x) = x;
f.realize(100);
}
});
}
for (auto &t : threads) {
t.join();
}
printf("Success!\n");
return 0;
}