Tensor math OpenCL lib

This commit is contained in:
2025-11-19 18:05:11 +04:00
parent c1874212ae
commit bd8b26c35a
12 changed files with 361 additions and 355 deletions

View File

@@ -1,20 +1,22 @@
// #include "cpu/tensor.hpp"
#ifdef USE_OPENCL
#include "opencl/tensor.hpp"
OpenCL openCL;
// TODO: GENERIC KERNELS
// TODO: Scalar mult
#elif USE_CPU
#include "cpu/tensor.hpp"
#endif
#include <iostream>
// TODO: GENERIC KERNELS
// TODO: Scalar mult
// TODO: TMult >2
OpenCL openCL;
int main() {
Tensor<float, 2> a = Tensor<float, 2>({8192, 8192}, 1);
Tensor<float, 2> b = Tensor<float, 2>({8192, 8192}, 1);
auto c = a % b;
Tensor<float, 2> d = Tensor<float, 2>(c);
d += 1;
std::cout << d.toString();
#ifdef USE_OPENCL
openCL.init("./");
#endif
Tensor<float, 2> a = Tensor<float, 2>({32, 32}, 2);
std::cout << a.toString();
return 0;
}