mirror of
https://github.com/StepanovPlaton/NeuralNetwork.git
synced 2026-04-03 20:30:39 +04:00
Tensor math OpenCL lib
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user