/opencl-matrix-add

GPU-accelerated matrix addition using OpenCL

Primary LanguageC++MIT LicenseMIT

opencl-matrix-add

License: MIT

demo

Build

$ clang++ main.cpp -o main -lOpenCL -std=c++11

Usage

Generate two input matrices with columns separated by commas and rows separated by newlines.

Example matrix:

1,2,3,4,5,6
1,1,1,1,1,1
1,1,1,1,1,1

Provide the two input matrices and number of columns:

$ ./main a.txt b.txt 6

Output is written to stdout so can be piped to a new file.

stdout:

$ ./main a.txt b.txt 6
2,4,6,8,10,12
2,2,2,2,2,2
6,2,6,2,6,2

or pipe:

$ ./main a.txt b.txt 6 > results.txt