summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--CMakeLists.txt47
-rw-r--r--README.md2
-rw-r--r--include/clblast.h4
-rw-r--r--include/clblast_c.h4
-rw-r--r--include/internal/routine.h144
-rw-r--r--samples/sgemm.cpp (renamed from samples/sgemm.cc)0
-rw-r--r--scripts/database/database.py2
-rw-r--r--scripts/generator/generator.py34
-rw-r--r--src/buffer_test.hpp121
-rw-r--r--src/cache.cpp (renamed from src/cache.cc)6
-rw-r--r--src/cache.hpp (renamed from include/internal/cache.h)6
-rw-r--r--src/clblast.cpp (renamed from src/clblast.cc)104
-rw-r--r--src/clblast_c.cpp (renamed from src/clblast_c.cc)2
-rw-r--r--src/clpp11.hpp (renamed from include/internal/clpp11.h)0
-rw-r--r--src/database/database.cpp (renamed from src/database.cc)24
-rw-r--r--src/database/database.hpp (renamed from include/internal/database.h)2
-rw-r--r--src/database/kernels/copy.hpp (renamed from include/internal/database/copy.h)0
-rw-r--r--src/database/kernels/pad.hpp (renamed from include/internal/database/pad.h)0
-rw-r--r--src/database/kernels/padtranspose.hpp (renamed from include/internal/database/padtranspose.h)0
-rw-r--r--src/database/kernels/transpose.hpp (renamed from include/internal/database/transpose.h)0
-rw-r--r--src/database/kernels/xaxpy.hpp (renamed from include/internal/database/xaxpy.h)0
-rw-r--r--src/database/kernels/xdot.hpp (renamed from include/internal/database/xdot.h)0
-rw-r--r--src/database/kernels/xgemm.hpp (renamed from include/internal/database/xgemm.h)0
-rw-r--r--src/database/kernels/xgemv.hpp (renamed from include/internal/database/xgemv.h)0
-rw-r--r--src/database/kernels/xger.hpp (renamed from include/internal/database/xger.h)0
-rw-r--r--src/public_api.hpp (renamed from include/internal/public_api.h)0
-rw-r--r--src/routine.cc431
-rw-r--r--src/routine.cpp131
-rw-r--r--src/routine.hpp68
-rw-r--r--src/routines/common.cpp65
-rw-r--r--src/routines/common.hpp173
-rw-r--r--src/routines/level1/xamax.cpp (renamed from src/routines/level1/xamax.cc)23
-rw-r--r--src/routines/level1/xamax.hpp (renamed from include/internal/routines/level1/xamax.h)20
-rw-r--r--src/routines/level1/xasum.cpp (renamed from src/routines/level1/xasum.cc)23
-rw-r--r--src/routines/level1/xasum.hpp (renamed from include/internal/routines/level1/xasum.h)20
-rw-r--r--src/routines/level1/xaxpy.cpp (renamed from src/routines/level1/xaxpy.cc)23
-rw-r--r--src/routines/level1/xaxpy.hpp (renamed from include/internal/routines/level1/xaxpy.h)20
-rw-r--r--src/routines/level1/xcopy.cpp (renamed from src/routines/level1/xcopy.cc)23
-rw-r--r--src/routines/level1/xcopy.hpp (renamed from include/internal/routines/level1/xcopy.h)19
-rw-r--r--src/routines/level1/xdot.cpp (renamed from src/routines/level1/xdot.cc)25
-rw-r--r--src/routines/level1/xdot.hpp (renamed from include/internal/routines/level1/xdot.h)21
-rw-r--r--src/routines/level1/xdotc.cpp (renamed from src/routines/level1/xdotc.cc)2
-rw-r--r--src/routines/level1/xdotc.hpp (renamed from include/internal/routines/level1/xdotc.h)2
-rw-r--r--src/routines/level1/xdotu.cpp (renamed from src/routines/level1/xdotu.cc)2
-rw-r--r--src/routines/level1/xdotu.hpp (renamed from include/internal/routines/level1/xdotu.h)2
-rw-r--r--src/routines/level1/xmax.hpp (renamed from include/internal/routines/level1/xmax.h)4
-rw-r--r--src/routines/level1/xmin.hpp (renamed from include/internal/routines/level1/xmin.h)4
-rw-r--r--src/routines/level1/xnrm2.cpp (renamed from src/routines/level1/xnrm2.cc)23
-rw-r--r--src/routines/level1/xnrm2.hpp (renamed from include/internal/routines/level1/xnrm2.h)20
-rw-r--r--src/routines/level1/xscal.cpp (renamed from src/routines/level1/xscal.cc)21
-rw-r--r--src/routines/level1/xscal.hpp (renamed from include/internal/routines/level1/xscal.h)18
-rw-r--r--src/routines/level1/xsum.hpp (renamed from include/internal/routines/level1/xsum.h)4
-rw-r--r--src/routines/level1/xswap.cpp (renamed from src/routines/level1/xswap.cc)23
-rw-r--r--src/routines/level1/xswap.hpp (renamed from include/internal/routines/level1/xswap.h)19
-rw-r--r--src/routines/level2/xgbmv.cpp (renamed from src/routines/level2/xgbmv.cc)2
-rw-r--r--src/routines/level2/xgbmv.hpp (renamed from include/internal/routines/level2/xgbmv.h)2
-rw-r--r--src/routines/level2/xgemv.cpp (renamed from src/routines/level2/xgemv.cc)25
-rw-r--r--src/routines/level2/xgemv.hpp (renamed from include/internal/routines/level2/xgemv.h)22
-rw-r--r--src/routines/level2/xger.cpp (renamed from src/routines/level2/xger.cc)23
-rw-r--r--src/routines/level2/xger.hpp (renamed from include/internal/routines/level2/xger.h)21
-rw-r--r--src/routines/level2/xgerc.cpp (renamed from src/routines/level2/xgerc.cc)2
-rw-r--r--src/routines/level2/xgerc.hpp (renamed from include/internal/routines/level2/xgerc.h)2
-rw-r--r--src/routines/level2/xgeru.cpp (renamed from src/routines/level2/xgeru.cc)2
-rw-r--r--src/routines/level2/xgeru.hpp (renamed from include/internal/routines/level2/xgeru.h)2
-rw-r--r--src/routines/level2/xhbmv.cpp (renamed from src/routines/level2/xhbmv.cc)2
-rw-r--r--src/routines/level2/xhbmv.hpp (renamed from include/internal/routines/level2/xhbmv.h)2
-rw-r--r--src/routines/level2/xhemv.cpp (renamed from src/routines/level2/xhemv.cc)2
-rw-r--r--src/routines/level2/xhemv.hpp (renamed from include/internal/routines/level2/xhemv.h)2
-rw-r--r--src/routines/level2/xher.cpp (renamed from src/routines/level2/xher.cc)23
-rw-r--r--src/routines/level2/xher.hpp (renamed from include/internal/routines/level2/xher.h)21
-rw-r--r--src/routines/level2/xher2.cpp (renamed from src/routines/level2/xher2.cc)25
-rw-r--r--src/routines/level2/xher2.hpp (renamed from include/internal/routines/level2/xher2.h)22
-rw-r--r--src/routines/level2/xhpmv.cpp (renamed from src/routines/level2/xhpmv.cc)2
-rw-r--r--src/routines/level2/xhpmv.hpp (renamed from include/internal/routines/level2/xhpmv.h)2
-rw-r--r--src/routines/level2/xhpr.cpp (renamed from src/routines/level2/xhpr.cc)2
-rw-r--r--src/routines/level2/xhpr.hpp (renamed from include/internal/routines/level2/xhpr.h)2
-rw-r--r--src/routines/level2/xhpr2.cpp (renamed from src/routines/level2/xhpr2.cc)2
-rw-r--r--src/routines/level2/xhpr2.hpp (renamed from include/internal/routines/level2/xhpr2.h)2
-rw-r--r--src/routines/level2/xsbmv.cpp (renamed from src/routines/level2/xsbmv.cc)2
-rw-r--r--src/routines/level2/xsbmv.hpp (renamed from include/internal/routines/level2/xsbmv.h)2
-rw-r--r--src/routines/level2/xspmv.cpp (renamed from src/routines/level2/xspmv.cc)2
-rw-r--r--src/routines/level2/xspmv.hpp (renamed from include/internal/routines/level2/xspmv.h)2
-rw-r--r--src/routines/level2/xspr.cpp (renamed from src/routines/level2/xspr.cc)2
-rw-r--r--src/routines/level2/xspr.hpp (renamed from include/internal/routines/level2/xspr.h)2
-rw-r--r--src/routines/level2/xspr2.cpp (renamed from src/routines/level2/xspr2.cc)2
-rw-r--r--src/routines/level2/xspr2.hpp (renamed from include/internal/routines/level2/xspr2.h)2
-rw-r--r--src/routines/level2/xsymv.cpp (renamed from src/routines/level2/xsymv.cc)2
-rw-r--r--src/routines/level2/xsymv.hpp (renamed from include/internal/routines/level2/xsymv.h)2
-rw-r--r--src/routines/level2/xsyr.cpp (renamed from src/routines/level2/xsyr.cc)2
-rw-r--r--src/routines/level2/xsyr.hpp (renamed from include/internal/routines/level2/xsyr.h)2
-rw-r--r--src/routines/level2/xsyr2.cpp (renamed from src/routines/level2/xsyr2.cc)2
-rw-r--r--src/routines/level2/xsyr2.hpp (renamed from include/internal/routines/level2/xsyr2.h)2
-rw-r--r--src/routines/level2/xtbmv.cpp (renamed from src/routines/level2/xtbmv.cc)2
-rw-r--r--src/routines/level2/xtbmv.hpp (renamed from include/internal/routines/level2/xtbmv.h)8
-rw-r--r--src/routines/level2/xtpmv.cpp (renamed from src/routines/level2/xtpmv.cc)2
-rw-r--r--src/routines/level2/xtpmv.hpp (renamed from include/internal/routines/level2/xtpmv.h)8
-rw-r--r--src/routines/level2/xtrmv.cpp (renamed from src/routines/level2/xtrmv.cc)2
-rw-r--r--src/routines/level2/xtrmv.hpp (renamed from include/internal/routines/level2/xtrmv.h)8
-rw-r--r--src/routines/level3/xgemm.cpp (renamed from src/routines/level3/xgemm.cc)31
-rw-r--r--src/routines/level3/xgemm.hpp (renamed from include/internal/routines/level3/xgemm.h)20
-rw-r--r--src/routines/level3/xhemm.cpp (renamed from src/routines/level3/xhemm.cc)8
-rw-r--r--src/routines/level3/xhemm.hpp (renamed from include/internal/routines/level3/xhemm.h)18
-rw-r--r--src/routines/level3/xher2k.cpp (renamed from src/routines/level3/xher2k.cc)34
-rw-r--r--src/routines/level3/xher2k.hpp (renamed from include/internal/routines/level3/xher2k.h)22
-rw-r--r--src/routines/level3/xherk.cpp (renamed from src/routines/level3/xherk.cc)26
-rw-r--r--src/routines/level3/xherk.hpp (renamed from include/internal/routines/level3/xherk.h)21
-rw-r--r--src/routines/level3/xsymm.cpp (renamed from src/routines/level3/xsymm.cc)8
-rw-r--r--src/routines/level3/xsymm.hpp (renamed from include/internal/routines/level3/xsymm.h)18
-rw-r--r--src/routines/level3/xsyr2k.cpp (renamed from src/routines/level3/xsyr2k.cc)33
-rw-r--r--src/routines/level3/xsyr2k.hpp (renamed from include/internal/routines/level3/xsyr2k.h)22
-rw-r--r--src/routines/level3/xsyrk.cpp (renamed from src/routines/level3/xsyrk.cc)27
-rw-r--r--src/routines/level3/xsyrk.hpp (renamed from include/internal/routines/level3/xsyrk.h)21
-rw-r--r--src/routines/level3/xtrmm.cpp (renamed from src/routines/level3/xtrmm.cc)8
-rw-r--r--src/routines/level3/xtrmm.hpp (renamed from include/internal/routines/level3/xtrmm.h)18
-rw-r--r--src/routines/levelx/xomatcopy.cpp (renamed from src/routines/levelx/xomatcopy.cc)21
-rw-r--r--src/routines/levelx/xomatcopy.hpp (renamed from include/internal/routines/levelx/xomatcopy.h)17
-rw-r--r--src/tuning/kernels/copy_fast.cpp (renamed from src/tuning/copy_fast.cc)4
-rw-r--r--src/tuning/kernels/copy_pad.cpp (renamed from src/tuning/copy_pad.cc)4
-rw-r--r--src/tuning/kernels/transpose_fast.cpp (renamed from src/tuning/transpose_fast.cc)4
-rw-r--r--src/tuning/kernels/transpose_pad.cpp (renamed from src/tuning/transpose_pad.cc)4
-rw-r--r--src/tuning/kernels/xaxpy.cpp (renamed from src/tuning/xaxpy.cc)4
-rw-r--r--src/tuning/kernels/xdot.cpp (renamed from src/tuning/xdot.cc)4
-rw-r--r--src/tuning/kernels/xgemm.cpp (renamed from src/tuning/xgemm.cc)4
-rw-r--r--src/tuning/kernels/xgemv.cpp (renamed from src/tuning/xgemv.cc)4
-rw-r--r--src/tuning/kernels/xger.cpp (renamed from src/tuning/xger.cc)4
-rw-r--r--src/tuning/tuning.hpp (renamed from include/internal/tuning.h)2
-rw-r--r--src/utilities.cpp (renamed from src/utilities.cc)9
-rw-r--r--src/utilities.hpp (renamed from include/internal/utilities.h)11
-rw-r--r--test/correctness/routines/level1/xamax.cpp (renamed from test/correctness/routines/level1/xamax.cc)4
-rw-r--r--test/correctness/routines/level1/xasum.cpp (renamed from test/correctness/routines/level1/xasum.cc)4
-rw-r--r--test/correctness/routines/level1/xaxpy.cpp (renamed from test/correctness/routines/level1/xaxpy.cc)4
-rw-r--r--test/correctness/routines/level1/xcopy.cpp (renamed from test/correctness/routines/level1/xcopy.cc)4
-rw-r--r--test/correctness/routines/level1/xdot.cpp (renamed from test/correctness/routines/level1/xdot.cc)4
-rw-r--r--test/correctness/routines/level1/xdotc.cpp (renamed from test/correctness/routines/level1/xdotc.cc)4
-rw-r--r--test/correctness/routines/level1/xdotu.cpp (renamed from test/correctness/routines/level1/xdotu.cc)4
-rw-r--r--test/correctness/routines/level1/xnrm2.cpp (renamed from test/correctness/routines/level1/xnrm2.cc)4
-rw-r--r--test/correctness/routines/level1/xrot.cpp (renamed from test/correctness/routines/level1/xrot.cc)4
-rw-r--r--test/correctness/routines/level1/xrotg.cpp (renamed from test/correctness/routines/level1/xrotg.cc)4
-rw-r--r--test/correctness/routines/level1/xrotm.cpp (renamed from test/correctness/routines/level1/xrotm.cc)4
-rw-r--r--test/correctness/routines/level1/xrotmg.cpp (renamed from test/correctness/routines/level1/xrotmg.cc)4
-rw-r--r--test/correctness/routines/level1/xscal.cpp (renamed from test/correctness/routines/level1/xscal.cc)4
-rw-r--r--test/correctness/routines/level1/xswap.cpp (renamed from test/correctness/routines/level1/xswap.cc)4
-rw-r--r--test/correctness/routines/level2/xgbmv.cpp (renamed from test/correctness/routines/level2/xgbmv.cc)4
-rw-r--r--test/correctness/routines/level2/xgemv.cpp (renamed from test/correctness/routines/level2/xgemv.cc)4
-rw-r--r--test/correctness/routines/level2/xger.cpp (renamed from test/correctness/routines/level2/xger.cc)4
-rw-r--r--test/correctness/routines/level2/xgerc.cpp (renamed from test/correctness/routines/level2/xgerc.cc)4
-rw-r--r--test/correctness/routines/level2/xgeru.cpp (renamed from test/correctness/routines/level2/xgeru.cc)4
-rw-r--r--test/correctness/routines/level2/xhbmv.cpp (renamed from test/correctness/routines/level2/xhbmv.cc)4
-rw-r--r--test/correctness/routines/level2/xhemv.cpp (renamed from test/correctness/routines/level2/xhemv.cc)4
-rw-r--r--test/correctness/routines/level2/xher.cpp (renamed from test/correctness/routines/level2/xher.cc)4
-rw-r--r--test/correctness/routines/level2/xher2.cpp (renamed from test/correctness/routines/level2/xher2.cc)4
-rw-r--r--test/correctness/routines/level2/xhpmv.cpp (renamed from test/correctness/routines/level2/xhpmv.cc)4
-rw-r--r--test/correctness/routines/level2/xhpr.cpp (renamed from test/correctness/routines/level2/xhpr.cc)4
-rw-r--r--test/correctness/routines/level2/xhpr2.cpp (renamed from test/correctness/routines/level2/xhpr2.cc)4
-rw-r--r--test/correctness/routines/level2/xsbmv.cpp (renamed from test/correctness/routines/level2/xsbmv.cc)4
-rw-r--r--test/correctness/routines/level2/xspmv.cpp (renamed from test/correctness/routines/level2/xspmv.cc)4
-rw-r--r--test/correctness/routines/level2/xspr.cpp (renamed from test/correctness/routines/level2/xspr.cc)4
-rw-r--r--test/correctness/routines/level2/xspr2.cpp (renamed from test/correctness/routines/level2/xspr2.cc)4
-rw-r--r--test/correctness/routines/level2/xsymv.cpp (renamed from test/correctness/routines/level2/xsymv.cc)4
-rw-r--r--test/correctness/routines/level2/xsyr.cpp (renamed from test/correctness/routines/level2/xsyr.cc)4
-rw-r--r--test/correctness/routines/level2/xsyr2.cpp (renamed from test/correctness/routines/level2/xsyr2.cc)4
-rw-r--r--test/correctness/routines/level2/xtbmv.cpp (renamed from test/correctness/routines/level2/xtbmv.cc)4
-rw-r--r--test/correctness/routines/level2/xtbsv.cpp (renamed from test/correctness/routines/level2/xtbsv.cc)4
-rw-r--r--test/correctness/routines/level2/xtpmv.cpp (renamed from test/correctness/routines/level2/xtpmv.cc)4
-rw-r--r--test/correctness/routines/level2/xtpsv.cpp (renamed from test/correctness/routines/level2/xtpsv.cc)4
-rw-r--r--test/correctness/routines/level2/xtrmv.cpp (renamed from test/correctness/routines/level2/xtrmv.cc)4
-rw-r--r--test/correctness/routines/level2/xtrsv.cpp (renamed from test/correctness/routines/level2/xtrsv.cc)4
-rw-r--r--test/correctness/routines/level3/xgemm.cpp (renamed from test/correctness/routines/level3/xgemm.cc)4
-rw-r--r--test/correctness/routines/level3/xhemm.cpp (renamed from test/correctness/routines/level3/xhemm.cc)4
-rw-r--r--test/correctness/routines/level3/xher2k.cpp (renamed from test/correctness/routines/level3/xher2k.cc)4
-rw-r--r--test/correctness/routines/level3/xherk.cpp (renamed from test/correctness/routines/level3/xherk.cc)4
-rw-r--r--test/correctness/routines/level3/xsymm.cpp (renamed from test/correctness/routines/level3/xsymm.cc)4
-rw-r--r--test/correctness/routines/level3/xsyr2k.cpp (renamed from test/correctness/routines/level3/xsyr2k.cc)4
-rw-r--r--test/correctness/routines/level3/xsyrk.cpp (renamed from test/correctness/routines/level3/xsyrk.cc)4
-rw-r--r--test/correctness/routines/level3/xtrmm.cpp (renamed from test/correctness/routines/level3/xtrmm.cc)4
-rw-r--r--test/correctness/routines/level3/xtrsm.cpp (renamed from test/correctness/routines/level3/xtrsm.cc)4
-rw-r--r--test/correctness/routines/levelx/xomatcopy.cpp (renamed from test/correctness/routines/levelx/xomatcopy.cc)4
-rw-r--r--test/correctness/testblas.cpp (renamed from test/correctness/testblas.cc)2
-rw-r--r--test/correctness/testblas.hpp (renamed from test/correctness/testblas.h)2
-rw-r--r--test/correctness/tester.cpp (renamed from test/correctness/tester.cc)4
-rw-r--r--test/correctness/tester.hpp (renamed from test/correctness/tester.h)2
-rw-r--r--test/performance/client.cpp (renamed from test/performance/client.cc)2
-rw-r--r--test/performance/client.hpp (renamed from test/performance/client.h)2
-rw-r--r--test/performance/routines/level1/xamax.cpp (renamed from test/performance/routines/level1/xamax.cc)4
-rw-r--r--test/performance/routines/level1/xasum.cpp (renamed from test/performance/routines/level1/xasum.cc)4
-rw-r--r--test/performance/routines/level1/xaxpy.cpp (renamed from test/performance/routines/level1/xaxpy.cc)4
-rw-r--r--test/performance/routines/level1/xcopy.cpp (renamed from test/performance/routines/level1/xcopy.cc)4
-rw-r--r--test/performance/routines/level1/xdot.cpp (renamed from test/performance/routines/level1/xdot.cc)4
-rw-r--r--test/performance/routines/level1/xdotc.cpp (renamed from test/performance/routines/level1/xdotc.cc)4
-rw-r--r--test/performance/routines/level1/xdotu.cpp (renamed from test/performance/routines/level1/xdotu.cc)4
-rw-r--r--test/performance/routines/level1/xnrm2.cpp (renamed from test/performance/routines/level1/xnrm2.cc)4
-rw-r--r--test/performance/routines/level1/xrot.cpp (renamed from test/performance/routines/level1/xrot.cc)4
-rw-r--r--test/performance/routines/level1/xrotg.cpp (renamed from test/performance/routines/level1/xrotg.cc)4
-rw-r--r--test/performance/routines/level1/xrotm.cpp (renamed from test/performance/routines/level1/xrotm.cc)4
-rw-r--r--test/performance/routines/level1/xrotmg.cpp (renamed from test/performance/routines/level1/xrotmg.cc)4
-rw-r--r--test/performance/routines/level1/xscal.cpp (renamed from test/performance/routines/level1/xscal.cc)4
-rw-r--r--test/performance/routines/level1/xswap.cpp (renamed from test/performance/routines/level1/xswap.cc)4
-rw-r--r--test/performance/routines/level2/xgbmv.cpp (renamed from test/performance/routines/level2/xgbmv.cc)4
-rw-r--r--test/performance/routines/level2/xgemv.cpp (renamed from test/performance/routines/level2/xgemv.cc)4
-rw-r--r--test/performance/routines/level2/xger.cpp (renamed from test/performance/routines/level2/xger.cc)4
-rw-r--r--test/performance/routines/level2/xgerc.cpp (renamed from test/performance/routines/level2/xgerc.cc)4
-rw-r--r--test/performance/routines/level2/xgeru.cpp (renamed from test/performance/routines/level2/xgeru.cc)4
-rw-r--r--test/performance/routines/level2/xhbmv.cpp (renamed from test/performance/routines/level2/xhbmv.cc)4
-rw-r--r--test/performance/routines/level2/xhemv.cpp (renamed from test/performance/routines/level2/xhemv.cc)4
-rw-r--r--test/performance/routines/level2/xher.cpp (renamed from test/performance/routines/level2/xher.cc)4
-rw-r--r--test/performance/routines/level2/xher2.cpp (renamed from test/performance/routines/level2/xher2.cc)4
-rw-r--r--test/performance/routines/level2/xhpmv.cpp (renamed from test/performance/routines/level2/xhpmv.cc)4
-rw-r--r--test/performance/routines/level2/xhpr.cpp (renamed from test/performance/routines/level2/xhpr.cc)4
-rw-r--r--test/performance/routines/level2/xhpr2.cpp (renamed from test/performance/routines/level2/xhpr2.cc)4
-rw-r--r--test/performance/routines/level2/xsbmv.cpp (renamed from test/performance/routines/level2/xsbmv.cc)4
-rw-r--r--test/performance/routines/level2/xspmv.cpp (renamed from test/performance/routines/level2/xspmv.cc)4
-rw-r--r--test/performance/routines/level2/xspr.cpp (renamed from test/performance/routines/level2/xspr.cc)4
-rw-r--r--test/performance/routines/level2/xspr2.cpp (renamed from test/performance/routines/level2/xspr2.cc)4
-rw-r--r--test/performance/routines/level2/xsymv.cpp (renamed from test/performance/routines/level2/xsymv.cc)4
-rw-r--r--test/performance/routines/level2/xsyr.cpp (renamed from test/performance/routines/level2/xsyr.cc)4
-rw-r--r--test/performance/routines/level2/xsyr2.cpp (renamed from test/performance/routines/level2/xsyr2.cc)4
-rw-r--r--test/performance/routines/level2/xtbmv.cpp (renamed from test/performance/routines/level2/xtbmv.cc)4
-rw-r--r--test/performance/routines/level2/xtbsv.cpp (renamed from test/performance/routines/level2/xtbsv.cc)4
-rw-r--r--test/performance/routines/level2/xtpmv.cpp (renamed from test/performance/routines/level2/xtpmv.cc)4
-rw-r--r--test/performance/routines/level2/xtpsv.cpp (renamed from test/performance/routines/level2/xtpsv.cc)4
-rw-r--r--test/performance/routines/level2/xtrmv.cpp (renamed from test/performance/routines/level2/xtrmv.cc)4
-rw-r--r--test/performance/routines/level2/xtrsv.cpp (renamed from test/performance/routines/level2/xtrsv.cc)4
-rw-r--r--test/performance/routines/level3/xgemm.cpp (renamed from test/performance/routines/level3/xgemm.cc)4
-rw-r--r--test/performance/routines/level3/xhemm.cpp (renamed from test/performance/routines/level3/xhemm.cc)4
-rw-r--r--test/performance/routines/level3/xher2k.cpp (renamed from test/performance/routines/level3/xher2k.cc)4
-rw-r--r--test/performance/routines/level3/xherk.cpp (renamed from test/performance/routines/level3/xherk.cc)4
-rw-r--r--test/performance/routines/level3/xsymm.cpp (renamed from test/performance/routines/level3/xsymm.cc)4
-rw-r--r--test/performance/routines/level3/xsyr2k.cpp (renamed from test/performance/routines/level3/xsyr2k.cc)4
-rw-r--r--test/performance/routines/level3/xsyrk.cpp (renamed from test/performance/routines/level3/xsyrk.cc)4
-rw-r--r--test/performance/routines/level3/xtrmm.cpp (renamed from test/performance/routines/level3/xtrmm.cc)4
-rw-r--r--test/performance/routines/level3/xtrsm.cpp (renamed from test/performance/routines/level3/xtrsm.cc)4
-rw-r--r--test/performance/routines/levelx/xomatcopy.cpp (renamed from test/performance/routines/levelx/xomatcopy.cc)4
-rw-r--r--test/routines/level1/xamax.hpp (renamed from test/routines/level1/xamax.h)4
-rw-r--r--test/routines/level1/xasum.hpp (renamed from test/routines/level1/xasum.h)4
-rw-r--r--test/routines/level1/xaxpy.hpp (renamed from test/routines/level1/xaxpy.h)4
-rw-r--r--test/routines/level1/xcopy.hpp (renamed from test/routines/level1/xcopy.h)4
-rw-r--r--test/routines/level1/xdot.hpp (renamed from test/routines/level1/xdot.h)4
-rw-r--r--test/routines/level1/xdotc.hpp (renamed from test/routines/level1/xdotc.h)4
-rw-r--r--test/routines/level1/xdotu.hpp (renamed from test/routines/level1/xdotu.h)4
-rw-r--r--test/routines/level1/xnrm2.hpp (renamed from test/routines/level1/xnrm2.h)4
-rw-r--r--test/routines/level1/xscal.hpp (renamed from test/routines/level1/xscal.h)4
-rw-r--r--test/routines/level1/xswap.hpp (renamed from test/routines/level1/xswap.h)4
-rw-r--r--test/routines/level2/xgbmv.hpp (renamed from test/routines/level2/xgbmv.h)4
-rw-r--r--test/routines/level2/xgemv.hpp (renamed from test/routines/level2/xgemv.h)4
-rw-r--r--test/routines/level2/xger.hpp (renamed from test/routines/level2/xger.h)4
-rw-r--r--test/routines/level2/xgerc.hpp (renamed from test/routines/level2/xgerc.h)4
-rw-r--r--test/routines/level2/xgeru.hpp (renamed from test/routines/level2/xgeru.h)4
-rw-r--r--test/routines/level2/xhbmv.hpp (renamed from test/routines/level2/xhbmv.h)4
-rw-r--r--test/routines/level2/xhemv.hpp (renamed from test/routines/level2/xhemv.h)4
-rw-r--r--test/routines/level2/xher.hpp (renamed from test/routines/level2/xher.h)4
-rw-r--r--test/routines/level2/xher2.hpp (renamed from test/routines/level2/xher2.h)4
-rw-r--r--test/routines/level2/xhpmv.hpp (renamed from test/routines/level2/xhpmv.h)4
-rw-r--r--test/routines/level2/xhpr.hpp (renamed from test/routines/level2/xhpr.h)4
-rw-r--r--test/routines/level2/xhpr2.hpp (renamed from test/routines/level2/xhpr2.h)4
-rw-r--r--test/routines/level2/xsbmv.hpp (renamed from test/routines/level2/xsbmv.h)4
-rw-r--r--test/routines/level2/xspmv.hpp (renamed from test/routines/level2/xspmv.h)4
-rw-r--r--test/routines/level2/xspr.hpp (renamed from test/routines/level2/xspr.h)4
-rw-r--r--test/routines/level2/xspr2.hpp (renamed from test/routines/level2/xspr2.h)4
-rw-r--r--test/routines/level2/xsymv.hpp (renamed from test/routines/level2/xsymv.h)4
-rw-r--r--test/routines/level2/xsyr.hpp (renamed from test/routines/level2/xsyr.h)4
-rw-r--r--test/routines/level2/xsyr2.hpp (renamed from test/routines/level2/xsyr2.h)4
-rw-r--r--test/routines/level2/xtbmv.hpp (renamed from test/routines/level2/xtbmv.h)4
-rw-r--r--test/routines/level2/xtpmv.hpp (renamed from test/routines/level2/xtpmv.h)4
-rw-r--r--test/routines/level2/xtrmv.hpp (renamed from test/routines/level2/xtrmv.h)4
-rw-r--r--test/routines/level3/xgemm.hpp (renamed from test/routines/level3/xgemm.h)4
-rw-r--r--test/routines/level3/xhemm.hpp (renamed from test/routines/level3/xhemm.h)4
-rw-r--r--test/routines/level3/xher2k.hpp (renamed from test/routines/level3/xher2k.h)4
-rw-r--r--test/routines/level3/xherk.hpp (renamed from test/routines/level3/xherk.h)4
-rw-r--r--test/routines/level3/xsymm.hpp (renamed from test/routines/level3/xsymm.h)4
-rw-r--r--test/routines/level3/xsyr2k.hpp (renamed from test/routines/level3/xsyr2k.h)4
-rw-r--r--test/routines/level3/xsyrk.hpp (renamed from test/routines/level3/xsyrk.h)4
-rw-r--r--test/routines/level3/xtrmm.hpp (renamed from test/routines/level3/xtrmm.h)4
-rw-r--r--test/routines/levelx/xomatcopy.hpp (renamed from test/routines/levelx/xomatcopy.h)0
-rw-r--r--test/wrapper_cblas.hpp (renamed from test/wrapper_cblas.h)2
-rw-r--r--test/wrapper_clblas.hpp (renamed from test/wrapper_clblas.h)2
276 files changed, 1276 insertions, 1729 deletions
diff --git a/CHANGELOG b/CHANGELOG
index e9063b91..fd5b3610 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@ Development version (next release)
- Made it possible to compile the performance tests (clients) separately from the correctness tests
- Made a reference BLAS and head-to-head performance comparison optional in the clients
- Increased the verbosity of the "-verbose" option in the correctness tests
+- Refactored the host code for better compilation times and fewer lines of code
- Improved the API documentation
- Various minor fixes and enhancements
- Added tuned parameters for various devices (see README)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 21982f39..0df2b3bd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -121,7 +121,7 @@ endif()
# ==================================================================================================
# Includes directories: CLBlast and OpenCL
-include_directories(${clblast_SOURCE_DIR}/include ${OPENCL_INCLUDE_DIRS})
+include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS})
# ==================================================================================================
@@ -140,19 +140,26 @@ set(PRECISIONS 32 64 3232 6464)
# ==================================================================================================
# Gathers all source-files
-set(SOURCES src/clblast.cc src/database.cc src/routine.cc src/cache.cc
- src/utilities.cc src/clblast_c.cc)
+set(SOURCES
+ src/database/database.cpp
+ src/routines/common.cpp
+ src/cache.cpp
+ src/clblast.cpp
+ src/clblast_c.cpp
+ src/routine.cpp
+ src/utilities.cpp
+)
foreach(ROUTINE ${LEVEL1_ROUTINES})
- set(SOURCES ${SOURCES} src/routines/level1/${ROUTINE}.cc)
+ set(SOURCES ${SOURCES} src/routines/level1/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL2_ROUTINES})
- set(SOURCES ${SOURCES} src/routines/level2/${ROUTINE}.cc)
+ set(SOURCES ${SOURCES} src/routines/level2/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL3_ROUTINES})
- set(SOURCES ${SOURCES} src/routines/level3/${ROUTINE}.cc)
+ set(SOURCES ${SOURCES} src/routines/level3/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVELX_ROUTINES})
- set(SOURCES ${SOURCES} src/routines/levelx/${ROUTINE}.cc)
+ set(SOURCES ${SOURCES} src/routines/levelx/${ROUTINE}.cpp)
endforeach()
# Creates and links the library
@@ -186,7 +193,7 @@ if(SAMPLES)
# Adds sample programs (C++)
foreach(SAMPLE ${SAMPLE_PROGRAMS_CPP})
- add_executable(clblast_sample_${SAMPLE} samples/${SAMPLE}.cc)
+ add_executable(clblast_sample_${SAMPLE} samples/${SAMPLE}.cpp)
target_link_libraries(clblast_sample_${SAMPLE} clblast ${OPENCL_LIBRARIES})
install(TARGETS clblast_sample_${SAMPLE} DESTINATION bin)
endforeach()
@@ -211,7 +218,7 @@ if(TUNERS)
# Adds tuning executables
foreach(KERNEL ${KERNELS})
- add_executable(clblast_tuner_${KERNEL} src/tuning/${KERNEL}.cc)
+ add_executable(clblast_tuner_${KERNEL} src/tuning/kernels/${KERNEL}.cpp)
target_link_libraries(clblast_tuner_${KERNEL} clblast ${CLTUNE_LIBRARIES} ${OPENCL_LIBRARIES})
install(TARGETS clblast_tuner_${KERNEL} DESTINATION bin)
endforeach()
@@ -257,7 +264,7 @@ if(CLIENTS OR TESTS)
endif()
# Sets the include directories
- include_directories(${clblast_SOURCE_DIR}/test ${REF_INCLUDES})
+ include_directories(${clblast_SOURCE_DIR} ${REF_INCLUDES})
endif()
@@ -268,24 +275,24 @@ endif()
if(CLIENTS)
# Creates the common performance-tests objects (requires CMake 2.8.8)
- add_library(test_performance_common OBJECT test/performance/client.cc)
+ add_library(test_performance_common OBJECT test/performance/client.cpp)
# Compiles the performance-tests
foreach(ROUTINE ${LEVEL1_ROUTINES})
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
- test/performance/routines/level1/${ROUTINE}.cc)
+ test/performance/routines/level1/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL2_ROUTINES})
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
- test/performance/routines/level2/${ROUTINE}.cc)
+ test/performance/routines/level2/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL3_ROUTINES})
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
- test/performance/routines/level3/${ROUTINE}.cc)
+ test/performance/routines/level3/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVELX_ROUTINES})
add_executable(clblast_client_${ROUTINE} $<TARGET_OBJECTS:test_performance_common>
- test/performance/routines/levelx/${ROUTINE}.cc)
+ test/performance/routines/levelx/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${ROUTINES})
target_link_libraries(clblast_client_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES})
@@ -303,24 +310,24 @@ if(TESTS)
# Creates the common correctness-tests objects (requires CMake 2.8.8)
add_library(test_correctness_common OBJECT
- test/correctness/tester.cc test/correctness/testblas.cc)
+ test/correctness/tester.cpp test/correctness/testblas.cpp)
# Compiles the correctness-tests
foreach(ROUTINE ${LEVEL1_ROUTINES})
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
- test/correctness/routines/level1/${ROUTINE}.cc)
+ test/correctness/routines/level1/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL2_ROUTINES})
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
- test/correctness/routines/level2/${ROUTINE}.cc)
+ test/correctness/routines/level2/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVEL3_ROUTINES})
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
- test/correctness/routines/level3/${ROUTINE}.cc)
+ test/correctness/routines/level3/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${LEVELX_ROUTINES})
add_executable(clblast_test_${ROUTINE} $<TARGET_OBJECTS:test_correctness_common>
- test/correctness/routines/levelx/${ROUTINE}.cc)
+ test/correctness/routines/levelx/${ROUTINE}.cpp)
endforeach()
foreach(ROUTINE ${ROUTINES})
target_link_libraries(clblast_test_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES})
diff --git a/README.md b/README.md
index 26dfb149..5d2c0c9e 100644
--- a/README.md
+++ b/README.md
@@ -136,7 +136,7 @@ Note that CLBlast's tuners are based on the CLTune auto-tuning library, which ha
Compiling with `-DTUNERS=ON` will generate a number of tuners, each named `clblast_tuner_xxxxx`, in which `xxxxx` corresponds to a `.opencl` kernel file as found in `src/kernels`. These kernels corresponds to routines (e.g. `xgemm`) or to common pre-processing or post-processing kernels (`copy` and `transpose`). Running such a tuner will test a number of parameter-value combinations on your device and report which one gave the best performance. Running `make alltuners` runs all tuners for all precisions in one go. You can set the default device and platform for `alltuners` by setting the `DEFAULT_DEVICE` and `DEFAULT_PLATFORM` environmental variables before running CMake.
-The tuners output a JSON-file with the results. The best results need to be added to `include/internal/database/xxxxx.h` in the appropriate section. However, this can be done automatically based on the JSON-data using a Python script in `scripts/database/database.py`. If you want the found parameters to be included in future releases of CLBlast, please attach the JSON files to the corresponding issue on GitHub or [email the main author](http://www.cedricnugteren.nl).
+The tuners output a JSON-file with the results. The best results need to be added to `include/internal/database/xxxxx.hpp` in the appropriate section. However, this can be done automatically based on the JSON-data using a Python script in `scripts/database/database.py`. If you want the found parameters to be included in future releases of CLBlast, please attach the JSON files to the corresponding issue on GitHub or [email the main author](http://www.cedricnugteren.nl).
In summary, tuning the entire library for your device can be done as follows (starting from the root of the CLBlast folder):
diff --git a/include/clblast.h b/include/clblast.h
index 31a07423..c8596b39 100644
--- a/include/clblast.h
+++ b/include/clblast.h
@@ -68,8 +68,8 @@ enum class StatusCode {
kInvalidLocalMemUsage = -2046, // Not enough local memory available on this device
kNoHalfPrecision = -2045, // Half precision (16-bits) not supported by the device
kNoDoublePrecision = -2044, // Double precision (64-bits) not supported by the device
- kInvalidVectorDot = -2043, // Vector dot is not a valid OpenCL buffer
- kInsufficientMemoryDot = -2042, // Vector dot's OpenCL buffer is too small
+ kInvalidVectorScalar = -2043, // The unit-sized vector is not a valid OpenCL buffer
+ kInsufficientMemoryScalar = -2042, // The unit-sized vector's OpenCL buffer is too small
};
// Matrix layout and transpose types
diff --git a/include/clblast_c.h b/include/clblast_c.h
index 3ac6d99c..b92febac 100644
--- a/include/clblast_c.h
+++ b/include/clblast_c.h
@@ -77,8 +77,8 @@ typedef enum StatusCode_ {
kInvalidLocalMemUsage = -2046, // Not enough local memory available on this device
kNoHalfPrecision = -2045, // Half precision (16-bits) not supported by the device
kNoDoublePrecision = -2044, // Double precision (64-bits) not supported by the device
- kInvalidVectorDot = -2043, // Vector dot is not a valid OpenCL buffer
- kInsufficientMemoryDot = -2042, // Vector dot's OpenCL buffer is too small
+ kInvalidVectorScalar = -2043, // The unit-sized vector is not a valid OpenCL buffer
+ kInsufficientMemoryScalar = -2042, // The unit-sized vector's OpenCL buffer is too small
} StatusCode;
// Matrix layout and transpose types
diff --git a/include/internal/routine.h b/include/internal/routine.h
deleted file mode 100644
index 35837575..00000000
--- a/include/internal/routine.h
+++ /dev/null
@@ -1,144 +0,0 @@
-
-// =================================================================================================
-// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
-// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
-// width of 100 characters per line.
-//
-// Author(s):
-// Cedric Nugteren <www.cedricnugteren.nl>
-//
-// This file implements all the basic functionality for the BLAS routines. This class serves as a
-// base class for the actual routines (e.g. Xaxpy, Xgemm). It contains common functionality such as
-// compiling the OpenCL kernel, connecting to the database, etc.
-//
-// =================================================================================================
-
-#ifndef CLBLAST_ROUTINE_H_
-#define CLBLAST_ROUTINE_H_
-
-#include <string>
-#include <vector>
-
-#include "internal/cache.h"
-#include "internal/utilities.h"
-#include "internal/database.h"
-
-namespace clblast {
-// =================================================================================================
-
-// See comment at top of file for a description of the class
-template <typename T>
-class Routine {
- public:
-
- // Helper functions which check for errors in the status code
- static constexpr bool ErrorIn(const StatusCode s) { return (s != StatusCode::kSuccess); }
-
- // Base class constructor
- explicit Routine(Queue &queue, EventPointer event, const std::string &name,
- const std::vector<std::string> &routines, const Precision precision);
-
- // Set-up phase of the kernel
- StatusCode SetUp();
-
- protected:
-
- // Runs a kernel given the global and local thread sizes
- StatusCode RunKernel(Kernel &kernel, std::vector<size_t> global,
- const std::vector<size_t> &local, EventPointer event,
- std::vector<Event>& waitForEvents);
-
- // As above, but without an event waiting list
- StatusCode RunKernel(Kernel &kernel, std::vector<size_t> global,
- const std::vector<size_t> &local, EventPointer event);
-
- // Tests for valid inputs of matrices A, B, and C
- StatusCode TestMatrixA(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size);
- StatusCode TestMatrixB(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size);
- StatusCode TestMatrixC(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size);
- StatusCode TestMatrixAP(const size_t n, const Buffer<T> &buffer,
- const size_t offset, const size_t data_size);
-
- // Tests for valid inputs of vector X and Y
- StatusCode TestVectorX(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t inc, const size_t data_size);
- StatusCode TestVectorY(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t inc, const size_t data_size);
-
- // Tests for valid inputs of other vectors
- StatusCode TestVectorDot(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t data_size);
- StatusCode TestVectorIndex(const size_t n, const Buffer<unsigned int> &buffer,
- const size_t offset, const size_t data_size);
-
- // Copies/transposes a matrix and padds/unpads it with zeroes. This method is also able to write
- // to symmetric and triangular matrices through optional arguments.
- StatusCode PadCopyTransposeMatrix(EventPointer event, std::vector<Event>& waitForEvents,
- const size_t src_one, const size_t src_two,
- const size_t src_ld, const size_t src_offset,
- const Buffer<T> &src,
- const size_t dest_one, const size_t dest_two,
- const size_t dest_ld, const size_t dest_offset,
- const Buffer<T> &dest,
- const T alpha,
- const Program &program, const bool do_pad,
- const bool do_transpose, const bool do_conjugate,
- const bool upper = false, const bool lower = false,
- const bool diagonal_imag_zero = false);
-
- // Stores a newly compiled binary/program into the cache
- void StoreBinaryToCache(const std::string& binary) const {
- cache::StoreBinaryToCache(binary, device_name_, precision_, routine_name_);
- }
- void StoreProgramToCache(const Program& program) const {
- cache::StoreProgramToCache(program, context_, precision_, routine_name_);
- }
-
- // Queries the cache and retrieve either a matching binary/program or a boolean whether a match
- // exists. The first assumes that the binary/program is available in the cache and will throw an
- // exception otherwise.
- std::string GetBinaryFromCache() const {
- return cache::GetBinaryFromCache(device_name_, precision_, routine_name_);
- }
- Program GetProgramFromCache() const {
- return cache::GetProgramFromCache(context_, precision_, routine_name_);
- }
- bool BinaryIsInCache() const {
- return cache::BinaryIsInCache(device_name_, precision_, routine_name_);
- }
- bool ProgramIsInCache() const {
- return cache::ProgramIsInCache(context_, precision_, routine_name_);
- }
-
- // Non-static variable for the precision. Note that the same variable (but static) might exist in
- // a derived class.
- const Precision precision_;
-
- // The routine's name and its kernel-source in string form
- const std::string routine_name_;
- std::string source_string_;
-
- // The OpenCL objects, accessible only from derived classes
- Queue queue_;
- EventPointer event_;
- const Context context_;
- const Device device_;
-
- // OpenCL device properties
- const std::string device_name_;
- const size_t max_work_item_dimensions_;
- const std::vector<size_t> max_work_item_sizes_;
- const size_t max_work_group_size_;
-
- // Connection to the database for all the device-specific parameters
- const Database db_;
-};
-
-// =================================================================================================
-} // namespace clblast
-
-// CLBLAST_ROUTINE_H_
-#endif
diff --git a/samples/sgemm.cc b/samples/sgemm.cpp
index 5fe7490a..5fe7490a 100644
--- a/samples/sgemm.cc
+++ b/samples/sgemm.cpp
diff --git a/scripts/database/database.py b/scripts/database/database.py
index 7f7f07e4..4ca184c5 100644
--- a/scripts/database/database.py
+++ b/scripts/database/database.py
@@ -310,7 +310,7 @@ defaults = CalculateDefaults(bests)
bests = ConcatenateData(bests, defaults)
# Outputs the data as a C++ database
-path_cpp_database = os.path.join(path_clblast, "include", "internal", "database")
+path_cpp_database = os.path.join(path_clblast, "src", "database", "kernels")
print("## Producing a C++ database in '"+path_cpp_database+"'...")
PrintData(bests, path_cpp_database)
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 6726adda..cf01f79e 100644
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -10,14 +10,14 @@
# This script automatically generates the bodies of the following files, creating the full CLBlast
# API interface and implementation (C, C++, and reference BLAS wrappers):
# clblast.h
-# clblast.cc
+# clblast.cpp
# clblast_c.h
-# clblast_c.cc
+# clblast_c.cpp
# wrapper_clblas.h
# wrapper_cblas.h
# It also generates the main functions for the correctness and performance tests as found in
-# test/correctness/routines/levelX/xYYYY.cc
-# test/performance/routines/levelX/xYYYY.cc
+# test/correctness/routines/levelX/xYYYY.cpp
+# test/performance/routines/levelX/xYYYY.cpp
# It also produces the API documentation found in doc/clblast.md
#
# ==================================================================================================
@@ -200,7 +200,7 @@ def clblast_h(routines):
result += routine.RoutineHeaderCPP(12, " = nullptr")+";\n"
return result
-# The C++ API implementation (.cc)
+# The C++ API implementation (.cpp)
def clblast_cc(routines):
result = ""
for routine in routines:
@@ -237,7 +237,7 @@ def clblast_c_h(routines):
result += routine.RoutineHeaderC(flavour, 31, " PUBLIC_API")+";\n"
return result
-# The C API implementation (.cc)
+# The C API implementation (.cpp)
def clblast_c_cc(routines):
result = ""
for routine in routines:
@@ -379,14 +379,14 @@ if len(sys.argv) != 2:
path_clblast = sys.argv[1]
files = [
path_clblast+"/include/clblast.h",
- path_clblast+"/src/clblast.cc",
+ path_clblast+"/src/clblast.cpp",
path_clblast+"/include/clblast_c.h",
- path_clblast+"/src/clblast_c.cc",
- path_clblast+"/test/wrapper_clblas.h",
- path_clblast+"/test/wrapper_cblas.h",
+ path_clblast+"/src/clblast_c.cpp",
+ path_clblast+"/test/wrapper_clblas.hpp",
+ path_clblast+"/test/wrapper_cblas.hpp",
]
header_lines = [84, 74, 93, 22, 29, 41]
-footer_lines = [17, 71, 19, 14, 6, 6]
+footer_lines = [17, 75, 19, 14, 6, 6]
# Checks whether the command-line arguments are valid; exists otherwise
for f in files:
@@ -433,11 +433,11 @@ for i in xrange(0,len(files)):
for level in [1,2,3,4]:
for routine in routines[level-1]:
if routine.has_tests:
- filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
+ filename = path_clblast+"/test/correctness/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
with open(filename, "w") as f:
body = ""
- body += "#include \"correctness/testblas.h\"\n"
- body += "#include \"routines/level"+levelnames[level-1]+"/x"+routine.name+".h\"\n\n"
+ body += "#include \"test/correctness/testblas.hpp\"\n"
+ body += "#include \"test/routines/level"+levelnames[level-1]+"/x"+routine.name+".hpp\"\n\n"
body += "// Shortcuts to the clblast namespace\n"
body += "using float2 = clblast::float2;\n"
body += "using double2 = clblast::double2;\n\n"
@@ -459,11 +459,11 @@ for level in [1,2,3,4]:
for level in [1,2,3,4]:
for routine in routines[level-1]:
if routine.has_tests:
- filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cc"
+ filename = path_clblast+"/test/performance/routines/level"+levelnames[level-1]+"/x"+routine.name+".cpp"
with open(filename, "w") as f:
body = ""
- body += "#include \"performance/client.h\"\n"
- body += "#include \"routines/level"+levelnames[level-1]+"/x"+routine.name+".h\"\n\n"
+ body += "#include \"test/performance/client.hpp\"\n"
+ body += "#include \"test/routines/level"+levelnames[level-1]+"/x"+routine.name+".hpp\"\n\n"
body += "// Shortcuts to the clblast namespace\n"
body += "using float2 = clblast::float2;\n"
body += "using double2 = clblast::double2;\n\n"
diff --git a/src/buffer_test.hpp b/src/buffer_test.hpp
new file mode 100644
index 00000000..80f5243f
--- /dev/null
+++ b/src/buffer_test.hpp
@@ -0,0 +1,121 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file implements the tests for the OpenCL buffers (matrices and vectors). These tests are
+// templated and thus header-only.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_BUFFER_TEST_H_
+#define CLBLAST_BUFFER_TEST_H_
+
+#include "clblast.h"
+
+namespace clblast {
+// =================================================================================================
+
+// Tests matrix 'A' for validity
+template <typename T>
+StatusCode TestMatrixA(const size_t one, const size_t two, const Buffer<T> &buffer,
+ const size_t offset, const size_t ld) {
+ if (ld < one) { return StatusCode::kInvalidLeadDimA; }
+ try {
+ const auto required_size = (ld * (two - 1) + one + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryA; }
+ } catch (...) { return StatusCode::kInvalidMatrixA; }
+ return StatusCode::kSuccess;
+}
+
+// Tests matrix 'B' for validity
+template <typename T>
+StatusCode TestMatrixB(const size_t one, const size_t two, const Buffer<T> &buffer,
+ const size_t offset, const size_t ld) {
+ if (ld < one) { return StatusCode::kInvalidLeadDimB; }
+ try {
+ const auto required_size = (ld * (two - 1) + one + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryB; }
+ } catch (...) { return StatusCode::kInvalidMatrixB; }
+ return StatusCode::kSuccess;
+}
+
+// Tests matrix 'C' for validity
+template <typename T>
+StatusCode TestMatrixC(const size_t one, const size_t two, const Buffer<T> &buffer,
+ const size_t offset, const size_t ld) {
+ if (ld < one) { return StatusCode::kInvalidLeadDimC; }
+ try {
+ const auto required_size = (ld * (two - 1) + one + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryC; }
+ } catch (...) { return StatusCode::kInvalidMatrixC; }
+ return StatusCode::kSuccess;
+}
+
+// Tests matrix 'AP' for validity
+template <typename T>
+StatusCode TestMatrixAP(const size_t n, const Buffer<T> &buffer, const size_t offset) {
+ try {
+ const auto required_size = (((n * (n + 1)) / 2) + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryA; }
+ } catch (...) { return StatusCode::kInvalidMatrixA; }
+ return StatusCode::kSuccess;
+}
+
+// =================================================================================================
+
+// Tests vector 'X' for validity
+template <typename T>
+StatusCode TestVectorX(const size_t n, const Buffer<T> &buffer, const size_t offset,
+ const size_t inc) {
+ if (inc == 0) { return StatusCode::kInvalidIncrementX; }
+ try {
+ const auto required_size = ((n - 1) * inc + 1 + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryX; }
+ } catch (...) { return StatusCode::kInvalidVectorX; }
+ return StatusCode::kSuccess;
+}
+
+// Tests vector 'Y' for validity
+template <typename T>
+StatusCode TestVectorY(const size_t n, const Buffer<T> &buffer, const size_t offset,
+ const size_t inc) {
+ if (inc == 0) { return StatusCode::kInvalidIncrementY; }
+ try {
+ const auto required_size = ((n - 1) * inc + 1 + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryY; }
+ } catch (...) { return StatusCode::kInvalidVectorY; }
+ return StatusCode::kSuccess;
+}
+
+// =================================================================================================
+
+// Tests vector 'scalar' for validity
+template <typename T>
+StatusCode TestVectorScalar(const size_t n, const Buffer<T> &buffer, const size_t offset) {
+ try {
+ const auto required_size = (n + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryScalar; }
+ } catch (...) { return StatusCode::kInvalidVectorScalar; }
+ return StatusCode::kSuccess;
+}
+
+// Tests vector 'index' for validity
+template <typename T>
+StatusCode TestVectorIndex(const size_t n, const Buffer<T> &buffer, const size_t offset) {
+ try {
+ const auto required_size = (n + offset) * sizeof(T);
+ if (buffer.GetSize() < required_size) { return StatusCode::kInsufficientMemoryScalar; }
+ } catch (...) { return StatusCode::kInvalidVectorScalar; }
+ return StatusCode::kSuccess;
+}
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_BUFFER_TEST_H_
+#endif
diff --git a/src/cache.cc b/src/cache.cpp
index 4dbdb711..cd9055d0 100644
--- a/src/cache.cc
+++ b/src/cache.cpp
@@ -15,10 +15,9 @@
#include <vector>
#include <mutex>
-#include "internal/cache.h"
+#include "cache.hpp"
namespace clblast {
-namespace cache {
// =================================================================================================
// Stores the compiled binary or IR in the cache
@@ -98,7 +97,7 @@ bool ProgramIsInCache(const Context &context, const Precision &precision,
// =================================================================================================
// Clears the cache of stored binaries and programs
-StatusCode ClearCache() {
+StatusCode CacheClearAll() {
binary_cache_mutex_.lock();
binary_cache_.clear();
binary_cache_mutex_.unlock();
@@ -109,5 +108,4 @@ StatusCode ClearCache() {
}
// =================================================================================================
-} // namespace cache
} // namespace clblast
diff --git a/include/internal/cache.h b/src/cache.hpp
index 4a11b70f..0d74d7bc 100644
--- a/include/internal/cache.h
+++ b/src/cache.hpp
@@ -18,10 +18,9 @@
#include <vector>
#include <mutex>
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
-namespace cache {
// =================================================================================================
// The cache of compiled OpenCL binaries, along with some meta-data
@@ -90,10 +89,9 @@ bool ProgramIsInCache(const Context &context, const Precision &precision,
// =================================================================================================
// Clears the cache of stored binaries
-StatusCode ClearCache();
+StatusCode CacheClearAll();
// =================================================================================================
-} // namespace cache
} // namespace clblast
// CLBLAST_CACHE_H_
diff --git a/src/clblast.cc b/src/clblast.cpp
index e3df6ede..88d60772 100644
--- a/src/clblast.cc
+++ b/src/clblast.cpp
@@ -16,60 +16,60 @@
#include <string>
#include "clblast.h"
-#include "internal/public_api.h"
-#include "internal/cache.h"
+#include "public_api.hpp"
+#include "cache.hpp"
// BLAS level-1 includes
-#include "internal/routines/level1/xswap.h"
-#include "internal/routines/level1/xscal.h"
-#include "internal/routines/level1/xcopy.h"
-#include "internal/routines/level1/xaxpy.h"
-#include "internal/routines/level1/xdot.h"
-#include "internal/routines/level1/xdotu.h"
-#include "internal/routines/level1/xdotc.h"
-#include "internal/routines/level1/xnrm2.h"
-#include "internal/routines/level1/xasum.h"
-#include "internal/routines/level1/xsum.h" // non-BLAS function
-#include "internal/routines/level1/xamax.h"
-#include "internal/routines/level1/xmax.h" // non-BLAS function
-#include "internal/routines/level1/xmin.h" // non-BLAS function
+#include "routines/level1/xswap.hpp"
+#include "routines/level1/xscal.hpp"
+#include "routines/level1/xcopy.hpp"
+#include "routines/level1/xaxpy.hpp"
+#include "routines/level1/xdot.hpp"
+#include "routines/level1/xdotu.hpp"
+#include "routines/level1/xdotc.hpp"
+#include "routines/level1/xnrm2.hpp"
+#include "routines/level1/xasum.hpp"
+#include "routines/level1/xsum.hpp" // non-BLAS routine
+#include "routines/level1/xamax.hpp"
+#include "routines/level1/xmax.hpp" // non-BLAS routine
+#include "routines/level1/xmin.hpp" // non-BLAS routine
// BLAS level-2 includes
-#include "internal/routines/level2/xgemv.h"
-#include "internal/routines/level2/xgbmv.h"
-#include "internal/routines/level2/xhemv.h"
-#include "internal/routines/level2/xhbmv.h"
-#include "internal/routines/level2/xhpmv.h"
-#include "internal/routines/level2/xsymv.h"
-#include "internal/routines/level2/xsbmv.h"
-#include "internal/routines/level2/xspmv.h"
-#include "internal/routines/level2/xtrmv.h"
-#include "internal/routines/level2/xtbmv.h"
-#include "internal/routines/level2/xtpmv.h"
-#include "internal/routines/level2/xger.h"
-#include "internal/routines/level2/xgeru.h"
-#include "internal/routines/level2/xgerc.h"
-#include "internal/routines/level2/xher.h"
-#include "internal/routines/level2/xhpr.h"
-#include "internal/routines/level2/xher2.h"
-#include "internal/routines/level2/xhpr2.h"
-#include "internal/routines/level2/xsyr.h"
-#include "internal/routines/level2/xspr.h"
-#include "internal/routines/level2/xsyr2.h"
-#include "internal/routines/level2/xspr2.h"
+#include "routines/level2/xgemv.hpp"
+#include "routines/level2/xgbmv.hpp"
+#include "routines/level2/xhemv.hpp"
+#include "routines/level2/xhbmv.hpp"
+#include "routines/level2/xhpmv.hpp"
+#include "routines/level2/xsymv.hpp"
+#include "routines/level2/xsbmv.hpp"
+#include "routines/level2/xspmv.hpp"
+#include "routines/level2/xtrmv.hpp"
+#include "routines/level2/xtbmv.hpp"
+#include "routines/level2/xtpmv.hpp"
+#include "routines/level2/xger.hpp"
+#include "routines/level2/xgeru.hpp"
+#include "routines/level2/xgerc.hpp"
+#include "routines/level2/xher.hpp"
+#include "routines/level2/xhpr.hpp"
+#include "routines/level2/xher2.hpp"
+#include "routines/level2/xhpr2.hpp"
+#include "routines/level2/xsyr.hpp"
+#include "routines/level2/xspr.hpp"
+#include "routines/level2/xsyr2.hpp"
+#include "routines/level2/xspr2.hpp"
// BLAS level-3 includes
-#include "internal/routines/level3/xgemm.h"
-#include "internal/routines/level3/xsymm.h"
-#include "internal/routines/level3/xhemm.h"
-#include "internal/routines/level3/xsyrk.h"
-#include "internal/routines/level3/xherk.h"
-#include "internal/routines/level3/xsyr2k.h"
-#include "internal/routines/level3/xher2k.h"
-#include "internal/routines/level3/xtrmm.h"
-
-// Extra includes (level-x)
-#include "internal/routines/levelx/xomatcopy.h"
+#include "routines/level3/xgemm.hpp"
+#include "routines/level3/xsymm.hpp"
+#include "routines/level3/xhemm.hpp"
+#include "routines/level3/xsyrk.hpp"
+#include "routines/level3/xherk.hpp"
+#include "routines/level3/xsyr2k.hpp"
+#include "routines/level3/xher2k.hpp"
+#include "routines/level3/xtrmm.hpp"
+
+// Level-x includes (non-BLAS)
+#include "routines/levelx/xomatcopy.hpp"
namespace clblast {
@@ -2120,9 +2120,10 @@ template StatusCode PUBLIC_API Omatcopy<half>(const Layout, const Transpose,
// =================================================================================================
// Clears the cache of stored binaries
-StatusCode ClearCache() { return cache::ClearCache(); }
+StatusCode ClearCache() { return CacheClearAll(); }
// Fills the cache with all binaries for a specific device
+// TODO: Add half-precision FP16 set-up calls
StatusCode FillCache(const cl_device_id device) {
try {
@@ -2171,7 +2172,7 @@ StatusCode FillCache(const cl_device_id device) {
Xsyr2<float>(queue, nullptr).SetUp(); Xsyr2<double>(queue, nullptr).SetUp();
Xspr2<float>(queue, nullptr).SetUp(); Xspr2<double>(queue, nullptr).SetUp();
- // Runs all the level 1 set-up functions
+ // Runs all the level 3 set-up functions
Xgemm<float>(queue, nullptr).SetUp(); Xgemm<double>(queue, nullptr).SetUp(); Xgemm<float2>(queue, nullptr).SetUp(); Xgemm<double2>(queue, nullptr).SetUp();
Xsymm<float>(queue, nullptr).SetUp(); Xsymm<double>(queue, nullptr).SetUp(); Xsymm<float2>(queue, nullptr).SetUp(); Xsymm<double2>(queue, nullptr).SetUp();
Xhemm<float2>(queue, nullptr).SetUp(); Xhemm<double2>(queue, nullptr).SetUp();
@@ -2181,6 +2182,9 @@ StatusCode FillCache(const cl_device_id device) {
Xher2k<float2,float>(queue, nullptr).SetUp(); Xher2k<double2,double>(queue, nullptr).SetUp();
Xtrmm<float>(queue, nullptr).SetUp(); Xtrmm<double>(queue, nullptr).SetUp(); Xtrmm<float2>(queue, nullptr).SetUp(); Xtrmm<double2>(queue, nullptr).SetUp();
+ // Runs all the level 3 set-up functions
+ Xomatcopy<float>(queue, nullptr).SetUp(); Xomatcopy<double>(queue, nullptr).SetUp(); Xomatcopy<float2>(queue, nullptr).SetUp(); Xomatcopy<double2>(queue, nullptr).SetUp();
+
} catch (...) { return StatusCode::kBuildProgramFailure; }
return StatusCode::kSuccess;
}
diff --git a/src/clblast_c.cc b/src/clblast_c.cpp
index 22cb2192..9ea2c884 100644
--- a/src/clblast_c.cc
+++ b/src/clblast_c.cpp
@@ -15,7 +15,7 @@
#include "clblast_c.h"
#include "clblast.h"
-#include "internal/utilities.h"
+#include "utilities.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/include/internal/clpp11.h b/src/clpp11.hpp
index b834d8b4..b834d8b4 100644
--- a/include/internal/clpp11.h
+++ b/src/clpp11.hpp
diff --git a/src/database.cc b/src/database/database.cpp
index e20ae340..6ec93731 100644
--- a/src/database.cc
+++ b/src/database/database.cpp
@@ -11,18 +11,18 @@
//
// =================================================================================================
-#include "internal/database.h"
-#include "internal/database/xaxpy.h"
-#include "internal/database/xdot.h"
-#include "internal/database/xgemv.h"
-#include "internal/database/xger.h"
-#include "internal/database/xgemm.h"
-#include "internal/database/copy.h"
-#include "internal/database/pad.h"
-#include "internal/database/transpose.h"
-#include "internal/database/padtranspose.h"
-
-#include "internal/utilities.h"
+#include "utilities.hpp"
+
+#include "database/database.hpp"
+#include "database/kernels/xaxpy.hpp"
+#include "database/kernels/xdot.hpp"
+#include "database/kernels/xgemv.hpp"
+#include "database/kernels/xger.hpp"
+#include "database/kernels/xgemm.hpp"
+#include "database/kernels/copy.hpp"
+#include "database/kernels/pad.hpp"
+#include "database/kernels/transpose.hpp"
+#include "database/kernels/padtranspose.hpp"
namespace clblast {
// =================================================================================================
diff --git a/include/internal/database.h b/src/database/database.hpp
index f93eaa22..0987cbed 100644
--- a/include/internal/database.h
+++ b/src/database/database.hpp
@@ -21,7 +21,7 @@
#include <vector>
#include <unordered_map>
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
// =================================================================================================
diff --git a/include/internal/database/copy.h b/src/database/kernels/copy.hpp
index 201e8b8a..201e8b8a 100644
--- a/include/internal/database/copy.h
+++ b/src/database/kernels/copy.hpp
diff --git a/include/internal/database/pad.h b/src/database/kernels/pad.hpp
index cc703dd6..cc703dd6 100644
--- a/include/internal/database/pad.h
+++ b/src/database/kernels/pad.hpp
diff --git a/include/internal/database/padtranspose.h b/src/database/kernels/padtranspose.hpp
index f3b1f262..f3b1f262 100644
--- a/include/internal/database/padtranspose.h
+++ b/src/database/kernels/padtranspose.hpp
diff --git a/include/internal/database/transpose.h b/src/database/kernels/transpose.hpp
index 0c893dae..0c893dae 100644
--- a/include/internal/database/transpose.h
+++ b/src/database/kernels/transpose.hpp
diff --git a/include/internal/database/xaxpy.h b/src/database/kernels/xaxpy.hpp
index 6e6719e8..6e6719e8 100644
--- a/include/internal/database/xaxpy.h
+++ b/src/database/kernels/xaxpy.hpp
diff --git a/include/internal/database/xdot.h b/src/database/kernels/xdot.hpp
index d09d8c62..d09d8c62 100644
--- a/include/internal/database/xdot.h
+++ b/src/database/kernels/xdot.hpp
diff --git a/include/internal/database/xgemm.h b/src/database/kernels/xgemm.hpp
index f35d2c88..f35d2c88 100644
--- a/include/internal/database/xgemm.h
+++ b/src/database/kernels/xgemm.hpp
diff --git a/include/internal/database/xgemv.h b/src/database/kernels/xgemv.hpp
index 6b76c8ac..6b76c8ac 100644
--- a/include/internal/database/xgemv.h
+++ b/src/database/kernels/xgemv.hpp
diff --git a/include/internal/database/xger.h b/src/database/kernels/xger.hpp
index f2e0a36f..f2e0a36f 100644
--- a/include/internal/database/xger.h
+++ b/src/database/kernels/xger.hpp
diff --git a/include/internal/public_api.h b/src/public_api.hpp
index d0732297..d0732297 100644
--- a/include/internal/public_api.h
+++ b/src/public_api.hpp
diff --git a/src/routine.cc b/src/routine.cc
deleted file mode 100644
index 1cf8bff8..00000000
--- a/src/routine.cc
+++ /dev/null
@@ -1,431 +0,0 @@
-
-// =================================================================================================
-// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
-// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
-// width of 100 characters per line.
-//
-// Author(s):
-// Cedric Nugteren <www.cedricnugteren.nl>
-//
-// This file implements the Routine base class (see the header for information about the class).
-//
-// =================================================================================================
-
-#include <string>
-#include <vector>
-
-#include "internal/routine.h"
-
-namespace clblast {
-// =================================================================================================
-
-// Constructor: not much here, because no status codes can be returned
-template <typename T>
-Routine<T>::Routine(Queue &queue, EventPointer event, const std::string &name,
- const std::vector<std::string> &routines, const Precision precision):
- precision_(precision),
- routine_name_(name),
- queue_(queue),
- event_(event),
- context_(queue_.GetContext()),
- device_(queue_.GetDevice()),
- device_name_(device_.Name()),
- max_work_item_dimensions_(device_.MaxWorkItemDimensions()),
- max_work_item_sizes_(device_.MaxWorkItemSizes()),
- max_work_group_size_(device_.MaxWorkGroupSize()),
- db_(queue_, routines, precision_) {
-}
-
-// =================================================================================================
-
-// Separate set-up function to allow for status codes to be returned
-template <typename T>
-StatusCode Routine<T>::SetUp() {
-
- // Queries the cache to see whether or not the program (context-specific) is already there
- if (ProgramIsInCache()) { return StatusCode::kSuccess; }
-
- // Queries the cache to see whether or not the binary (device-specific) is already there. If it
- // is, a program is created and stored in the cache
- if (BinaryIsInCache()) {
- try {
- auto& binary = cache::GetBinaryFromCache(device_name_, precision_, routine_name_);
- auto program = Program(device_, context_, binary);
- auto options = std::vector<std::string>();
- program.Build(device_, options);
- StoreProgramToCache(program);
- } catch (...) { return StatusCode::kBuildProgramFailure; }
- return StatusCode::kSuccess;
- }
-
- // Otherwise, the kernel will be compiled and program will be built. Both the binary and the
- // program will be added to the cache.
-
- // Inspects whether or not cl_khr_fp64 is supported in case of double precision
- const auto extensions = device_.Capabilities();
- if (precision_ == Precision::kDouble || precision_ == Precision::kComplexDouble) {
- if (extensions.find(kKhronosDoublePrecision) == std::string::npos) {
- return StatusCode::kNoDoublePrecision;
- }
- }
-
- // As above, but for cl_khr_fp16 (half precision)
- if (precision_ == Precision::kHalf) {
- if (extensions.find(kKhronosHalfPrecision) == std::string::npos) {
- return StatusCode::kNoHalfPrecision;
- }
- }
-
- // Loads the common header (typedefs and defines and such)
- std::string common_header =
- #include "kernels/common.opencl"
- ;
-
- // Collects the parameters for this device in the form of defines, and adds the precision
- auto defines = db_.GetDefines();
- defines += "#define PRECISION "+ToString(static_cast<int>(precision_))+"\n";
-
- // Adds the name of the routine as a define
- defines += "#define ROUTINE_"+routine_name_+"\n";
-
- // For specific devices, use the non-IEE754 compilant OpenCL mad() instruction. This can improve
- // performance, but might result in a reduced accuracy.
- if (device_.IsAMD() && device_.IsGPU()) {
- defines += "#define USE_CL_MAD 1\n";
- }
-
- // For specific devices, use staggered/shuffled workgroup indices.
- if (device_.IsAMD() && device_.IsGPU()) {
- defines += "#define USE_STAGGERED_INDICES 1\n";
- }
-
- // For specific devices add a global synchronisation barrier to the GEMM kernel to optimize
- // performance through better cache behaviour
- if (device_.IsARM() && device_.IsGPU()) {
- defines += "#define GLOBAL_MEM_FENCE 1\n";
- }
-
- // Combines everything together into a single source string
- const auto source_string = defines + common_header + source_string_;
-
- // Compiles the kernel
- try {
- auto program = Program(context_, source_string);
- auto options = std::vector<std::string>();
- const auto build_status = program.Build(device_, options);
-
- // Checks for compiler crashes/errors/warnings
- if (build_status == BuildStatus::kError) {
- const auto message = program.GetBuildInfo(device_);
- fprintf(stdout, "OpenCL compiler error/warning: %s\n", message.c_str());
- return StatusCode::kBuildProgramFailure;
- }
- if (build_status == BuildStatus::kInvalid) { return StatusCode::kInvalidBinary; }
-
- // Store the compiled binary and program in the cache
- const auto binary = program.GetIR();
- StoreBinaryToCache(binary);
- StoreProgramToCache(program);
- } catch (...) { return StatusCode::kBuildProgramFailure; }
-
- // No errors, normal termination of this function
- return StatusCode::kSuccess;
-}
-
-// =================================================================================================
-
-// Enqueues a kernel, waits for completion, and checks for errors
-template <typename T>
-StatusCode Routine<T>::RunKernel(Kernel &kernel, std::vector<size_t> global,
- const std::vector<size_t> &local, EventPointer event,
- std::vector<Event>& waitForEvents) {
-
- // Tests for validity of the local thread sizes
- if (local.size() > max_work_item_dimensions_) {
- return StatusCode::kInvalidLocalNumDimensions;
- }
- for (auto i=size_t{0}; i<local.size(); ++i) {
- if (local[i] > max_work_item_sizes_[i]) { return StatusCode::kInvalidLocalThreadsDim; }
- }
- auto local_size = size_t{1};
- for (auto &item: local) { local_size *= item; }
- if (local_size > max_work_group_size_) { return StatusCode::kInvalidLocalThreadsTotal; }
-
- // Make sure the global thread sizes are at least equal to the local sizes
- for (auto i=size_t{0}; i<global.size(); ++i) {
- if (global[i] < local[i]) { global[i] = local[i]; }
- }
-
- // Tests for local memory usage
- const auto local_mem_usage = kernel.LocalMemUsage(device_);
- if (!device_.IsLocalMemoryValid(local_mem_usage)) { return StatusCode::kInvalidLocalMemUsage; }
-
- // Launches the kernel (and checks for launch errors)
- try {
- kernel.Launch(queue_, global, local, event, waitForEvents);
- } catch (...) { return StatusCode::kKernelLaunchError; }
-
- // No errors, normal termination of this function
- return StatusCode::kSuccess;
-}
-
-// As above, but without an event waiting list
-template <typename T>
-StatusCode Routine<T>::RunKernel(Kernel &kernel, std::vector<size_t> global,
- const std::vector<size_t> &local, EventPointer event) {
- auto emptyWaitingList = std::vector<Event>();
- return RunKernel(kernel, global, local, event, emptyWaitingList);
-}
-
-// =================================================================================================
-
-// Tests matrix A for validity: checks for a valid OpenCL buffer, a valid lead-dimension, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestMatrixA(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size) {
- if (ld < one) { return StatusCode::kInvalidLeadDimA; }
- try {
- const auto required_size = (ld*(two-1) + one + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryA; }
- } catch (...) { return StatusCode::kInvalidMatrixA; }
- return StatusCode::kSuccess;
-}
-
-// Tests matrix B for validity: checks for a valid OpenCL buffer, a valid lead-dimension, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestMatrixB(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size) {
- if (ld < one) { return StatusCode::kInvalidLeadDimB; }
- try {
- const auto required_size = (ld*(two-1) + one + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryB; }
- } catch (...) { return StatusCode::kInvalidMatrixB; }
- return StatusCode::kSuccess;
-}
-
-// Tests matrix C for validity: checks for a valid OpenCL buffer, a valid lead-dimension, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestMatrixC(const size_t one, const size_t two, const Buffer<T> &buffer,
- const size_t offset, const size_t ld, const size_t data_size) {
- if (ld < one) { return StatusCode::kInvalidLeadDimC; }
- try {
- const auto required_size = (ld*(two-1) + one + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryC; }
- } catch (...) { return StatusCode::kInvalidMatrixC; }
- return StatusCode::kSuccess;
-}
-
-// Tests matrix AP for validity: checks for a valid OpenCL buffer and for a sufficient buffer size
-template <typename T>
-StatusCode Routine<T>::TestMatrixAP(const size_t n, const Buffer<T> &buffer,
- const size_t offset, const size_t data_size) {
- try {
- const auto required_size = (((n*(n+1))/2) + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryA; }
- } catch (...) { return StatusCode::kInvalidMatrixA; }
- return StatusCode::kSuccess;
-}
-
-// =================================================================================================
-
-// Tests vector X for validity: checks for a valid increment, a valid OpenCL buffer, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestVectorX(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t inc, const size_t data_size) {
- if (inc == 0) { return StatusCode::kInvalidIncrementX; }
- try {
- const auto required_size = ((n-1)*inc + 1 + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryX; }
- } catch (...) { return StatusCode::kInvalidVectorX; }
- return StatusCode::kSuccess;
-}
-
-// Tests vector Y for validity: checks for a valid increment, a valid OpenCL buffer, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestVectorY(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t inc, const size_t data_size) {
- if (inc == 0) { return StatusCode::kInvalidIncrementY; }
- try {
- const auto required_size = ((n-1)*inc + 1 + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryY; }
- } catch (...) { return StatusCode::kInvalidVectorY; }
- return StatusCode::kSuccess;
-}
-
-// =================================================================================================
-
-// Tests vector dot for validity: checks for a valid increment, a valid OpenCL buffer, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestVectorDot(const size_t n, const Buffer<T> &buffer, const size_t offset,
- const size_t data_size) {
- try {
- const auto required_size = (n + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryDot; }
- } catch (...) { return StatusCode::kInvalidVectorDot; }
- return StatusCode::kSuccess;
-}
-
-// Tests vector index for validity: checks for a valid increment, a valid OpenCL buffer, and for a
-// sufficient buffer size.
-template <typename T>
-StatusCode Routine<T>::TestVectorIndex(const size_t n, const Buffer<unsigned int> &buffer,
- const size_t offset, const size_t data_size) {
- try {
- const auto required_size = (n + offset)*data_size;
- const auto buffer_size = buffer.GetSize();
- if (buffer_size < required_size) { return StatusCode::kInsufficientMemoryDot; }
- } catch (...) { return StatusCode::kInvalidVectorDot; }
- return StatusCode::kSuccess;
-}
-
-// =================================================================================================
-
-// Copies or transposes a matrix and optionally pads/unpads it with zeros
-template <typename T>
-StatusCode Routine<T>::PadCopyTransposeMatrix(EventPointer event, std::vector<Event>& waitForEvents,
- const size_t src_one, const size_t src_two,
- const size_t src_ld, const size_t src_offset,
- const Buffer<T> &src,
- const size_t dest_one, const size_t dest_two,
- const size_t dest_ld, const size_t dest_offset,
- const Buffer<T> &dest,
- const T alpha,
- const Program &program, const bool do_pad,
- const bool do_transpose, const bool do_conjugate,
- const bool upper, const bool lower,
- const bool diagonal_imag_zero) {
-
- // Determines whether or not the fast-version could potentially be used
- auto use_fast_kernel = (src_offset == 0) && (dest_offset == 0) && (do_conjugate == false) &&
- (src_one == dest_one) && (src_two == dest_two) && (src_ld == dest_ld) &&
- (upper == false) && (lower == false) && (diagonal_imag_zero == false);
-
- // Determines the right kernel
- auto kernel_name = std::string{};
- if (do_transpose) {
- if (use_fast_kernel &&
- IsMultiple(src_ld, db_["TRA_WPT"]) &&
- IsMultiple(src_one, db_["TRA_WPT"]*db_["TRA_WPT"]) &&
- IsMultiple(src_two, db_["TRA_WPT"]*db_["TRA_WPT"])) {
- kernel_name = "TransposeMatrixFast";
- }
- else {
- use_fast_kernel = false;
- kernel_name = (do_pad) ? "TransposePadMatrix" : "TransposeMatrix";
- }
- }
- else {
- if (use_fast_kernel &&
- IsMultiple(src_ld, db_["COPY_VW"]) &&
- IsMultiple(src_one, db_["COPY_VW"]*db_["COPY_DIMX"]) &&
- IsMultiple(src_two, db_["COPY_WPT"]*db_["COPY_DIMY"])) {
- kernel_name = "CopyMatrixFast";
- }
- else {
- use_fast_kernel = false;
- kernel_name = (do_pad) ? "CopyPadMatrix" : "CopyMatrix";
- }
- }
-
- // Upload the scalar argument as a constant buffer to the device (needed for half-precision)
- auto alpha_buffer = Buffer<T>(context_, 1);
- alpha_buffer.Write(queue_, 1, &alpha);
-
- // Retrieves the kernel from the compiled binary
- try {
- auto kernel = Kernel(program, kernel_name);
-
- // Sets the kernel arguments
- if (use_fast_kernel) {
- kernel.SetArgument(0, static_cast<int>(src_ld));
- kernel.SetArgument(1, src());
- kernel.SetArgument(2, dest());
- kernel.SetArgument(3, alpha_buffer());
- }
- else {
- kernel.SetArgument(0, static_cast<int>(src_one));
- kernel.SetArgument(1, static_cast<int>(src_two));
- kernel.SetArgument(2, static_cast<int>(src_ld));
- kernel.SetArgument(3, static_cast<int>(src_offset));
- kernel.SetArgument(4, src());
- kernel.SetArgument(5, static_cast<int>(dest_one));
- kernel.SetArgument(6, static_cast<int>(dest_two));
- kernel.SetArgument(7, static_cast<int>(dest_ld));
- kernel.SetArgument(8, static_cast<int>(dest_offset));
- kernel.SetArgument(9, dest());
- kernel.SetArgument(10, alpha_buffer());
- if (do_pad) {
- kernel.SetArgument(11, static_cast<int>(do_conjugate));
- }
- else {
- kernel.SetArgument(11, static_cast<int>(upper));
- kernel.SetArgument(12, static_cast<int>(lower));
- kernel.SetArgument(13, static_cast<int>(diagonal_imag_zero));
- }
- }
-
- // Launches the kernel and returns the error code. Uses global and local thread sizes based on
- // parameters in the database.
- if (do_transpose) {
- if (use_fast_kernel) {
- const auto global = std::vector<size_t>{
- dest_one / db_["TRA_WPT"],
- dest_two / db_["TRA_WPT"]
- };
- const auto local = std::vector<size_t>{db_["TRA_DIM"], db_["TRA_DIM"]};
- return RunKernel(kernel, global, local, event, waitForEvents);
- }
- else {
- const auto global = std::vector<size_t>{
- Ceil(CeilDiv(dest_one, db_["PADTRA_WPT"]), db_["PADTRA_TILE"]),
- Ceil(CeilDiv(dest_two, db_["PADTRA_WPT"]), db_["PADTRA_TILE"])
- };
- const auto local = std::vector<size_t>{db_["PADTRA_TILE"], db_["PADTRA_TILE"]};
- return RunKernel(kernel, global, local, event, waitForEvents);
- }
- }
- else {
- if (use_fast_kernel) {
- const auto global = std::vector<size_t>{
- dest_one / db_["COPY_VW"],
- dest_two / db_["COPY_WPT"]
- };
- const auto local = std::vector<size_t>{db_["COPY_DIMX"], db_["COPY_DIMY"]};
- return RunKernel(kernel, global, local, event, waitForEvents);
- }
- else {
- const auto global = std::vector<size_t>{
- Ceil(CeilDiv(dest_one, db_["PAD_WPTX"]), db_["PAD_DIMX"]),
- Ceil(CeilDiv(dest_two, db_["PAD_WPTY"]), db_["PAD_DIMY"])
- };
- const auto local = std::vector<size_t>{db_["PAD_DIMX"], db_["PAD_DIMY"]};
- return RunKernel(kernel, global, local, event, waitForEvents);
- }
- }
- } catch (...) { return StatusCode::kInvalidKernel; }
-}
-
-// =================================================================================================
-
-// Compiles the templated class
-template class Routine<half>;
-template class Routine<float>;
-template class Routine<double>;
-template class Routine<float2>;
-template class Routine<double2>;
-
-// =================================================================================================
-} // namespace clblast
diff --git a/src/routine.cpp b/src/routine.cpp
new file mode 100644
index 00000000..d3590896
--- /dev/null
+++ b/src/routine.cpp
@@ -0,0 +1,131 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file implements the Routine base class (see the header for information about the class).
+//
+// =================================================================================================
+
+#include <string>
+#include <vector>
+
+#include "routine.hpp"
+
+namespace clblast {
+// =================================================================================================
+
+// Constructor: not much here, because no status codes can be returned
+Routine::Routine(Queue &queue, EventPointer event, const std::string &name,
+ const std::vector<std::string> &routines, const Precision precision):
+ precision_(precision),
+ routine_name_(name),
+ queue_(queue),
+ event_(event),
+ context_(queue_.GetContext()),
+ device_(queue_.GetDevice()),
+ device_name_(device_.Name()),
+ db_(queue_, routines, precision_) {
+}
+
+// =================================================================================================
+
+// Separate set-up function to allow for status codes to be returned
+StatusCode Routine::SetUp() {
+
+ // Queries the cache to see whether or not the program (context-specific) is already there
+ if (ProgramIsInCache(context_, precision_, routine_name_)) { return StatusCode::kSuccess; }
+
+ // Queries the cache to see whether or not the binary (device-specific) is already there. If it
+ // is, a program is created and stored in the cache
+ if (BinaryIsInCache(device_name_, precision_, routine_name_)) {
+ try {
+ auto& binary = GetBinaryFromCache(device_name_, precision_, routine_name_);
+ auto program = Program(device_, context_, binary);
+ auto options = std::vector<std::string>();
+ program.Build(device_, options);
+ StoreProgramToCache(program, context_, precision_, routine_name_);
+ } catch (...) { return StatusCode::kBuildProgramFailure; }
+ return StatusCode::kSuccess;
+ }
+
+ // Otherwise, the kernel will be compiled and program will be built. Both the binary and the
+ // program will be added to the cache.
+
+ // Inspects whether or not cl_khr_fp64 is supported in case of double precision
+ const auto extensions = device_.Capabilities();
+ if (precision_ == Precision::kDouble || precision_ == Precision::kComplexDouble) {
+ if (extensions.find(kKhronosDoublePrecision) == std::string::npos) {
+ return StatusCode::kNoDoublePrecision;
+ }
+ }
+
+ // As above, but for cl_khr_fp16 (half precision)
+ if (precision_ == Precision::kHalf) {
+ if (extensions.find(kKhronosHalfPrecision) == std::string::npos) {
+ return StatusCode::kNoHalfPrecision;
+ }
+ }
+
+ // Loads the common header (typedefs and defines and such)
+ std::string common_header =
+ #include "kernels/common.opencl"
+ ;
+
+ // Collects the parameters for this device in the form of defines, and adds the precision
+ auto defines = db_.GetDefines();
+ defines += "#define PRECISION "+ToString(static_cast<int>(precision_))+"\n";
+
+ // Adds the name of the routine as a define
+ defines += "#define ROUTINE_"+routine_name_+"\n";
+
+ // For specific devices, use the non-IEE754 compilant OpenCL mad() instruction. This can improve
+ // performance, but might result in a reduced accuracy.
+ if (device_.IsAMD() && device_.IsGPU()) {
+ defines += "#define USE_CL_MAD 1\n";
+ }
+
+ // For specific devices, use staggered/shuffled workgroup indices.
+ if (device_.IsAMD() && device_.IsGPU()) {
+ defines += "#define USE_STAGGERED_INDICES 1\n";
+ }
+
+ // For specific devices add a global synchronisation barrier to the GEMM kernel to optimize
+ // performance through better cache behaviour
+ if (device_.IsARM() && device_.IsGPU()) {
+ defines += "#define GLOBAL_MEM_FENCE 1\n";
+ }
+
+ // Combines everything together into a single source string
+ const auto source_string = defines + common_header + source_string_;
+
+ // Compiles the kernel
+ try {
+ auto program = Program(context_, source_string);
+ auto options = std::vector<std::string>();
+ const auto build_status = program.Build(device_, options);
+
+ // Checks for compiler crashes/errors/warnings
+ if (build_status == BuildStatus::kError) {
+ const auto message = program.GetBuildInfo(device_);
+ fprintf(stdout, "OpenCL compiler error/warning: %s\n", message.c_str());
+ return StatusCode::kBuildProgramFailure;
+ }
+ if (build_status == BuildStatus::kInvalid) { return StatusCode::kInvalidBinary; }
+
+ // Store the compiled binary and program in the cache
+ const auto binary = program.GetIR();
+ StoreBinaryToCache(binary, device_name_, precision_, routine_name_);
+ StoreProgramToCache(program, context_, precision_, routine_name_);
+ } catch (...) { return StatusCode::kBuildProgramFailure; }
+
+ // No errors, normal termination of this function
+ return StatusCode::kSuccess;
+}
+
+// =================================================================================================
+} // namespace clblast
diff --git a/src/routine.hpp b/src/routine.hpp
new file mode 100644
index 00000000..54b5779f
--- /dev/null
+++ b/src/routine.hpp
@@ -0,0 +1,68 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file implements all the basic functionality for the BLAS routines. This class serves as a
+// base class for the actual routines (e.g. Xaxpy, Xgemm). It contains common functionality such as
+// compiling the OpenCL kernel, connecting to the database, etc.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_ROUTINE_H_
+#define CLBLAST_ROUTINE_H_
+
+#include <string>
+#include <vector>
+
+#include "utilities.hpp"
+#include "cache.hpp"
+#include "buffer_test.hpp"
+#include "database/database.hpp"
+#include "routines/common.hpp"
+
+namespace clblast {
+// =================================================================================================
+
+// See comment at top of file for a description of the class
+class Routine {
+ public:
+
+ // Base class constructor
+ explicit Routine(Queue &queue, EventPointer event, const std::string &name,
+ const std::vector<std::string> &routines, const Precision precision);
+
+ // Set-up phase of the kernel
+ StatusCode SetUp();
+
+ protected:
+
+ // Non-static variable for the precision
+ const Precision precision_;
+
+ // The routine's name and its kernel-source in string form
+ const std::string routine_name_;
+ std::string source_string_;
+
+ // The OpenCL objects, accessible only from derived classes
+ Queue queue_;
+ EventPointer event_;
+ const Context context_;
+ const Device device_;
+
+ // OpenCL device properties
+ const std::string device_name_;
+
+ // Connection to the database for all the device-specific parameters
+ const Database db_;
+};
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_ROUTINE_H_
+#endif
diff --git a/src/routines/common.cpp b/src/routines/common.cpp
new file mode 100644
index 00000000..c378df28
--- /dev/null
+++ b/src/routines/common.cpp
@@ -0,0 +1,65 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file implements the common routine functions (see the header for more information).
+//
+// =================================================================================================
+
+#include <vector>
+
+#include "routines/common.hpp"
+
+namespace clblast {
+// =================================================================================================
+
+// Enqueues a kernel, waits for completion, and checks for errors
+StatusCode RunKernel(Kernel &kernel, Queue &queue, const Device &device,
+ std::vector<size_t> global, const std::vector<size_t> &local,
+ EventPointer event, std::vector<Event>& waitForEvents) {
+
+ // Tests for validity of the local thread sizes
+ if (local.size() > device.MaxWorkItemDimensions()) {
+ return StatusCode::kInvalidLocalNumDimensions;
+ }
+ const auto max_work_item_sizes = device.MaxWorkItemSizes();
+ for (auto i=size_t{0}; i<local.size(); ++i) {
+ if (local[i] > max_work_item_sizes[i]) { return StatusCode::kInvalidLocalThreadsDim; }
+ }
+ auto local_size = size_t{1};
+ for (auto &item: local) { local_size *= item; }
+ if (local_size > device.MaxWorkGroupSize()) { return StatusCode::kInvalidLocalThreadsTotal; }
+
+ // Make sure the global thread sizes are at least equal to the local sizes
+ for (auto i=size_t{0}; i<global.size(); ++i) {
+ if (global[i] < local[i]) { global[i] = local[i]; }
+ }
+
+ // Tests for local memory usage
+ const auto local_mem_usage = kernel.LocalMemUsage(device);
+ if (!device.IsLocalMemoryValid(local_mem_usage)) { return StatusCode::kInvalidLocalMemUsage; }
+
+ // Launches the kernel (and checks for launch errors)
+ try {
+ kernel.Launch(queue, global, local, event, waitForEvents);
+ } catch (...) { return StatusCode::kKernelLaunchError; }
+
+ // No errors, normal termination of this function
+ return StatusCode::kSuccess;
+}
+
+// As above, but without an event waiting list
+StatusCode RunKernel(Kernel &kernel, Queue &queue, const Device &device,
+ std::vector<size_t> global, const std::vector<size_t> &local,
+ EventPointer event) {
+ auto emptyWaitingList = std::vector<Event>();
+ return RunKernel(kernel, queue, device, global, local, event, emptyWaitingList);
+}
+
+// =================================================================================================
+} // namespace clblast
diff --git a/src/routines/common.hpp b/src/routines/common.hpp
new file mode 100644
index 00000000..c99cd39d
--- /dev/null
+++ b/src/routines/common.hpp
@@ -0,0 +1,173 @@
+
+// =================================================================================================
+// This file is part of the CLBlast project. The project is licensed under Apache Version 2.0. This
+// project loosely follows the Google C++ styleguide and uses a tab-size of two spaces and a max-
+// width of 100 characters per line.
+//
+// Author(s):
+// Cedric Nugteren <www.cedricnugteren.nl>
+//
+// This file contains all the interfaces to common kernels, such as copying, padding, and
+// transposing a matrix. These functions are templated and thus header-only. This file also contains
+// other common functions to routines, such as a function to launch a kernel.
+//
+// =================================================================================================
+
+#ifndef CLBLAST_ROUTINES_COMMON_H_
+#define CLBLAST_ROUTINES_COMMON_H_
+
+#include <string>
+#include <vector>
+
+#include "clblast.h"
+#include "clpp11.hpp"
+#include "database/database.hpp"
+
+namespace clblast {
+// =================================================================================================
+
+// Enqueues a kernel, waits for completion, and checks for errors
+StatusCode RunKernel(Kernel &kernel, Queue &queue, const Device &device,
+ std::vector<size_t> global, const std::vector<size_t> &local,
+ EventPointer event, std::vector<Event>& waitForEvents);
+
+// As above, but without an event waiting list
+StatusCode RunKernel(Kernel &kernel, Queue &queue, const Device &device,
+ std::vector<size_t> global, const std::vector<size_t> &local,
+ EventPointer event);
+
+// =================================================================================================
+
+// Copies or transposes a matrix and optionally pads/unpads it with zeros. This method is also able
+// to write to symmetric and triangular matrices through optional arguments.
+template <typename T>
+StatusCode PadCopyTransposeMatrix(Queue &queue, const Device &device, const Context &context,
+ const Database &db,
+ EventPointer event, std::vector<Event>& waitForEvents,
+ const size_t src_one, const size_t src_two,
+ const size_t src_ld, const size_t src_offset,
+ const Buffer<T> &src,
+ const size_t dest_one, const size_t dest_two,
+ const size_t dest_ld, const size_t dest_offset,
+ const Buffer<T> &dest,
+ const T alpha,
+ const Program &program, const bool do_pad,
+ const bool do_transpose, const bool do_conjugate,
+ const bool upper = false, const bool lower = false,
+ const bool diagonal_imag_zero = false) {
+
+ // Determines whether or not the fast-version could potentially be used
+ auto use_fast_kernel = (src_offset == 0) && (dest_offset == 0) && (do_conjugate == false) &&
+ (src_one == dest_one) && (src_two == dest_two) && (src_ld == dest_ld) &&
+ (upper == false) && (lower == false) && (diagonal_imag_zero == false);
+
+ // Determines the right kernel
+ auto kernel_name = std::string{};
+ if (do_transpose) {
+ if (use_fast_kernel &&
+ IsMultiple(src_ld, db["TRA_WPT"]) &&
+ IsMultiple(src_one, db["TRA_WPT"]*db["TRA_WPT"]) &&
+ IsMultiple(src_two, db["TRA_WPT"]*db["TRA_WPT"])) {
+ kernel_name = "TransposeMatrixFast";
+ }
+ else {
+ use_fast_kernel = false;
+ kernel_name = (do_pad) ? "TransposePadMatrix" : "TransposeMatrix";
+ }
+ }
+ else {
+ if (use_fast_kernel &&
+ IsMultiple(src_ld, db["COPY_VW"]) &&
+ IsMultiple(src_one, db["COPY_VW"]*db["COPY_DIMX"]) &&
+ IsMultiple(src_two, db["COPY_WPT"]*db["COPY_DIMY"])) {
+ kernel_name = "CopyMatrixFast";
+ }
+ else {
+ use_fast_kernel = false;
+ kernel_name = (do_pad) ? "CopyPadMatrix" : "CopyMatrix";
+ }
+ }
+
+ // Upload the scalar argument as a constant buffer to the device (needed for half-precision)
+ auto alpha_buffer = Buffer<T>(context, 1);
+ alpha_buffer.Write(queue, 1, &alpha);
+
+ // Retrieves the kernel from the compiled binary
+ try {
+ auto kernel = Kernel(program, kernel_name);
+
+ // Sets the kernel arguments
+ if (use_fast_kernel) {
+ kernel.SetArgument(0, static_cast<int>(src_ld));
+ kernel.SetArgument(1, src());
+ kernel.SetArgument(2, dest());
+ kernel.SetArgument(3, alpha_buffer());
+ }
+ else {
+ kernel.SetArgument(0, static_cast<int>(src_one));
+ kernel.SetArgument(1, static_cast<int>(src_two));
+ kernel.SetArgument(2, static_cast<int>(src_ld));
+ kernel.SetArgument(3, static_cast<int>(src_offset));
+ kernel.SetArgument(4, src());
+ kernel.SetArgument(5, static_cast<int>(dest_one));
+ kernel.SetArgument(6, static_cast<int>(dest_two));
+ kernel.SetArgument(7, static_cast<int>(dest_ld));
+ kernel.SetArgument(8, static_cast<int>(dest_offset));
+ kernel.SetArgument(9, dest());
+ kernel.SetArgument(10, alpha_buffer());
+ if (do_pad) {
+ kernel.SetArgument(11, static_cast<int>(do_conjugate));
+ }
+ else {
+ kernel.SetArgument(11, static_cast<int>(upper));
+ kernel.SetArgument(12, static_cast<int>(lower));
+ kernel.SetArgument(13, static_cast<int>(diagonal_imag_zero));
+ }
+ }
+
+ // Launches the kernel and returns the error code. Uses global and local thread sizes based on
+ // parameters in the database.
+ if (do_transpose) {
+ if (use_fast_kernel) {
+ const auto global = std::vector<size_t>{
+ dest_one / db["TRA_WPT"],
+ dest_two / db["TRA_WPT"]
+ };
+ const auto local = std::vector<size_t>{db["TRA_DIM"], db["TRA_DIM"]};
+ return RunKernel(kernel, queue, device, global, local, event, waitForEvents);
+ }
+ else {
+ const auto global = std::vector<size_t>{
+ Ceil(CeilDiv(dest_one, db["PADTRA_WPT"]), db["PADTRA_TILE"]),
+ Ceil(CeilDiv(dest_two, db["PADTRA_WPT"]), db["PADTRA_TILE"])
+ };
+ const auto local = std::vector<size_t>{db["PADTRA_TILE"], db["PADTRA_TILE"]};
+ return RunKernel(kernel, queue, device, global, local, event, waitForEvents);
+ }
+ }
+ else {
+ if (use_fast_kernel) {
+ const auto global = std::vector<size_t>{
+ dest_one / db["COPY_VW"],
+ dest_two / db["COPY_WPT"]
+ };
+ const auto local = std::vector<size_t>{db["COPY_DIMX"], db["COPY_DIMY"]};
+ return RunKernel(kernel, queue, device, global, local, event, waitForEvents);
+ }
+ else {
+ const auto global = std::vector<size_t>{
+ Ceil(CeilDiv(dest_one, db["PAD_WPTX"]), db["PAD_DIMX"]),
+ Ceil(CeilDiv(dest_two, db["PAD_WPTY"]), db["PAD_DIMY"])
+ };
+ const auto local = std::vector<size_t>{db["PAD_DIMX"], db["PAD_DIMY"]};
+ return RunKernel(kernel, queue, device, global, local, event, waitForEvents);
+ }
+ }
+ } catch (...) { return StatusCode::kInvalidKernel; }
+}
+
+// =================================================================================================
+} // namespace clblast
+
+// CLBLAST_ROUTINES_COMMON_H_
+#endif
diff --git a/src/routines/level1/xamax.cc b/src/routines/level1/xamax.cpp
index 335e59bc..6b6e7f9e 100644
--- a/src/routines/level1/xamax.cc
+++ b/src/routines/level1/xamax.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xamax.h"
+#include "routines/level1/xamax.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xamax<half>::precision_ = Precision::kHalf;
-template <> const Precision Xamax<float>::precision_ = Precision::kSingle;
-template <> const Precision Xamax<double>::precision_ = Precision::kDouble;
-template <> const Precision Xamax<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xamax<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xamax<T>::Xamax(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xdot"}, precision_) {
+ Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/xamax.opencl"
;
@@ -49,14 +40,14 @@ StatusCode Xamax<T>::DoAmax(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorIndex(1, imax_buffer, imax_offset, sizeof(unsigned int));
+ status = TestVectorIndex(1, imax_buffer, imax_offset);
if (ErrorIn(status)) { return status; }
// Retrieves the Xamax kernels from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel1 = Kernel(program, "Xamax");
auto kernel2 = Kernel(program, "XamaxEpilogue");
@@ -80,7 +71,7 @@ StatusCode Xamax<T>::DoAmax(const size_t n,
auto global1 = std::vector<size_t>{db_["WGS1"]*temp_size};
auto local1 = std::vector<size_t>{db_["WGS1"]};
auto kernelEvent = Event();
- status = RunKernel(kernel1, global1, local1, kernelEvent.pointer());
+ status = RunKernel(kernel1, queue_, device_, global1, local1, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(kernelEvent);
@@ -93,7 +84,7 @@ StatusCode Xamax<T>::DoAmax(const size_t n,
// Launches the epilogue kernel
auto global2 = std::vector<size_t>{db_["WGS2"]};
auto local2 = std::vector<size_t>{db_["WGS2"]};
- status = RunKernel(kernel2, global2, local2, event_, eventWaitList);
+ status = RunKernel(kernel2, queue_, device_, global2, local2, event_, eventWaitList);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level1/xamax.h b/src/routines/level1/xamax.hpp
index c318115e..aa45a8e4 100644
--- a/include/internal/routines/level1/xamax.h
+++ b/src/routines/level1/xamax.hpp
@@ -14,28 +14,16 @@
#ifndef CLBLAST_ROUTINES_XAMAX_H_
#define CLBLAST_ROUTINES_XAMAX_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xamax: public Routine<T> {
+class Xamax: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorIndex;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xamax(Queue &queue, EventPointer event, const std::string &name = "AMAX");
@@ -43,10 +31,6 @@ class Xamax: public Routine<T> {
StatusCode DoAmax(const size_t n,
const Buffer<unsigned int> &imax_buffer, const size_t imax_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xasum.cc b/src/routines/level1/xasum.cpp
index e04f7064..0c1ce903 100644
--- a/src/routines/level1/xasum.cc
+++ b/src/routines/level1/xasum.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xasum.h"
+#include "routines/level1/xasum.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xasum<half>::precision_ = Precision::kHalf;
-template <> const Precision Xasum<float>::precision_ = Precision::kSingle;
-template <> const Precision Xasum<double>::precision_ = Precision::kDouble;
-template <> const Precision Xasum<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xasum<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xasum<T>::Xasum(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xdot"}, precision_) {
+ Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/xasum.opencl"
;
@@ -49,14 +40,14 @@ StatusCode Xasum<T>::DoAsum(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorDot(1, asum_buffer, asum_offset, sizeof(T));
+ status = TestVectorScalar(1, asum_buffer, asum_offset);
if (ErrorIn(status)) { return status; }
// Retrieves the Xasum kernels from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel1 = Kernel(program, "Xasum");
auto kernel2 = Kernel(program, "XasumEpilogue");
@@ -78,7 +69,7 @@ StatusCode Xasum<T>::DoAsum(const size_t n,
auto global1 = std::vector<size_t>{db_["WGS1"]*temp_size};
auto local1 = std::vector<size_t>{db_["WGS1"]};
auto kernelEvent = Event();
- status = RunKernel(kernel1, global1, local1, kernelEvent.pointer());
+ status = RunKernel(kernel1, queue_, device_, global1, local1, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(kernelEvent);
@@ -90,7 +81,7 @@ StatusCode Xasum<T>::DoAsum(const size_t n,
// Launches the epilogue kernel
auto global2 = std::vector<size_t>{db_["WGS2"]};
auto local2 = std::vector<size_t>{db_["WGS2"]};
- status = RunKernel(kernel2, global2, local2, event_, eventWaitList);
+ status = RunKernel(kernel2, queue_, device_, global2, local2, event_, eventWaitList);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level1/xasum.h b/src/routines/level1/xasum.hpp
index b6e5d2cd..5a253f4d 100644
--- a/include/internal/routines/level1/xasum.h
+++ b/src/routines/level1/xasum.hpp
@@ -14,28 +14,16 @@
#ifndef CLBLAST_ROUTINES_XASUM_H_
#define CLBLAST_ROUTINES_XASUM_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xasum: public Routine<T> {
+class Xasum: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorDot;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xasum(Queue &queue, EventPointer event, const std::string &name = "ASUM");
@@ -43,10 +31,6 @@ class Xasum: public Routine<T> {
StatusCode DoAsum(const size_t n,
const Buffer<T> &asum_buffer, const size_t asum_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xaxpy.cc b/src/routines/level1/xaxpy.cpp
index 66aa2336..5b6c9e77 100644
--- a/src/routines/level1/xaxpy.cc
+++ b/src/routines/level1/xaxpy.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xaxpy.h"
+#include "routines/level1/xaxpy.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xaxpy<half>::precision_ = Precision::kHalf;
-template <> const Precision Xaxpy<float>::precision_ = Precision::kSingle;
-template <> const Precision Xaxpy<double>::precision_ = Precision::kDouble;
-template <> const Precision Xaxpy<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xaxpy<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xaxpy<T>::Xaxpy(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xaxpy"}, precision_) {
+ Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/level1.opencl"
#include "../../kernels/level1/xaxpy.opencl"
@@ -50,9 +41,9 @@ StatusCode Xaxpy<T>::DoAxpy(const size_t n, const T alpha,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Determines whether or not the fast-version can be used
@@ -65,7 +56,7 @@ StatusCode Xaxpy<T>::DoAxpy(const size_t n, const T alpha,
// Retrieves the Xaxpy kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Upload the scalar argument as a constant buffer to the device (needed for half-precision)
@@ -94,13 +85,13 @@ StatusCode Xaxpy<T>::DoAxpy(const size_t n, const T alpha,
if (use_fast_kernel) {
auto global = std::vector<size_t>{CeilDiv(n, db_["WPT"]*db_["VW"])};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
else {
auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
auto global = std::vector<size_t>{n_ceiled/db_["WPT"]};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
if (ErrorIn(status)) { return status; }
diff --git a/include/internal/routines/level1/xaxpy.h b/src/routines/level1/xaxpy.hpp
index 03771d53..caac871e 100644
--- a/include/internal/routines/level1/xaxpy.h
+++ b/src/routines/level1/xaxpy.hpp
@@ -14,28 +14,16 @@
#ifndef CLBLAST_ROUTINES_XAXPY_H_
#define CLBLAST_ROUTINES_XAXPY_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xaxpy: public Routine<T> {
+class Xaxpy: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xaxpy(Queue &queue, EventPointer event, const std::string &name = "AXPY");
@@ -43,10 +31,6 @@ class Xaxpy: public Routine<T> {
StatusCode DoAxpy(const size_t n, const T alpha,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xcopy.cc b/src/routines/level1/xcopy.cpp
index ff8f5999..673ef349 100644
--- a/src/routines/level1/xcopy.cc
+++ b/src/routines/level1/xcopy.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xcopy.h"
+#include "routines/level1/xcopy.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xcopy<half>::precision_ = Precision::kHalf;
-template <> const Precision Xcopy<float>::precision_ = Precision::kSingle;
-template <> const Precision Xcopy<double>::precision_ = Precision::kDouble;
-template <> const Precision Xcopy<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xcopy<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xcopy<T>::Xcopy(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xaxpy"}, precision_) {
+ Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/level1.opencl"
#include "../../kernels/level1/xcopy.opencl"
@@ -50,9 +41,9 @@ StatusCode Xcopy<T>::DoCopy(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Determines whether or not the fast-version can be used
@@ -65,7 +56,7 @@ StatusCode Xcopy<T>::DoCopy(const size_t n,
// Retrieves the Xcopy kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the kernel arguments
@@ -88,13 +79,13 @@ StatusCode Xcopy<T>::DoCopy(const size_t n,
if (use_fast_kernel) {
auto global = std::vector<size_t>{CeilDiv(n, db_["WPT"]*db_["VW"])};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
else {
auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
auto global = std::vector<size_t>{n_ceiled/db_["WPT"]};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
if (ErrorIn(status)) { return status; }
diff --git a/include/internal/routines/level1/xcopy.h b/src/routines/level1/xcopy.hpp
index 5786cb0f..0c424ba3 100644
--- a/include/internal/routines/level1/xcopy.h
+++ b/src/routines/level1/xcopy.hpp
@@ -14,27 +14,16 @@
#ifndef CLBLAST_ROUTINES_XCOPY_H_
#define CLBLAST_ROUTINES_XCOPY_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xcopy: public Routine<T> {
+class Xcopy: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xcopy(Queue &queue, EventPointer event, const std::string &name = "COPY");
@@ -42,10 +31,6 @@ class Xcopy: public Routine<T> {
StatusCode DoCopy(const size_t n,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xdot.cc b/src/routines/level1/xdot.cpp
index db6a369e..bafea157 100644
--- a/src/routines/level1/xdot.cc
+++ b/src/routines/level1/xdot.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xdot.h"
+#include "routines/level1/xdot.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xdot<half>::precision_ = Precision::kHalf;
-template <> const Precision Xdot<float>::precision_ = Precision::kSingle;
-template <> const Precision Xdot<double>::precision_ = Precision::kDouble;
-template <> const Precision Xdot<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xdot<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xdot<T>::Xdot(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xdot"}, precision_) {
+ Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/xdot.opencl"
;
@@ -51,16 +42,16 @@ StatusCode Xdot<T>::DoDot(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorDot(1, dot_buffer, dot_offset, sizeof(T));
+ status = TestVectorScalar(1, dot_buffer, dot_offset);
if (ErrorIn(status)) { return status; }
// Retrieves the Xdot kernels from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel1 = Kernel(program, "Xdot");
auto kernel2 = Kernel(program, "XdotEpilogue");
@@ -86,7 +77,7 @@ StatusCode Xdot<T>::DoDot(const size_t n,
auto global1 = std::vector<size_t>{db_["WGS1"]*temp_size};
auto local1 = std::vector<size_t>{db_["WGS1"]};
auto kernelEvent = Event();
- status = RunKernel(kernel1, global1, local1, kernelEvent.pointer());
+ status = RunKernel(kernel1, queue_, device_, global1, local1, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(kernelEvent);
@@ -98,7 +89,7 @@ StatusCode Xdot<T>::DoDot(const size_t n,
// Launches the epilogue kernel
auto global2 = std::vector<size_t>{db_["WGS2"]};
auto local2 = std::vector<size_t>{db_["WGS2"]};
- status = RunKernel(kernel2, global2, local2, event_, eventWaitList);
+ status = RunKernel(kernel2, queue_, device_, global2, local2, event_, eventWaitList);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level1/xdot.h b/src/routines/level1/xdot.hpp
index 95a7ad07..02c1efaa 100644
--- a/include/internal/routines/level1/xdot.h
+++ b/src/routines/level1/xdot.hpp
@@ -14,29 +14,16 @@
#ifndef CLBLAST_ROUTINES_XDOT_H_
#define CLBLAST_ROUTINES_XDOT_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xdot: public Routine<T> {
+class Xdot: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::TestVectorDot;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xdot(Queue &queue, EventPointer event, const std::string &name = "DOT");
@@ -46,10 +33,6 @@ class Xdot: public Routine<T> {
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc,
const bool do_conjugate = false);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xdotc.cc b/src/routines/level1/xdotc.cpp
index b3a01079..27cf2bab 100644
--- a/src/routines/level1/xdotc.cc
+++ b/src/routines/level1/xdotc.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xdotc.h"
+#include "routines/level1/xdotc.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level1/xdotc.h b/src/routines/level1/xdotc.hpp
index 0dc2cfe9..b8cbdaf5 100644
--- a/include/internal/routines/level1/xdotc.h
+++ b/src/routines/level1/xdotc.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XDOTC_H_
#define CLBLAST_ROUTINES_XDOTC_H_
-#include "internal/routines/level1/xdot.h"
+#include "routines/level1/xdot.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level1/xdotu.cc b/src/routines/level1/xdotu.cpp
index 8dded6e0..0bce70b7 100644
--- a/src/routines/level1/xdotu.cc
+++ b/src/routines/level1/xdotu.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xdotu.h"
+#include "routines/level1/xdotu.hpp"
#include <string>
diff --git a/include/internal/routines/level1/xdotu.h b/src/routines/level1/xdotu.hpp
index 98988744..b3f73086 100644
--- a/include/internal/routines/level1/xdotu.h
+++ b/src/routines/level1/xdotu.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XDOTU_H_
#define CLBLAST_ROUTINES_XDOTU_H_
-#include "internal/routines/level1/xdot.h"
+#include "routines/level1/xdot.hpp"
namespace clblast {
// =================================================================================================
diff --git a/include/internal/routines/level1/xmax.h b/src/routines/level1/xmax.hpp
index a872cede..5a0236f2 100644
--- a/include/internal/routines/level1/xmax.h
+++ b/src/routines/level1/xmax.hpp
@@ -14,8 +14,8 @@
#ifndef CLBLAST_ROUTINES_XMAX_H_
#define CLBLAST_ROUTINES_XMAX_H_
-#include "internal/routine.h"
-#include "internal/routines/level1/xamax.h"
+#include "routine.hpp"
+#include "routines/level1/xamax.hpp"
namespace clblast {
// =================================================================================================
diff --git a/include/internal/routines/level1/xmin.h b/src/routines/level1/xmin.hpp
index 700c81cc..6befec64 100644
--- a/include/internal/routines/level1/xmin.h
+++ b/src/routines/level1/xmin.hpp
@@ -14,8 +14,8 @@
#ifndef CLBLAST_ROUTINES_XMIN_H_
#define CLBLAST_ROUTINES_XMIN_H_
-#include "internal/routine.h"
-#include "internal/routines/level1/xamax.h"
+#include "routine.hpp"
+#include "routines/level1/xamax.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level1/xnrm2.cc b/src/routines/level1/xnrm2.cpp
index 14f7f6aa..97615d8b 100644
--- a/src/routines/level1/xnrm2.cc
+++ b/src/routines/level1/xnrm2.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xnrm2.h"
+#include "routines/level1/xnrm2.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xnrm2<half>::precision_ = Precision::kHalf;
-template <> const Precision Xnrm2<float>::precision_ = Precision::kSingle;
-template <> const Precision Xnrm2<double>::precision_ = Precision::kDouble;
-template <> const Precision Xnrm2<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xnrm2<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xnrm2<T>::Xnrm2(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xdot"}, precision_) {
+ Routine(queue, event, name, {"Xdot"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/xnrm2.opencl"
;
@@ -49,14 +40,14 @@ StatusCode Xnrm2<T>::DoNrm2(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorDot(1, nrm2_buffer, nrm2_offset, sizeof(T));
+ status = TestVectorScalar(1, nrm2_buffer, nrm2_offset);
if (ErrorIn(status)) { return status; }
// Retrieves the Xnrm2 kernels from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel1 = Kernel(program, "Xnrm2");
auto kernel2 = Kernel(program, "Xnrm2Epilogue");
@@ -78,7 +69,7 @@ StatusCode Xnrm2<T>::DoNrm2(const size_t n,
auto global1 = std::vector<size_t>{db_["WGS1"]*temp_size};
auto local1 = std::vector<size_t>{db_["WGS1"]};
auto kernelEvent = Event();
- status = RunKernel(kernel1, global1, local1, kernelEvent.pointer());
+ status = RunKernel(kernel1, queue_, device_, global1, local1, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(kernelEvent);
@@ -90,7 +81,7 @@ StatusCode Xnrm2<T>::DoNrm2(const size_t n,
// Launches the epilogue kernel
auto global2 = std::vector<size_t>{db_["WGS2"]};
auto local2 = std::vector<size_t>{db_["WGS2"]};
- status = RunKernel(kernel2, global2, local2, event_, eventWaitList);
+ status = RunKernel(kernel2, queue_, device_, global2, local2, event_, eventWaitList);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level1/xnrm2.h b/src/routines/level1/xnrm2.hpp
index 6f6ca74f..7baf07f5 100644
--- a/include/internal/routines/level1/xnrm2.h
+++ b/src/routines/level1/xnrm2.hpp
@@ -14,28 +14,16 @@
#ifndef CLBLAST_ROUTINES_XNRM2_H_
#define CLBLAST_ROUTINES_XNRM2_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xnrm2: public Routine<T> {
+class Xnrm2: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorDot;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xnrm2(Queue &queue, EventPointer event, const std::string &name = "NRM2");
@@ -43,10 +31,6 @@ class Xnrm2: public Routine<T> {
StatusCode DoNrm2(const size_t n,
const Buffer<T> &nrm2_buffer, const size_t nrm2_offset,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level1/xscal.cc b/src/routines/level1/xscal.cpp
index 1207acfa..bcc43c3b 100644
--- a/src/routines/level1/xscal.cc
+++ b/src/routines/level1/xscal.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xscal.h"
+#include "routines/level1/xscal.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xscal<half>::precision_ = Precision::kHalf;
-template <> const Precision Xscal<float>::precision_ = Precision::kSingle;
-template <> const Precision Xscal<double>::precision_ = Precision::kDouble;
-template <> const Precision Xscal<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xscal<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xscal<T>::Xscal(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xaxpy"}, precision_) {
+ Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/level1.opencl"
#include "../../kernels/level1/xscal.opencl"
@@ -49,7 +40,7 @@ StatusCode Xscal<T>::DoScal(const size_t n, const T alpha,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vector for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
// Determines whether or not the fast-version can be used
@@ -61,7 +52,7 @@ StatusCode Xscal<T>::DoScal(const size_t n, const T alpha,
// Retrieves the Xscal kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the kernel arguments
@@ -82,13 +73,13 @@ StatusCode Xscal<T>::DoScal(const size_t n, const T alpha,
if (use_fast_kernel) {
auto global = std::vector<size_t>{CeilDiv(n, db_["WPT"]*db_["VW"])};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
else {
auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
auto global = std::vector<size_t>{n_ceiled/db_["WPT"]};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
if (ErrorIn(status)) { return status; }
diff --git a/include/internal/routines/level1/xscal.h b/src/routines/level1/xscal.hpp
index e10a201d..6c585cb2 100644
--- a/include/internal/routines/level1/xscal.h
+++ b/src/routines/level1/xscal.hpp
@@ -14,36 +14,22 @@
#ifndef CLBLAST_ROUTINES_XSCAL_H_
#define CLBLAST_ROUTINES_XSCAL_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xscal: public Routine<T> {
+class Xscal: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xscal(Queue &queue, EventPointer event, const std::string &name = "SCAL");
// Templated-precision implementation of the routine
StatusCode DoScal(const size_t n, const T alpha,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/include/internal/routines/level1/xsum.h b/src/routines/level1/xsum.hpp
index 2f633b52..84e20bea 100644
--- a/include/internal/routines/level1/xsum.h
+++ b/src/routines/level1/xsum.hpp
@@ -14,8 +14,8 @@
#ifndef CLBLAST_ROUTINES_XSUM_H_
#define CLBLAST_ROUTINES_XSUM_H_
-#include "internal/routine.h"
-#include "internal/routines/level1/xasum.h"
+#include "routine.hpp"
+#include "routines/level1/xasum.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level1/xswap.cc b/src/routines/level1/xswap.cpp
index 8844abff..03907cbd 100644
--- a/src/routines/level1/xswap.cc
+++ b/src/routines/level1/xswap.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level1/xswap.h"
+#include "routines/level1/xswap.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xswap<half>::precision_ = Precision::kHalf;
-template <> const Precision Xswap<float>::precision_ = Precision::kSingle;
-template <> const Precision Xswap<double>::precision_ = Precision::kDouble;
-template <> const Precision Xswap<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xswap<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xswap<T>::Xswap(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xaxpy"}, precision_) {
+ Routine(queue, event, name, {"Xaxpy"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level1/level1.opencl"
#include "../../kernels/level1/xswap.opencl"
@@ -50,9 +41,9 @@ StatusCode Xswap<T>::DoSwap(const size_t n,
if (n == 0) { return StatusCode::kInvalidDimension; }
// Tests the vectors for validity
- auto status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ auto status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Determines whether or not the fast-version can be used
@@ -65,7 +56,7 @@ StatusCode Xswap<T>::DoSwap(const size_t n,
// Retrieves the Xswap kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the kernel arguments
@@ -88,13 +79,13 @@ StatusCode Xswap<T>::DoSwap(const size_t n,
if (use_fast_kernel) {
auto global = std::vector<size_t>{CeilDiv(n, db_["WPT"]*db_["VW"])};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
else {
auto n_ceiled = Ceil(n, db_["WGS"]*db_["WPT"]);
auto global = std::vector<size_t>{n_ceiled/db_["WPT"]};
auto local = std::vector<size_t>{db_["WGS"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
}
if (ErrorIn(status)) { return status; }
diff --git a/include/internal/routines/level1/xswap.h b/src/routines/level1/xswap.hpp
index 0f240763..4f9ea36d 100644
--- a/include/internal/routines/level1/xswap.h
+++ b/src/routines/level1/xswap.hpp
@@ -14,27 +14,16 @@
#ifndef CLBLAST_ROUTINES_XSWAP_H_
#define CLBLAST_ROUTINES_XSWAP_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xswap: public Routine<T> {
+class Xswap: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xswap(Queue &queue, EventPointer event, const std::string &name = "SWAP");
@@ -42,10 +31,6 @@ class Xswap: public Routine<T> {
StatusCode DoSwap(const size_t n,
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level2/xgbmv.cc b/src/routines/level2/xgbmv.cpp
index 7a30c34a..ea4f001c 100644
--- a/src/routines/level2/xgbmv.cc
+++ b/src/routines/level2/xgbmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xgbmv.h"
+#include "routines/level2/xgbmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xgbmv.h b/src/routines/level2/xgbmv.hpp
index bc94c77d..686ab642 100644
--- a/include/internal/routines/level2/xgbmv.h
+++ b/src/routines/level2/xgbmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XGBMV_H_
#define CLBLAST_ROUTINES_XGBMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xgemv.cc b/src/routines/level2/xgemv.cpp
index 71839e96..21fb397c 100644
--- a/src/routines/level2/xgemv.cc
+++ b/src/routines/level2/xgemv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xgemv<half>::precision_ = Precision::kHalf;
-template <> const Precision Xgemv<float>::precision_ = Precision::kSingle;
-template <> const Precision Xgemv<double>::precision_ = Precision::kDouble;
-template <> const Precision Xgemv<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xgemv<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xgemv<T>::Xgemv(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Pad", "Xgemv"}, precision_) {
+ Routine(queue, event, name, {"Pad", "Xgemv"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level2/xgemv.opencl"
#include "../../kernels/level2/xgemv_fast.opencl"
@@ -101,12 +92,12 @@ StatusCode Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
// Tests the matrix and the vectors for validity
auto status = StatusCode::kSuccess;
- if (packed) { status = TestMatrixAP(n, a_buffer, a_offset, sizeof(T)); }
- else { status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T)); }
+ if (packed) { status = TestMatrixAP(n, a_buffer, a_offset); }
+ else { status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld); }
if (ErrorIn(status)) { return status; }
- status = TestVectorX(n_real, x_buffer, x_offset, x_inc, sizeof(T));
+ status = TestVectorX(n_real, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(m_real, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(m_real, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Determines whether or not the fast-version can be used
@@ -143,7 +134,7 @@ StatusCode Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
// Retrieves the Xgemv kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the kernel arguments
@@ -169,7 +160,7 @@ StatusCode Xgemv<T>::MatVec(const Layout layout, const Transpose a_transpose,
// Launches the kernel
auto global = std::vector<size_t>{global_size};
auto local = std::vector<size_t>{local_size};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level2/xgemv.h b/src/routines/level2/xgemv.hpp
index 875f936e..e9afec8d 100644
--- a/include/internal/routines/level2/xgemv.h
+++ b/src/routines/level2/xgemv.hpp
@@ -14,30 +14,16 @@
#ifndef CLBLAST_ROUTINES_XGEMV_H_
#define CLBLAST_ROUTINES_XGEMV_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xgemv: public Routine<T> {
+class Xgemv: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixAP;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xgemv(Queue &queue, EventPointer event, const std::string &name = "GEMV");
@@ -61,10 +47,6 @@ class Xgemv: public Routine<T> {
bool fast_kernel, bool fast_kernel_rot,
const size_t parameter, const bool packed,
const size_t kl, const size_t ku);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level2/xger.cc b/src/routines/level2/xger.cpp
index d1f98990..353047d2 100644
--- a/src/routines/level2/xger.cc
+++ b/src/routines/level2/xger.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xger.h"
+#include "routines/level2/xger.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xger<half>::precision_ = Precision::kHalf;
-template <> const Precision Xger<float>::precision_ = Precision::kSingle;
-template <> const Precision Xger<double>::precision_ = Precision::kDouble;
-template <> const Precision Xger<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xger<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xger<T>::Xger(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xger"}, precision_) {
+ Routine(queue, event, name, {"Xger"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level2/level2.opencl"
#include "../../kernels/level2/xger.opencl"
@@ -58,11 +49,11 @@ StatusCode Xger<T>::DoGer(const Layout layout,
const auto a_two = (a_is_rowmajor) ? m : n;
// Tests the matrix and the vectors for validity
- auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestVectorX(m, x_buffer, x_offset, x_inc, sizeof(T));
+ status = TestVectorX(m, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Upload the scalar argument as a constant buffer to the device (needed for half-precision)
@@ -71,7 +62,7 @@ StatusCode Xger<T>::DoGer(const Layout layout,
// Retrieves the kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, "Xger");
// Sets the kernel arguments
@@ -94,7 +85,7 @@ StatusCode Xger<T>::DoGer(const Layout layout,
auto a_two_ceiled = Ceil(CeilDiv(a_two, db_["WPT"]), db_["WGS2"]);
auto global = std::vector<size_t>{a_one_ceiled, a_two_ceiled};
auto local = std::vector<size_t>{db_["WGS1"], db_["WGS2"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level2/xger.h b/src/routines/level2/xger.hpp
index 1d5c64bd..3c6abe44 100644
--- a/include/internal/routines/level2/xger.h
+++ b/src/routines/level2/xger.hpp
@@ -14,29 +14,16 @@
#ifndef CLBLAST_ROUTINES_XGER_H_
#define CLBLAST_ROUTINES_XGER_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xger: public Routine<T> {
+class Xger: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::TestMatrixA;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xger(Queue &queue, EventPointer event, const std::string &name = "GER");
@@ -47,10 +34,6 @@ class Xger: public Routine<T> {
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc,
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level2/xgerc.cc b/src/routines/level2/xgerc.cpp
index 73284b52..d9feda97 100644
--- a/src/routines/level2/xgerc.cc
+++ b/src/routines/level2/xgerc.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xgerc.h"
+#include "routines/level2/xgerc.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xgerc.h b/src/routines/level2/xgerc.hpp
index 6d06ef94..f1d04dfd 100644
--- a/include/internal/routines/level2/xgerc.h
+++ b/src/routines/level2/xgerc.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XGERC_H_
#define CLBLAST_ROUTINES_XGERC_H_
-#include "internal/routines/level2/xger.h"
+#include "routines/level2/xger.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xgeru.cc b/src/routines/level2/xgeru.cpp
index 7730d6a5..da9e91c2 100644
--- a/src/routines/level2/xgeru.cc
+++ b/src/routines/level2/xgeru.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xgeru.h"
+#include "routines/level2/xgeru.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xgeru.h b/src/routines/level2/xgeru.hpp
index 45ce1cba..fb50e917 100644
--- a/include/internal/routines/level2/xgeru.h
+++ b/src/routines/level2/xgeru.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XGERU_H_
#define CLBLAST_ROUTINES_XGERU_H_
-#include "internal/routines/level2/xger.h"
+#include "routines/level2/xger.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xhbmv.cc b/src/routines/level2/xhbmv.cpp
index 58591b50..f6c0e3c4 100644
--- a/src/routines/level2/xhbmv.cc
+++ b/src/routines/level2/xhbmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xhbmv.h"
+#include "routines/level2/xhbmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xhbmv.h b/src/routines/level2/xhbmv.hpp
index f0a6212c..d668eb88 100644
--- a/include/internal/routines/level2/xhbmv.h
+++ b/src/routines/level2/xhbmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XHBMV_H_
#define CLBLAST_ROUTINES_XHBMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xhemv.cc b/src/routines/level2/xhemv.cpp
index b4ef0fa4..2cbcf7b4 100644
--- a/src/routines/level2/xhemv.cc
+++ b/src/routines/level2/xhemv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xhemv.h"
+#include "routines/level2/xhemv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xhemv.h b/src/routines/level2/xhemv.hpp
index 3daf2457..8e062fd3 100644
--- a/include/internal/routines/level2/xhemv.h
+++ b/src/routines/level2/xhemv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XHEMV_H_
#define CLBLAST_ROUTINES_XHEMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xher.cc b/src/routines/level2/xher.cpp
index 73e7a47d..ed8ba9e9 100644
--- a/src/routines/level2/xher.cc
+++ b/src/routines/level2/xher.cpp
@@ -11,26 +11,17 @@
//
// =================================================================================================
-#include "internal/routines/level2/xher.h"
+#include "routines/level2/xher.hpp"
#include <string>
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xher<half, half>::precision_ = Precision::kHalf;
-template <> const Precision Xher<float, float>::precision_ = Precision::kSingle;
-template <> const Precision Xher<double, double>::precision_ = Precision::kDouble;
-template <> const Precision Xher<float2, float>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xher<double2, double>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T, typename U>
Xher<T,U>::Xher(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xger"}, precision_) {
+ Routine(queue, event, name, {"Xger"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level2/level2.opencl"
#include "../../kernels/level2/xher.opencl"
@@ -67,10 +58,10 @@ StatusCode Xher<T,U>::DoHer(const Layout layout, const Triangle triangle,
// Tests the matrix and the vectors for validity
auto status = StatusCode::kSuccess;
- if (packed) { status = TestMatrixAP(n, a_buffer, a_offset, sizeof(T)); }
- else { status = TestMatrixA(n, n, a_buffer, a_offset, a_ld, sizeof(T)); }
+ if (packed) { status = TestMatrixAP(n, a_buffer, a_offset); }
+ else { status = TestMatrixA(n, n, a_buffer, a_offset, a_ld); }
if (ErrorIn(status)) { return status; }
- status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
// If alpha is zero an update is not required
@@ -85,7 +76,7 @@ StatusCode Xher<T,U>::DoHer(const Layout layout, const Triangle triangle,
// Retrieves the kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, "Xher");
// Sets the kernel arguments
@@ -105,7 +96,7 @@ StatusCode Xher<T,U>::DoHer(const Layout layout, const Triangle triangle,
auto global_two = Ceil(CeilDiv(n, db_["WPT"]), db_["WGS2"]);
auto global = std::vector<size_t>{global_one, global_two};
auto local = std::vector<size_t>{db_["WGS1"], db_["WGS2"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level2/xher.h b/src/routines/level2/xher.hpp
index ebd20ee8..9ff6bf3f 100644
--- a/include/internal/routines/level2/xher.h
+++ b/src/routines/level2/xher.hpp
@@ -14,29 +14,16 @@
#ifndef CLBLAST_ROUTINES_XHER_H_
#define CLBLAST_ROUTINES_XHER_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T, typename U>
-class Xher: public Routine<T> {
+class Xher: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixAP;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xher(Queue &queue, EventPointer event, const std::string &name = "HER");
@@ -50,10 +37,6 @@ class Xher: public Routine<T> {
const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc,
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const bool packed = false);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level2/xher2.cc b/src/routines/level2/xher2.cpp
index a73dde52..50572cea 100644
--- a/src/routines/level2/xher2.cc
+++ b/src/routines/level2/xher2.cpp
@@ -11,26 +11,17 @@
//
// =================================================================================================
-#include "internal/routines/level2/xher2.h"
+#include "routines/level2/xher2.hpp"
#include <string>
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xher2<half>::precision_ = Precision::kHalf;
-template <> const Precision Xher2<float>::precision_ = Precision::kSingle;
-template <> const Precision Xher2<double>::precision_ = Precision::kDouble;
-template <> const Precision Xher2<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xher2<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xher2<T>::Xher2(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Xger"}, precision_) {
+ Routine(queue, event, name, {"Xger"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level2/level2.opencl"
#include "../../kernels/level2/xher2.opencl"
@@ -59,12 +50,12 @@ StatusCode Xher2<T>::DoHer2(const Layout layout, const Triangle triangle,
// Tests the matrix and the vectors for validity
auto status = StatusCode::kSuccess;
- if (packed) { status = TestMatrixAP(n, a_buffer, a_offset, sizeof(T)); }
- else { status = TestMatrixA(n, n, a_buffer, a_offset, a_ld, sizeof(T)); }
+ if (packed) { status = TestMatrixAP(n, a_buffer, a_offset); }
+ else { status = TestMatrixA(n, n, a_buffer, a_offset, a_ld); }
if (ErrorIn(status)) { return status; }
- status = TestVectorX(n, x_buffer, x_offset, x_inc, sizeof(T));
+ status = TestVectorX(n, x_buffer, x_offset, x_inc);
if (ErrorIn(status)) { return status; }
- status = TestVectorY(n, y_buffer, y_offset, y_inc, sizeof(T));
+ status = TestVectorY(n, y_buffer, y_offset, y_inc);
if (ErrorIn(status)) { return status; }
// Upload the scalar argument as a constant buffer to the device (needed for half-precision)
@@ -73,7 +64,7 @@ StatusCode Xher2<T>::DoHer2(const Layout layout, const Triangle triangle,
// Retrieves the kernel from the compiled binary
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, "Xher2");
// Sets the kernel arguments
@@ -96,7 +87,7 @@ StatusCode Xher2<T>::DoHer2(const Layout layout, const Triangle triangle,
auto global_two = Ceil(CeilDiv(n, db_["WPT"]), db_["WGS2"]);
auto global = std::vector<size_t>{global_one, global_two};
auto local = std::vector<size_t>{db_["WGS1"], db_["WGS2"]};
- status = RunKernel(kernel, global, local, event_);
+ status = RunKernel(kernel, queue_, device_, global, local, event_);
if (ErrorIn(status)) { return status; }
// Succesfully finished the computation
diff --git a/include/internal/routines/level2/xher2.h b/src/routines/level2/xher2.hpp
index a33a71c3..8c53c047 100644
--- a/include/internal/routines/level2/xher2.h
+++ b/src/routines/level2/xher2.hpp
@@ -14,30 +14,16 @@
#ifndef CLBLAST_ROUTINES_XHER2_H_
#define CLBLAST_ROUTINES_XHER2_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xher2: public Routine<T> {
+class Xher2: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestVectorX;
- using Routine<T>::TestVectorY;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixAP;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xher2(Queue &queue, EventPointer event, const std::string &name = "HER2");
@@ -49,10 +35,6 @@ class Xher2: public Routine<T> {
const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc,
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const bool packed = false);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level2/xhpmv.cc b/src/routines/level2/xhpmv.cpp
index 92686dbe..e6f82b34 100644
--- a/src/routines/level2/xhpmv.cc
+++ b/src/routines/level2/xhpmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xhpmv.h"
+#include "routines/level2/xhpmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xhpmv.h b/src/routines/level2/xhpmv.hpp
index a1d5595a..b11192f9 100644
--- a/include/internal/routines/level2/xhpmv.h
+++ b/src/routines/level2/xhpmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XHPMV_H_
#define CLBLAST_ROUTINES_XHPMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xhpr.cc b/src/routines/level2/xhpr.cpp
index 4b31ad09..225ebfe5 100644
--- a/src/routines/level2/xhpr.cc
+++ b/src/routines/level2/xhpr.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xhpr.h"
+#include "routines/level2/xhpr.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xhpr.h b/src/routines/level2/xhpr.hpp
index 6554d74c..37801c68 100644
--- a/include/internal/routines/level2/xhpr.h
+++ b/src/routines/level2/xhpr.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XHPR_H_
#define CLBLAST_ROUTINES_XHPR_H_
-#include "internal/routines/level2/xher.h"
+#include "routines/level2/xher.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xhpr2.cc b/src/routines/level2/xhpr2.cpp
index 9be24f43..85f9d3f9 100644
--- a/src/routines/level2/xhpr2.cc
+++ b/src/routines/level2/xhpr2.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xhpr2.h"
+#include "routines/level2/xhpr2.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xhpr2.h b/src/routines/level2/xhpr2.hpp
index d95e7b61..d66dce55 100644
--- a/include/internal/routines/level2/xhpr2.h
+++ b/src/routines/level2/xhpr2.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XHPR2_H_
#define CLBLAST_ROUTINES_XHPR2_H_
-#include "internal/routines/level2/xher2.h"
+#include "routines/level2/xher2.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xsbmv.cc b/src/routines/level2/xsbmv.cpp
index 66ba74e8..28730899 100644
--- a/src/routines/level2/xsbmv.cc
+++ b/src/routines/level2/xsbmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xsbmv.h"
+#include "routines/level2/xsbmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xsbmv.h b/src/routines/level2/xsbmv.hpp
index 4328e377..16c5e9a8 100644
--- a/include/internal/routines/level2/xsbmv.h
+++ b/src/routines/level2/xsbmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XSBMV_H_
#define CLBLAST_ROUTINES_XSBMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xspmv.cc b/src/routines/level2/xspmv.cpp
index 589a97d4..f6651012 100644
--- a/src/routines/level2/xspmv.cc
+++ b/src/routines/level2/xspmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xspmv.h"
+#include "routines/level2/xspmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xspmv.h b/src/routines/level2/xspmv.hpp
index ca3e28b6..a0c69b85 100644
--- a/include/internal/routines/level2/xspmv.h
+++ b/src/routines/level2/xspmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XSPMV_H_
#define CLBLAST_ROUTINES_XSPMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xspr.cc b/src/routines/level2/xspr.cpp
index c556b920..a75fe9c3 100644
--- a/src/routines/level2/xspr.cc
+++ b/src/routines/level2/xspr.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xspr.h"
+#include "routines/level2/xspr.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xspr.h b/src/routines/level2/xspr.hpp
index 7e91abc5..6468c736 100644
--- a/include/internal/routines/level2/xspr.h
+++ b/src/routines/level2/xspr.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XSPR_H_
#define CLBLAST_ROUTINES_XSPR_H_
-#include "internal/routines/level2/xher.h"
+#include "routines/level2/xher.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xspr2.cc b/src/routines/level2/xspr2.cpp
index c4ad5dc4..c39a2eb4 100644
--- a/src/routines/level2/xspr2.cc
+++ b/src/routines/level2/xspr2.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xspr2.h"
+#include "routines/level2/xspr2.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xspr2.h b/src/routines/level2/xspr2.hpp
index a34be8e8..693c56a1 100644
--- a/include/internal/routines/level2/xspr2.h
+++ b/src/routines/level2/xspr2.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XSPR2_H_
#define CLBLAST_ROUTINES_XSPR2_H_
-#include "internal/routines/level2/xher2.h"
+#include "routines/level2/xher2.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xsymv.cc b/src/routines/level2/xsymv.cpp
index 2a404a8a..648d2a3e 100644
--- a/src/routines/level2/xsymv.cc
+++ b/src/routines/level2/xsymv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xsymv.h"
+#include "routines/level2/xsymv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xsymv.h b/src/routines/level2/xsymv.hpp
index 98a0ce88..67815f2f 100644
--- a/include/internal/routines/level2/xsymv.h
+++ b/src/routines/level2/xsymv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XSYMV_H_
#define CLBLAST_ROUTINES_XSYMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xsyr.cc b/src/routines/level2/xsyr.cpp
index 892517d7..758d8f8f 100644
--- a/src/routines/level2/xsyr.cc
+++ b/src/routines/level2/xsyr.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xsyr.h"
+#include "routines/level2/xsyr.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xsyr.h b/src/routines/level2/xsyr.hpp
index f88498ae..20393454 100644
--- a/include/internal/routines/level2/xsyr.h
+++ b/src/routines/level2/xsyr.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XSYR_H_
#define CLBLAST_ROUTINES_XSYR_H_
-#include "internal/routines/level2/xher.h"
+#include "routines/level2/xher.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xsyr2.cc b/src/routines/level2/xsyr2.cpp
index e6dfd158..6f43b219 100644
--- a/src/routines/level2/xsyr2.cc
+++ b/src/routines/level2/xsyr2.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xsyr2.h"
+#include "routines/level2/xsyr2.hpp"
#include <string>
diff --git a/include/internal/routines/level2/xsyr2.h b/src/routines/level2/xsyr2.hpp
index d2d3143a..1a8dcbe8 100644
--- a/include/internal/routines/level2/xsyr2.h
+++ b/src/routines/level2/xsyr2.hpp
@@ -14,7 +14,7 @@
#ifndef CLBLAST_ROUTINES_XSYR2_H_
#define CLBLAST_ROUTINES_XSYR2_H_
-#include "internal/routines/level2/xher2.h"
+#include "routines/level2/xher2.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/routines/level2/xtbmv.cc b/src/routines/level2/xtbmv.cpp
index 86e28dfb..e315c544 100644
--- a/src/routines/level2/xtbmv.cc
+++ b/src/routines/level2/xtbmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xtbmv.h"
+#include "routines/level2/xtbmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xtbmv.h b/src/routines/level2/xtbmv.hpp
index 3b358080..389e9705 100644
--- a/include/internal/routines/level2/xtbmv.h
+++ b/src/routines/level2/xtbmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XTBMV_H_
#define CLBLAST_ROUTINES_XTBMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
@@ -25,12 +25,10 @@ namespace clblast {
template <typename T>
class Xtbmv: public Xgemv<T> {
public:
-
- // Members from the base class
- using Routine<T>::queue_;
- using Routine<T>::context_;
// Uses the generic matrix-vector routine
+ using Xgemv<T>::queue_;
+ using Xgemv<T>::context_;
using Xgemv<T>::MatVec;
// Constructor
diff --git a/src/routines/level2/xtpmv.cc b/src/routines/level2/xtpmv.cpp
index 72445547..46811089 100644
--- a/src/routines/level2/xtpmv.cc
+++ b/src/routines/level2/xtpmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xtpmv.h"
+#include "routines/level2/xtpmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xtpmv.h b/src/routines/level2/xtpmv.hpp
index f306cf4a..0e8cf1d2 100644
--- a/include/internal/routines/level2/xtpmv.h
+++ b/src/routines/level2/xtpmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XTPMV_H_
#define CLBLAST_ROUTINES_XTPMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
@@ -25,12 +25,10 @@ namespace clblast {
template <typename T>
class Xtpmv: public Xgemv<T> {
public:
-
- // Members from the base class
- using Routine<T>::queue_;
- using Routine<T>::context_;
// Uses the generic matrix-vector routine
+ using Xgemv<T>::queue_;
+ using Xgemv<T>::context_;
using Xgemv<T>::MatVec;
// Constructor
diff --git a/src/routines/level2/xtrmv.cc b/src/routines/level2/xtrmv.cpp
index df6f85a3..d2f24252 100644
--- a/src/routines/level2/xtrmv.cc
+++ b/src/routines/level2/xtrmv.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level2/xtrmv.h"
+#include "routines/level2/xtrmv.hpp"
#include <string>
#include <vector>
diff --git a/include/internal/routines/level2/xtrmv.h b/src/routines/level2/xtrmv.hpp
index cf0824a4..07dd7841 100644
--- a/include/internal/routines/level2/xtrmv.h
+++ b/src/routines/level2/xtrmv.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XTRMV_H_
#define CLBLAST_ROUTINES_XTRMV_H_
-#include "internal/routines/level2/xgemv.h"
+#include "routines/level2/xgemv.hpp"
namespace clblast {
// =================================================================================================
@@ -25,12 +25,10 @@ namespace clblast {
template <typename T>
class Xtrmv: public Xgemv<T> {
public:
-
- // Members from the base class
- using Routine<T>::queue_;
- using Routine<T>::context_;
// Uses the generic matrix-vector routine
+ using Xgemv<T>::queue_;
+ using Xgemv<T>::context_;
using Xgemv<T>::MatVec;
// Constructor
diff --git a/src/routines/level3/xgemm.cc b/src/routines/level3/xgemm.cpp
index 42d5f19e..9ea5559c 100644
--- a/src/routines/level3/xgemm.cc
+++ b/src/routines/level3/xgemm.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xgemm.h"
+#include "routines/level3/xgemm.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xgemm<half>::precision_ = Precision::kHalf;
-template <> const Precision Xgemm<float>::precision_ = Precision::kSingle;
-template <> const Precision Xgemm<double>::precision_ = Precision::kDouble;
-template <> const Precision Xgemm<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xgemm<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xgemm<T>::Xgemm(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -96,11 +87,11 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
// matrix A cannot be less than K when rotated, or less than M when not-rotated
// matrix B cannot be less than N when rotated, or less than K when not-rotated
// matrix C cannot be less than N when rotated, or less than M when not-rotated
- auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixB(b_one, b_two, b_buffer, b_offset, b_ld, sizeof(T));
+ status = TestMatrixB(b_one, b_two, b_buffer, b_offset, b_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixC(c_one, c_two, c_buffer, c_offset, c_ld, sizeof(T));
+ status = TestMatrixC(c_one, c_two, c_buffer, c_offset, c_ld);
if (ErrorIn(status)) { return status; }
// Calculates the ceiled versions of m, n, and k
@@ -112,7 +103,7 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
try {
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
// Determines whether or not temporary matrices are needed
auto a_no_temp = a_one == m_ceiled && a_two == k_ceiled && a_ld == m_ceiled && a_offset == 0 &&
@@ -142,7 +133,7 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
// case nothing has to be done, these kernels can be skipped.
if (!a_no_temp) {
auto eventProcessA = Event();
- status = PadCopyTransposeMatrix(eventProcessA.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA.pointer(), emptyEventList,
a_one, a_two, a_ld, a_offset, a_buffer,
m_ceiled, k_ceiled, m_ceiled, 0, a_temp,
ConstantOne<T>(), program,
@@ -154,7 +145,7 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
// As above, but now for matrix B
if (!b_no_temp) {
auto eventProcessB = Event();
- status = PadCopyTransposeMatrix(eventProcessB.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessB.pointer(), emptyEventList,
b_one, b_two, b_ld, b_offset, b_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, b_temp,
ConstantOne<T>(), program,
@@ -166,7 +157,7 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
// As above, but now for matrix C. This is only necessary if C is used both as input and output.
if (!c_no_temp && beta != static_cast<T>(0)) {
auto eventProcessC = Event();
- status = PadCopyTransposeMatrix(eventProcessC.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessC.pointer(), emptyEventList,
c_one, c_two, c_ld, c_offset, c_buffer,
m_ceiled, n_ceiled, m_ceiled, 0, c_temp,
ConstantOne<T>(), program,
@@ -199,13 +190,13 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout,
// Launches the kernel
auto eventKernel = Event();
auto eventPointer = (!c_no_temp) ? eventKernel.pointer() : event_;
- status = RunKernel(kernel, global, local, eventPointer, eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventPointer, eventWaitList);
if (ErrorIn(status)) { return status; }
// Runs the post-processing kernel if needed
if (!c_no_temp) {
eventWaitList.push_back(eventKernel);
- status = PadCopyTransposeMatrix(event_, eventWaitList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, eventWaitList,
m_ceiled, n_ceiled, m_ceiled, 0, c_temp,
c_one, c_two, c_ld, c_offset, c_buffer,
ConstantOne<T>(), program,
diff --git a/include/internal/routines/level3/xgemm.h b/src/routines/level3/xgemm.hpp
index 85fb0616..71723d78 100644
--- a/include/internal/routines/level3/xgemm.h
+++ b/src/routines/level3/xgemm.hpp
@@ -14,30 +14,16 @@
#ifndef CLBLAST_ROUTINES_XGEMM_H_
#define CLBLAST_ROUTINES_XGEMM_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xgemm: public Routine<T> {
+class Xgemm: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixB;
- using Routine<T>::TestMatrixC;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xgemm(Queue &queue, EventPointer event, const std::string &name = "GEMM");
@@ -50,7 +36,7 @@ class Xgemm: public Routine<T> {
const T beta,
const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
- private:
+ protected:
// Static variable to get the precision
const static Precision precision_;
};
diff --git a/src/routines/level3/xhemm.cc b/src/routines/level3/xhemm.cpp
index d2fbf36e..9813503e 100644
--- a/src/routines/level3/xhemm.cc
+++ b/src/routines/level3/xhemm.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xhemm.h"
+#include "routines/level3/xhemm.hpp"
#include <string>
#include <vector>
@@ -45,7 +45,7 @@ StatusCode Xhemm<T>::DoHemm(const Layout layout, const Side side, const Triangle
auto k = (side == Side::kLeft) ? m : n;
// Checks for validity of the squared A matrix
- auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
// Determines which kernel to run based on the layout (the Xgemm kernel assumes column-major as
@@ -61,7 +61,7 @@ StatusCode Xhemm<T>::DoHemm(const Layout layout, const Side side, const Triangle
// Creates a general matrix from the hermitian matrix to be able to run the regular Xgemm
// routine afterwards
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the arguments for the hermitian-to-squared kernel
@@ -80,7 +80,7 @@ StatusCode Xhemm<T>::DoHemm(const Layout layout, const Side side, const Triangle
Ceil(CeilDiv(k, db_["PAD_WPTY"]), db_["PAD_DIMY"])};
auto local = std::vector<size_t>{db_["PAD_DIMX"], db_["PAD_DIMY"]};
auto kernelEvent = Event();
- status = RunKernel(kernel, global, local, kernelEvent.pointer());
+ status = RunKernel(kernel, queue_, device_, global, local, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
// Synchronize now: 'DoGemm' does not accept a list of events to wait for
diff --git a/include/internal/routines/level3/xhemm.h b/src/routines/level3/xhemm.hpp
index ec42b569..d79b42a1 100644
--- a/include/internal/routines/level3/xhemm.h
+++ b/src/routines/level3/xhemm.hpp
@@ -15,7 +15,7 @@
#ifndef CLBLAST_ROUTINES_XHEMM_H_
#define CLBLAST_ROUTINES_XHEMM_H_
-#include "internal/routines/level3/xgemm.h"
+#include "routines/level3/xgemm.hpp"
namespace clblast {
// =================================================================================================
@@ -25,15 +25,13 @@ template <typename T>
class Xhemm: public Xgemm<T> {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestMatrixA;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
- // Uses the regular Xgemm routine
+ // Uses methods and variables the regular Xgemm routine
+ using Xgemm<T>::precision_;
+ using Xgemm<T>::routine_name_;
+ using Xgemm<T>::queue_;
+ using Xgemm<T>::context_;
+ using Xgemm<T>::device_;
+ using Xgemm<T>::db_;
using Xgemm<T>::DoGemm;
// Constructor
diff --git a/src/routines/level3/xher2k.cc b/src/routines/level3/xher2k.cpp
index 5ec1f8cd..bd7a053e 100644
--- a/src/routines/level3/xher2k.cc
+++ b/src/routines/level3/xher2k.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xher2k.h"
+#include "routines/level3/xher2k.hpp"
#include <string>
#include <vector>
@@ -19,16 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xher2k<float2,float>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xher2k<double2,double>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T, typename U>
Xher2k<T,U>::Xher2k(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -76,11 +70,11 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
// matrix A cannot be less than N when rotated, or less than K when not-rotated
// matrix B cannot be less than N when rotated, or less than K when not-rotated
// matrix C cannot be less than N
- auto status = TestMatrixA(ab_one, ab_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(ab_one, ab_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixB(ab_one, ab_two, b_buffer, b_offset, b_ld, sizeof(T));
+ status = TestMatrixB(ab_one, ab_two, b_buffer, b_offset, b_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixC(n, n, c_buffer, c_offset, c_ld, sizeof(T));
+ status = TestMatrixC(n, n, c_buffer, c_offset, c_ld);
if (ErrorIn(status)) { return status; }
// Calculates the ceiled versions of n and k
@@ -94,7 +88,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
try {
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
// Determines whether or not temporary matrices are needed
auto a1_no_temp = ab_one == n_ceiled && ab_two == k_ceiled && a_ld == n_ceiled && a_offset == 0 &&
@@ -129,7 +123,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
// case nothing has to be done, these kernels can be skipped.
if (!a1_no_temp) {
auto eventProcessA1 = Event();
- status = PadCopyTransposeMatrix(eventProcessA1.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA1.pointer(), emptyEventList,
ab_one, ab_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, a1_temp,
ConstantOne<T>(), program,
@@ -139,7 +133,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
}
if (!a2_no_temp) {
auto eventProcessA2 = Event();
- status = PadCopyTransposeMatrix(eventProcessA2.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA2.pointer(), emptyEventList,
ab_one, ab_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, a2_temp,
ConstantOne<T>(), program,
@@ -149,7 +143,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
}
if (!b1_no_temp) {
auto eventProcessB1 = Event();
- status = PadCopyTransposeMatrix(eventProcessB1.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessB1.pointer(), emptyEventList,
ab_one, ab_two, b_ld, b_offset, b_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, b1_temp,
ConstantOne<T>(), program,
@@ -159,7 +153,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
}
if (!b2_no_temp) {
auto eventProcessB2 = Event();
- status = PadCopyTransposeMatrix(eventProcessB2.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessB2.pointer(), emptyEventList,
ab_one, ab_two, b_ld, b_offset, b_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, b2_temp,
ConstantOne<T>(), program,
@@ -171,7 +165,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
// Furthermore, also creates a (possibly padded) copy of matrix C, since it is not allowed to
// modify the other triangle.
auto eventProcessC = Event();
- status = PadCopyTransposeMatrix(eventProcessC.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessC.pointer(), emptyEventList,
n, n, c_ld, c_offset, c_buffer,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
ConstantOne<T>(), program,
@@ -201,7 +195,7 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
// Launches the kernel
auto eventKernel1 = Event();
- status = RunKernel(kernel, global, local, eventKernel1.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel1.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel1);
@@ -217,14 +211,14 @@ StatusCode Xher2k<T,U>::DoHer2k(const Layout layout, const Triangle triangle, co
// Runs the kernel again
auto eventKernel2 = Event();
- status = RunKernel(kernel, global, local, eventKernel2.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel2.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel2);
// Runs the post-processing kernel
auto upper = (triangle == Triangle::kUpper);
auto lower = (triangle == Triangle::kLower);
- status = PadCopyTransposeMatrix(event_, eventWaitList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, eventWaitList,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
n, n, c_ld, c_offset, c_buffer,
ConstantOne<T>(), program,
diff --git a/include/internal/routines/level3/xher2k.h b/src/routines/level3/xher2k.hpp
index 623afd49..23996219 100644
--- a/include/internal/routines/level3/xher2k.h
+++ b/src/routines/level3/xher2k.hpp
@@ -16,30 +16,16 @@
#ifndef CLBLAST_ROUTINES_XHER2K_H_
#define CLBLAST_ROUTINES_XHER2K_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T, typename U>
-class Xher2k: public Routine<T> {
+class Xher2k: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixB;
- using Routine<T>::TestMatrixC;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xher2k(Queue &queue, EventPointer event, const std::string &name = "HER2K");
@@ -51,10 +37,6 @@ class Xher2k: public Routine<T> {
const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const U beta,
const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level3/xherk.cc b/src/routines/level3/xherk.cpp
index df97a94f..6ef7f21f 100644
--- a/src/routines/level3/xherk.cc
+++ b/src/routines/level3/xherk.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xherk.h"
+#include "routines/level3/xherk.hpp"
#include <string>
#include <vector>
@@ -19,16 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xherk<float2,float>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xherk<double2,double>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T, typename U>
Xherk<T,U>::Xherk(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -75,9 +69,9 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
// space. Also tests that the leading dimensions of:
// matrix A cannot be less than N when rotated, or less than K when not-rotated
// matrix C cannot be less than N
- auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixC(n, n, c_buffer, c_offset, c_ld, sizeof(T));
+ status = TestMatrixC(n, n, c_buffer, c_offset, c_ld);
if (ErrorIn(status)) { return status; }
// Calculates the ceiled versions of n and k
@@ -91,7 +85,7 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
try {
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
// Determines whether or not temporary matrices are needed
auto a_no_temp = a_one == n_ceiled && a_two == k_ceiled && a_ld == n_ceiled && a_offset == 0 &&
@@ -121,7 +115,7 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
// case nothing has to be done, these kernels can be skipped. Two copies are created.
if (!a_no_temp) {
auto eventProcessA = Event();
- status = PadCopyTransposeMatrix(eventProcessA.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA.pointer(), emptyEventList,
a_one, a_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, a_temp,
ConstantOne<T>(), program,
@@ -131,7 +125,7 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
}
if (!b_no_temp) {
auto eventProcessB = Event();
- status = PadCopyTransposeMatrix(eventProcessB.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessB.pointer(), emptyEventList,
a_one, a_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, b_temp,
ConstantOne<T>(), program,
@@ -143,7 +137,7 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
// Furthermore, also creates a (possibly padded) copy of matrix C, since it is not allowed to
// modify the other triangle.
auto eventProcessC = Event();
- status = PadCopyTransposeMatrix(eventProcessC.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessC.pointer(), emptyEventList,
n, n, c_ld, c_offset, c_buffer,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
ConstantOne<T>(), program,
@@ -173,14 +167,14 @@ StatusCode Xherk<T,U>::DoHerk(const Layout layout, const Triangle triangle, cons
// Launches the kernel
auto eventKernel = Event();
- status = RunKernel(kernel, global, local, eventKernel.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel);
// Runs the post-processing kernel
auto upper = (triangle == Triangle::kUpper);
auto lower = (triangle == Triangle::kLower);
- status = PadCopyTransposeMatrix(event_, eventWaitList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, eventWaitList,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
n, n, c_ld, c_offset, c_buffer,
ConstantOne<T>(), program,
diff --git a/include/internal/routines/level3/xherk.h b/src/routines/level3/xherk.hpp
index 629695ff..3f156a1b 100644
--- a/include/internal/routines/level3/xherk.h
+++ b/src/routines/level3/xherk.hpp
@@ -16,29 +16,16 @@
#ifndef CLBLAST_ROUTINES_XHERK_H_
#define CLBLAST_ROUTINES_XHERK_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T, typename U>
-class Xherk: public Routine<T> {
+class Xherk: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixC;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xherk(Queue &queue, EventPointer event, const std::string &name = "HERK");
@@ -49,10 +36,6 @@ class Xherk: public Routine<T> {
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const U beta,
const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level3/xsymm.cc b/src/routines/level3/xsymm.cpp
index d88d4653..04e4b718 100644
--- a/src/routines/level3/xsymm.cc
+++ b/src/routines/level3/xsymm.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xsymm.h"
+#include "routines/level3/xsymm.hpp"
#include <string>
#include <vector>
@@ -45,7 +45,7 @@ StatusCode Xsymm<T>::DoSymm(const Layout layout, const Side side, const Triangle
auto k = (side == Side::kLeft) ? m : n;
// Checks for validity of the squared A matrix
- auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
// Determines which kernel to run based on the layout (the Xgemm kernel assumes column-major as
@@ -61,7 +61,7 @@ StatusCode Xsymm<T>::DoSymm(const Layout layout, const Side side, const Triangle
// Creates a general matrix from the symmetric matrix to be able to run the regular Xgemm
// routine afterwards
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the arguments for the symmetric-to-squared kernel
@@ -80,7 +80,7 @@ StatusCode Xsymm<T>::DoSymm(const Layout layout, const Side side, const Triangle
Ceil(CeilDiv(k, db_["PAD_WPTY"]), db_["PAD_DIMY"])};
auto local = std::vector<size_t>{db_["PAD_DIMX"], db_["PAD_DIMY"]};
auto kernelEvent = Event();
- status = RunKernel(kernel, global, local, kernelEvent.pointer());
+ status = RunKernel(kernel, queue_, device_, global, local, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
// Synchronize now: 'DoGemm' does not accept a list of events to wait for
diff --git a/include/internal/routines/level3/xsymm.h b/src/routines/level3/xsymm.hpp
index 16ad6f53..754dd7a0 100644
--- a/include/internal/routines/level3/xsymm.h
+++ b/src/routines/level3/xsymm.hpp
@@ -17,7 +17,7 @@
#ifndef CLBLAST_ROUTINES_XSYMM_H_
#define CLBLAST_ROUTINES_XSYMM_H_
-#include "internal/routines/level3/xgemm.h"
+#include "routines/level3/xgemm.hpp"
namespace clblast {
// =================================================================================================
@@ -27,15 +27,13 @@ template <typename T>
class Xsymm: public Xgemm<T> {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestMatrixA;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
- // Uses the regular Xgemm routine
+ // Uses methods and variables the regular Xgemm routine
+ using Xgemm<T>::precision_;
+ using Xgemm<T>::routine_name_;
+ using Xgemm<T>::queue_;
+ using Xgemm<T>::context_;
+ using Xgemm<T>::device_;
+ using Xgemm<T>::db_;
using Xgemm<T>::DoGemm;
// Constructor
diff --git a/src/routines/level3/xsyr2k.cc b/src/routines/level3/xsyr2k.cpp
index dd7d19fe..424d4d2d 100644
--- a/src/routines/level3/xsyr2k.cc
+++ b/src/routines/level3/xsyr2k.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xsyr2k.h"
+#include "routines/level3/xsyr2k.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xsyr2k<half>::precision_ = Precision::kHalf;
-template <> const Precision Xsyr2k<float>::precision_ = Precision::kSingle;
-template <> const Precision Xsyr2k<double>::precision_ = Precision::kDouble;
-template <> const Precision Xsyr2k<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xsyr2k<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xsyr2k<T>::Xsyr2k(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -75,11 +66,11 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
// matrix A cannot be less than N when rotated, or less than K when not-rotated
// matrix B cannot be less than N when rotated, or less than K when not-rotated
// matrix C cannot be less than N
- auto status = TestMatrixA(ab_one, ab_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(ab_one, ab_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixB(ab_one, ab_two, b_buffer, b_offset, b_ld, sizeof(T));
+ status = TestMatrixB(ab_one, ab_two, b_buffer, b_offset, b_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixC(n, n, c_buffer, c_offset, c_ld, sizeof(T));
+ status = TestMatrixC(n, n, c_buffer, c_offset, c_ld);
if (ErrorIn(status)) { return status; }
// Calculates the ceiled versions of n and k
@@ -93,7 +84,7 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
try {
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
// Determines whether or not temporary matrices are needed
auto a_no_temp = ab_one == n_ceiled && ab_two == k_ceiled && a_ld == n_ceiled && a_offset == 0 &&
@@ -121,7 +112,7 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
// case nothing has to be done, these kernels can be skipped.
if (!a_no_temp) {
auto eventProcessA = Event();
- status = PadCopyTransposeMatrix(eventProcessA.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA.pointer(), emptyEventList,
ab_one, ab_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, a_temp,
ConstantOne<T>(), program,
@@ -131,7 +122,7 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
}
if (!b_no_temp) {
auto eventProcessB = Event();
- status = PadCopyTransposeMatrix(eventProcessB.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessB.pointer(), emptyEventList,
ab_one, ab_two, b_ld, b_offset, b_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, b_temp,
ConstantOne<T>(), program,
@@ -143,7 +134,7 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
// Furthermore, also creates a (possibly padded) copy of matrix C, since it is not allowed to
// modify the other triangle.
auto eventProcessC = Event();
- status = PadCopyTransposeMatrix(eventProcessC.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessC.pointer(), emptyEventList,
n, n, c_ld, c_offset, c_buffer,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
ConstantOne<T>(), program,
@@ -173,7 +164,7 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
// Launches the kernel
auto eventKernel1 = Event();
- status = RunKernel(kernel, global, local, eventKernel1.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel1.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel1);
@@ -186,14 +177,14 @@ StatusCode Xsyr2k<T>::DoSyr2k(const Layout layout, const Triangle triangle, cons
// Runs the kernel again
auto eventKernel2 = Event();
- status = RunKernel(kernel, global, local, eventKernel2.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel2.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel2);
// Runs the post-processing kernel
auto upper = (triangle == Triangle::kUpper);
auto lower = (triangle == Triangle::kLower);
- status = PadCopyTransposeMatrix(event_, eventWaitList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, eventWaitList,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
n, n, c_ld, c_offset, c_buffer,
ConstantOne<T>(), program,
diff --git a/include/internal/routines/level3/xsyr2k.h b/src/routines/level3/xsyr2k.hpp
index 88669626..56185653 100644
--- a/include/internal/routines/level3/xsyr2k.h
+++ b/src/routines/level3/xsyr2k.hpp
@@ -16,30 +16,16 @@
#ifndef CLBLAST_ROUTINES_XSYR2K_H_
#define CLBLAST_ROUTINES_XSYR2K_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xsyr2k: public Routine<T> {
+class Xsyr2k: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixB;
- using Routine<T>::TestMatrixC;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xsyr2k(Queue &queue, EventPointer event, const std::string &name = "SYR2K");
@@ -51,10 +37,6 @@ class Xsyr2k: public Routine<T> {
const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld,
const T beta,
const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level3/xsyrk.cc b/src/routines/level3/xsyrk.cpp
index b5817b82..f56c232b 100644
--- a/src/routines/level3/xsyrk.cc
+++ b/src/routines/level3/xsyrk.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xsyrk.h"
+#include "routines/level3/xsyrk.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xsyrk<half>::precision_ = Precision::kHalf;
-template <> const Precision Xsyrk<float>::precision_ = Precision::kSingle;
-template <> const Precision Xsyrk<double>::precision_ = Precision::kDouble;
-template <> const Precision Xsyrk<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xsyrk<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xsyrk<T>::Xsyrk(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose","Xgemm"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -73,9 +64,9 @@ StatusCode Xsyrk<T>::DoSyrk(const Layout layout, const Triangle triangle, const
// space. Also tests that the leading dimensions of:
// matrix A cannot be less than N when rotated, or less than K when not-rotated
// matrix C cannot be less than N
- auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixC(n, n, c_buffer, c_offset, c_ld, sizeof(T));
+ status = TestMatrixC(n, n, c_buffer, c_offset, c_ld);
if (ErrorIn(status)) { return status; }
// Calculates the ceiled versions of n and k
@@ -89,7 +80,7 @@ StatusCode Xsyrk<T>::DoSyrk(const Layout layout, const Triangle triangle, const
try {
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
// Determines whether or not temporary matrices are needed
auto a_no_temp = a_one == n_ceiled && a_two == k_ceiled && a_ld == n_ceiled && a_offset == 0 &&
@@ -114,7 +105,7 @@ StatusCode Xsyrk<T>::DoSyrk(const Layout layout, const Triangle triangle, const
// case nothing has to be done, these kernels can be skipped.
if (!a_no_temp) {
auto eventProcessA = Event();
- status = PadCopyTransposeMatrix(eventProcessA.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessA.pointer(), emptyEventList,
a_one, a_two, a_ld, a_offset, a_buffer,
n_ceiled, k_ceiled, n_ceiled, 0, a_temp,
ConstantOne<T>(), program,
@@ -126,7 +117,7 @@ StatusCode Xsyrk<T>::DoSyrk(const Layout layout, const Triangle triangle, const
// Furthermore, also creates a (possibly padded) copy of matrix C, since it is not allowed to
// modify the other triangle.
auto eventProcessC = Event();
- status = PadCopyTransposeMatrix(eventProcessC.pointer(), emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, eventProcessC.pointer(), emptyEventList,
n, n, c_ld, c_offset, c_buffer,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
ConstantOne<T>(), program,
@@ -156,14 +147,14 @@ StatusCode Xsyrk<T>::DoSyrk(const Layout layout, const Triangle triangle, const
// Launches the kernel
auto eventKernel = Event();
- status = RunKernel(kernel, global, local, eventKernel.pointer(), eventWaitList);
+ status = RunKernel(kernel, queue_, device_, global, local, eventKernel.pointer(), eventWaitList);
if (ErrorIn(status)) { return status; }
eventWaitList.push_back(eventKernel);
// Runs the post-processing kernel
auto upper = (triangle == Triangle::kUpper);
auto lower = (triangle == Triangle::kLower);
- status = PadCopyTransposeMatrix(event_, eventWaitList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, eventWaitList,
n_ceiled, n_ceiled, n_ceiled, 0, c_temp,
n, n, c_ld, c_offset, c_buffer,
ConstantOne<T>(), program,
diff --git a/include/internal/routines/level3/xsyrk.h b/src/routines/level3/xsyrk.hpp
index e95c7c1c..7c075c26 100644
--- a/include/internal/routines/level3/xsyrk.h
+++ b/src/routines/level3/xsyrk.hpp
@@ -18,29 +18,16 @@
#ifndef CLBLAST_ROUTINES_XSYRK_H_
#define CLBLAST_ROUTINES_XSYRK_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xsyrk: public Routine<T> {
+class Xsyrk: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::source_string_;
- using Routine<T>::queue_;
- using Routine<T>::event_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixC;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
// Constructor
Xsyrk(Queue &queue, EventPointer event, const std::string &name = "SYRK");
@@ -51,10 +38,6 @@ class Xsyrk: public Routine<T> {
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const T beta,
const Buffer<T> &c_buffer, const size_t c_offset, const size_t c_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/routines/level3/xtrmm.cc b/src/routines/level3/xtrmm.cpp
index 27ecb4ed..74a82822 100644
--- a/src/routines/level3/xtrmm.cc
+++ b/src/routines/level3/xtrmm.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/level3/xtrmm.h"
+#include "routines/level3/xtrmm.hpp"
#include <string>
#include <vector>
@@ -44,7 +44,7 @@ StatusCode Xtrmm<T>::DoTrmm(const Layout layout, const Side side, const Triangle
auto k = (side == Side::kLeft) ? m : n;
// Checks for validity of the triangular A matrix
- auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(k, k, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
// Determines which kernel to run based on the layout (the Xgemm kernel assumes column-major as
@@ -63,7 +63,7 @@ StatusCode Xtrmm<T>::DoTrmm(const Layout layout, const Side side, const Triangle
// Creates a general matrix from the triangular matrix to be able to run the regular Xgemm
// routine afterwards
try {
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto kernel = Kernel(program, kernel_name);
// Sets the arguments for the triangular-to-squared kernel
@@ -83,7 +83,7 @@ StatusCode Xtrmm<T>::DoTrmm(const Layout layout, const Side side, const Triangle
Ceil(CeilDiv(k, db_["PAD_WPTY"]), db_["PAD_DIMY"])};
auto local = std::vector<size_t>{db_["PAD_DIMX"], db_["PAD_DIMY"]};
auto kernelEvent = Event();
- status = RunKernel(kernel, global, local, kernelEvent.pointer());
+ status = RunKernel(kernel, queue_, device_, global, local, kernelEvent.pointer());
if (ErrorIn(status)) { return status; }
// Synchronize now: 'DoGemm' does not accept a list of events to wait for
diff --git a/include/internal/routines/level3/xtrmm.h b/src/routines/level3/xtrmm.hpp
index 01f6594d..bb435592 100644
--- a/include/internal/routines/level3/xtrmm.h
+++ b/src/routines/level3/xtrmm.hpp
@@ -16,7 +16,7 @@
#ifndef CLBLAST_ROUTINES_XTRMM_H_
#define CLBLAST_ROUTINES_XTRMM_H_
-#include "internal/routines/level3/xgemm.h"
+#include "routines/level3/xgemm.hpp"
namespace clblast {
// =================================================================================================
@@ -26,15 +26,13 @@ template <typename T>
class Xtrmm: public Xgemm<T> {
public:
- // Members and methods from the base class
- using Routine<T>::db_;
- using Routine<T>::context_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::TestMatrixA;
- using Routine<T>::RunKernel;
- using Routine<T>::ErrorIn;
-
- // Uses the regular Xgemm routine
+ // Uses methods and variables the regular Xgemm routine
+ using Xgemm<T>::precision_;
+ using Xgemm<T>::routine_name_;
+ using Xgemm<T>::queue_;
+ using Xgemm<T>::context_;
+ using Xgemm<T>::device_;
+ using Xgemm<T>::db_;
using Xgemm<T>::DoGemm;
// Constructor
diff --git a/src/routines/levelx/xomatcopy.cc b/src/routines/levelx/xomatcopy.cpp
index 77fc445f..e8593301 100644
--- a/src/routines/levelx/xomatcopy.cc
+++ b/src/routines/levelx/xomatcopy.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/routines/levelx/xomatcopy.h"
+#include "routines/levelx/xomatcopy.hpp"
#include <string>
#include <vector>
@@ -19,19 +19,10 @@
namespace clblast {
// =================================================================================================
-// Specific implementations to get the memory-type based on a template argument
-template <> const Precision Xomatcopy<half>::precision_ = Precision::kHalf;
-template <> const Precision Xomatcopy<float>::precision_ = Precision::kSingle;
-template <> const Precision Xomatcopy<double>::precision_ = Precision::kDouble;
-template <> const Precision Xomatcopy<float2>::precision_ = Precision::kComplexSingle;
-template <> const Precision Xomatcopy<double2>::precision_ = Precision::kComplexDouble;
-
-// =================================================================================================
-
// Constructor: forwards to base class constructor
template <typename T>
Xomatcopy<T>::Xomatcopy(Queue &queue, EventPointer event, const std::string &name):
- Routine<T>(queue, event, name, {"Copy","Pad","Transpose","Padtranspose"}, precision_) {
+ Routine(queue, event, name, {"Copy","Pad","Transpose","Padtranspose"}, PrecisionValue<T>()) {
source_string_ =
#include "../../kernels/level3/level3.opencl"
#include "../../kernels/level3/copy_fast.opencl"
@@ -72,16 +63,16 @@ StatusCode Xomatcopy<T>::DoOmatcopy(const Layout layout, const Transpose a_trans
// Also tests that the leading dimensions of:
// matrix A cannot be less than N when rotated, or less than M when not-rotated
// matrix B cannot be less than M when rotated, or less than N when not-rotated
- auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld, sizeof(T));
+ auto status = TestMatrixA(a_one, a_two, a_buffer, a_offset, a_ld);
if (ErrorIn(status)) { return status; }
- status = TestMatrixB(b_one, b_two, b_buffer, b_offset, b_ld, sizeof(T));
+ status = TestMatrixB(b_one, b_two, b_buffer, b_offset, b_ld);
if (ErrorIn(status)) { return status; }
// Loads the program from the database
- const auto program = GetProgramFromCache();
+ const auto program = GetProgramFromCache(context_, PrecisionValue<T>(), routine_name_);
auto emptyEventList = std::vector<Event>();
- status = PadCopyTransposeMatrix(event_, emptyEventList,
+ status = PadCopyTransposeMatrix(queue_, device_, context_, db_, event_, emptyEventList,
a_one, a_two, a_ld, a_offset, a_buffer,
b_one, b_two, b_ld, b_offset, b_buffer,
alpha, program, false, transpose, conjugate);
diff --git a/include/internal/routines/levelx/xomatcopy.h b/src/routines/levelx/xomatcopy.hpp
index 38df846e..0e580230 100644
--- a/include/internal/routines/levelx/xomatcopy.h
+++ b/src/routines/levelx/xomatcopy.hpp
@@ -14,25 +14,16 @@
#ifndef CLBLAST_ROUTINES_XOMATCOPY_H_
#define CLBLAST_ROUTINES_XOMATCOPY_H_
-#include "internal/routine.h"
+#include "routine.hpp"
namespace clblast {
// =================================================================================================
// See comment at top of file for a description of the class
template <typename T>
-class Xomatcopy: public Routine<T> {
+class Xomatcopy: public Routine {
public:
- // Members and methods from the base class
- using Routine<T>::source_string_;
- using Routine<T>::event_;
- using Routine<T>::GetProgramFromCache;
- using Routine<T>::PadCopyTransposeMatrix;
- using Routine<T>::TestMatrixA;
- using Routine<T>::TestMatrixB;
- using Routine<T>::ErrorIn;
-
// Constructor
Xomatcopy(Queue &queue, EventPointer event, const std::string &name = "OMATCOPY");
@@ -41,10 +32,6 @@ class Xomatcopy: public Routine<T> {
const size_t m, const size_t n, const T alpha,
const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld,
const Buffer<T> &b_buffer, const size_t b_offset, const size_t b_ld);
-
- private:
- // Static variable to get the precision
- const static Precision precision_;
};
// =================================================================================================
diff --git a/src/tuning/copy_fast.cc b/src/tuning/kernels/copy_fast.cpp
index 09fdbaba..34269bc7 100644
--- a/src/tuning/copy_fast.cc
+++ b/src/tuning/kernels/copy_fast.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/copy_pad.cc b/src/tuning/kernels/copy_pad.cpp
index 7088b3bf..1e0dccd3 100644
--- a/src/tuning/copy_pad.cc
+++ b/src/tuning/kernels/copy_pad.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/transpose_fast.cc b/src/tuning/kernels/transpose_fast.cpp
index 3b0bdeb5..7ac19cb6 100644
--- a/src/tuning/transpose_fast.cc
+++ b/src/tuning/kernels/transpose_fast.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/transpose_pad.cc b/src/tuning/kernels/transpose_pad.cpp
index b9ab3ffa..63274415 100644
--- a/src/tuning/transpose_pad.cc
+++ b/src/tuning/kernels/transpose_pad.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/xaxpy.cc b/src/tuning/kernels/xaxpy.cpp
index d27cb73d..88d12c1f 100644
--- a/src/tuning/xaxpy.cc
+++ b/src/tuning/kernels/xaxpy.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/xdot.cc b/src/tuning/kernels/xdot.cpp
index 5f30296c..1581e13f 100644
--- a/src/tuning/xdot.cc
+++ b/src/tuning/kernels/xdot.cpp
@@ -15,8 +15,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/xgemm.cc b/src/tuning/kernels/xgemm.cpp
index d309b830..4b1efdef 100644
--- a/src/tuning/xgemm.cc
+++ b/src/tuning/kernels/xgemm.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/xgemv.cc b/src/tuning/kernels/xgemv.cpp
index 6587dcf4..d42155ae 100644
--- a/src/tuning/xgemv.cc
+++ b/src/tuning/kernels/xgemv.cpp
@@ -17,8 +17,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/tuning/xger.cc b/src/tuning/kernels/xger.cpp
index 4be80c86..d2590c53 100644
--- a/src/tuning/xger.cc
+++ b/src/tuning/kernels/xger.cpp
@@ -14,8 +14,8 @@
#include <string>
#include <vector>
-#include "internal/utilities.h"
-#include "internal/tuning.h"
+#include "utilities.hpp"
+#include "tuning/tuning.hpp"
namespace clblast {
// =================================================================================================
diff --git a/include/internal/tuning.h b/src/tuning/tuning.hpp
index a44f79d6..19df5f9a 100644
--- a/include/internal/tuning.h
+++ b/src/tuning/tuning.hpp
@@ -20,7 +20,7 @@
#include <cltune.h>
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
// =================================================================================================
diff --git a/src/utilities.cc b/src/utilities.cpp
index 851e6d9f..e3a1fb75 100644
--- a/src/utilities.cc
+++ b/src/utilities.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "internal/utilities.h"
+#include "utilities.hpp"
#include <string>
#include <vector>
@@ -360,6 +360,13 @@ size_t GetBytes(const Precision precision) {
}
}
+// Convert the template argument into a precision value
+template <> Precision PrecisionValue<half>() { return Precision::kHalf; }
+template <> Precision PrecisionValue<float>() { return Precision::kSingle; }
+template <> Precision PrecisionValue<double>() { return Precision::kDouble; }
+template <> Precision PrecisionValue<float2>() { return Precision::kComplexSingle; }
+template <> Precision PrecisionValue<double2>() { return Precision::kComplexDouble; }
+
// =================================================================================================
// Returns false is this precision is not supported by the device
diff --git a/include/internal/utilities.h b/src/utilities.hpp
index d3c8ebdb..9a2b9ffc 100644
--- a/include/internal/utilities.h
+++ b/src/utilities.hpp
@@ -23,7 +23,7 @@
#include "clblast.h"
#include "clblast_half.h"
-#include "internal/clpp11.h"
+#include "clpp11.hpp"
namespace clblast {
// =================================================================================================
@@ -200,6 +200,11 @@ bool CheckArgument(const int argc, char *argv[], std::string &help, const std::s
// =================================================================================================
+// Helper function to check for errors in the status code
+constexpr bool ErrorIn(const StatusCode s) { return (s != StatusCode::kSuccess); }
+
+// =================================================================================================
+
// Returns a random number to be used as a seed
unsigned int GetRandomSeed();
@@ -235,6 +240,10 @@ bool IsMultiple(const size_t a, const size_t b);
// Convert the precision enum into bytes, e.g. a double takes up 8 bytes
size_t GetBytes(const Precision precision);
+// Convert the template argument into a precision value
+template <typename T>
+Precision PrecisionValue();
+
// =================================================================================================
// Returns false is this precision is not supported by the device
diff --git a/test/correctness/routines/level1/xamax.cc b/test/correctness/routines/level1/xamax.cpp
index 21400a40..607637e8 100644
--- a/test/correctness/routines/level1/xamax.cc
+++ b/test/correctness/routines/level1/xamax.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xamax.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xamax.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xasum.cc b/test/correctness/routines/level1/xasum.cpp
index f48d1d4b..e22e42a6 100644
--- a/test/correctness/routines/level1/xasum.cc
+++ b/test/correctness/routines/level1/xasum.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xasum.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xasum.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xaxpy.cc b/test/correctness/routines/level1/xaxpy.cpp
index 85649a04..064172fa 100644
--- a/test/correctness/routines/level1/xaxpy.cc
+++ b/test/correctness/routines/level1/xaxpy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xaxpy.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xaxpy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xcopy.cc b/test/correctness/routines/level1/xcopy.cpp
index b89baabf..e6f2581b 100644
--- a/test/correctness/routines/level1/xcopy.cc
+++ b/test/correctness/routines/level1/xcopy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xcopy.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xcopy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xdot.cc b/test/correctness/routines/level1/xdot.cpp
index 3a353e2e..080250cb 100644
--- a/test/correctness/routines/level1/xdot.cc
+++ b/test/correctness/routines/level1/xdot.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xdot.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xdot.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xdotc.cc b/test/correctness/routines/level1/xdotc.cpp
index 195b0847..2a7bbeca 100644
--- a/test/correctness/routines/level1/xdotc.cc
+++ b/test/correctness/routines/level1/xdotc.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xdotc.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xdotc.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xdotu.cc b/test/correctness/routines/level1/xdotu.cpp
index 7a501052..1047d021 100644
--- a/test/correctness/routines/level1/xdotu.cc
+++ b/test/correctness/routines/level1/xdotu.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xdotu.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xdotu.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xnrm2.cc b/test/correctness/routines/level1/xnrm2.cpp
index 02ea57cb..142fa7ba 100644
--- a/test/correctness/routines/level1/xnrm2.cc
+++ b/test/correctness/routines/level1/xnrm2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xnrm2.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xnrm2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xrot.cc b/test/correctness/routines/level1/xrot.cpp
index 8ffcd6af..5af358eb 100644
--- a/test/correctness/routines/level1/xrot.cc
+++ b/test/correctness/routines/level1/xrot.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xrot.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xrot.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xrotg.cc b/test/correctness/routines/level1/xrotg.cpp
index c8480673..ad23a554 100644
--- a/test/correctness/routines/level1/xrotg.cc
+++ b/test/correctness/routines/level1/xrotg.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xrotg.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xrotg.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xrotm.cc b/test/correctness/routines/level1/xrotm.cpp
index 196e0de9..4f7e8f15 100644
--- a/test/correctness/routines/level1/xrotm.cc
+++ b/test/correctness/routines/level1/xrotm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xrotm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xrotm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xrotmg.cc b/test/correctness/routines/level1/xrotmg.cpp
index e4dd712b..ca89bc12 100644
--- a/test/correctness/routines/level1/xrotmg.cc
+++ b/test/correctness/routines/level1/xrotmg.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xrotmg.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xrotmg.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xscal.cc b/test/correctness/routines/level1/xscal.cpp
index a3de54b0..939524be 100644
--- a/test/correctness/routines/level1/xscal.cc
+++ b/test/correctness/routines/level1/xscal.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xscal.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xscal.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level1/xswap.cc b/test/correctness/routines/level1/xswap.cpp
index dab60669..446f3d65 100644
--- a/test/correctness/routines/level1/xswap.cc
+++ b/test/correctness/routines/level1/xswap.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level1/xswap.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level1/xswap.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xgbmv.cc b/test/correctness/routines/level2/xgbmv.cpp
index f2e69225..8c49bc65 100644
--- a/test/correctness/routines/level2/xgbmv.cc
+++ b/test/correctness/routines/level2/xgbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xgbmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xgbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xgemv.cc b/test/correctness/routines/level2/xgemv.cpp
index 5b67f0ad..902ae777 100644
--- a/test/correctness/routines/level2/xgemv.cc
+++ b/test/correctness/routines/level2/xgemv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xgemv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xgemv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xger.cc b/test/correctness/routines/level2/xger.cpp
index 05c782db..ce61bbcb 100644
--- a/test/correctness/routines/level2/xger.cc
+++ b/test/correctness/routines/level2/xger.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xger.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xger.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xgerc.cc b/test/correctness/routines/level2/xgerc.cpp
index 6fd80f9f..b747f20d 100644
--- a/test/correctness/routines/level2/xgerc.cc
+++ b/test/correctness/routines/level2/xgerc.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xgerc.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xgerc.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xgeru.cc b/test/correctness/routines/level2/xgeru.cpp
index 84b88c42..f80c1e2b 100644
--- a/test/correctness/routines/level2/xgeru.cc
+++ b/test/correctness/routines/level2/xgeru.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xgeru.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xgeru.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xhbmv.cc b/test/correctness/routines/level2/xhbmv.cpp
index 020c5dc3..a4885c01 100644
--- a/test/correctness/routines/level2/xhbmv.cc
+++ b/test/correctness/routines/level2/xhbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xhbmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xhbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xhemv.cc b/test/correctness/routines/level2/xhemv.cpp
index fcd4e68f..4318ffee 100644
--- a/test/correctness/routines/level2/xhemv.cc
+++ b/test/correctness/routines/level2/xhemv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xhemv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xhemv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xher.cc b/test/correctness/routines/level2/xher.cpp
index 0420a9e8..fe37bd76 100644
--- a/test/correctness/routines/level2/xher.cc
+++ b/test/correctness/routines/level2/xher.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xher.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xher.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xher2.cc b/test/correctness/routines/level2/xher2.cpp
index 36d7db94..0b4af4d0 100644
--- a/test/correctness/routines/level2/xher2.cc
+++ b/test/correctness/routines/level2/xher2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xher2.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xher2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xhpmv.cc b/test/correctness/routines/level2/xhpmv.cpp
index df7121eb..dd77df71 100644
--- a/test/correctness/routines/level2/xhpmv.cc
+++ b/test/correctness/routines/level2/xhpmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xhpmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xhpmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xhpr.cc b/test/correctness/routines/level2/xhpr.cpp
index c13802ea..5a3f615f 100644
--- a/test/correctness/routines/level2/xhpr.cc
+++ b/test/correctness/routines/level2/xhpr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xhpr.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xhpr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xhpr2.cc b/test/correctness/routines/level2/xhpr2.cpp
index 7c62c255..8218b444 100644
--- a/test/correctness/routines/level2/xhpr2.cc
+++ b/test/correctness/routines/level2/xhpr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xhpr2.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xhpr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xsbmv.cc b/test/correctness/routines/level2/xsbmv.cpp
index a0af3c25..7918cb21 100644
--- a/test/correctness/routines/level2/xsbmv.cc
+++ b/test/correctness/routines/level2/xsbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xsbmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xsbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xspmv.cc b/test/correctness/routines/level2/xspmv.cpp
index 39ded21b..78210660 100644
--- a/test/correctness/routines/level2/xspmv.cc
+++ b/test/correctness/routines/level2/xspmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xspmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xspmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xspr.cc b/test/correctness/routines/level2/xspr.cpp
index 2e807a1e..d05adf34 100644
--- a/test/correctness/routines/level2/xspr.cc
+++ b/test/correctness/routines/level2/xspr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xspr.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xspr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xspr2.cc b/test/correctness/routines/level2/xspr2.cpp
index a009bc70..caa46a09 100644
--- a/test/correctness/routines/level2/xspr2.cc
+++ b/test/correctness/routines/level2/xspr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xspr2.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xspr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xsymv.cc b/test/correctness/routines/level2/xsymv.cpp
index 0a0cb002..978a5f8a 100644
--- a/test/correctness/routines/level2/xsymv.cc
+++ b/test/correctness/routines/level2/xsymv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xsymv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xsymv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xsyr.cc b/test/correctness/routines/level2/xsyr.cpp
index 4015a696..244dbfb4 100644
--- a/test/correctness/routines/level2/xsyr.cc
+++ b/test/correctness/routines/level2/xsyr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xsyr.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xsyr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xsyr2.cc b/test/correctness/routines/level2/xsyr2.cpp
index 4bf57a87..422e67ad 100644
--- a/test/correctness/routines/level2/xsyr2.cc
+++ b/test/correctness/routines/level2/xsyr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xsyr2.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xsyr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtbmv.cc b/test/correctness/routines/level2/xtbmv.cpp
index 78b05518..491708ec 100644
--- a/test/correctness/routines/level2/xtbmv.cc
+++ b/test/correctness/routines/level2/xtbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtbmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtbsv.cc b/test/correctness/routines/level2/xtbsv.cpp
index 0026502a..12b5dca5 100644
--- a/test/correctness/routines/level2/xtbsv.cc
+++ b/test/correctness/routines/level2/xtbsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtbsv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtbsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtpmv.cc b/test/correctness/routines/level2/xtpmv.cpp
index 00078c6c..b89f0adc 100644
--- a/test/correctness/routines/level2/xtpmv.cc
+++ b/test/correctness/routines/level2/xtpmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtpmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtpmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtpsv.cc b/test/correctness/routines/level2/xtpsv.cpp
index f0ff939e..6e6e7c85 100644
--- a/test/correctness/routines/level2/xtpsv.cc
+++ b/test/correctness/routines/level2/xtpsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtpsv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtpsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtrmv.cc b/test/correctness/routines/level2/xtrmv.cpp
index 22138806..819f5cad 100644
--- a/test/correctness/routines/level2/xtrmv.cc
+++ b/test/correctness/routines/level2/xtrmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtrmv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtrmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level2/xtrsv.cc b/test/correctness/routines/level2/xtrsv.cpp
index 0bd71fac..78e33807 100644
--- a/test/correctness/routines/level2/xtrsv.cc
+++ b/test/correctness/routines/level2/xtrsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level2/xtrsv.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level2/xtrsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xgemm.cc b/test/correctness/routines/level3/xgemm.cpp
index 869463ee..54d41719 100644
--- a/test/correctness/routines/level3/xgemm.cc
+++ b/test/correctness/routines/level3/xgemm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xgemm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xgemm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xhemm.cc b/test/correctness/routines/level3/xhemm.cpp
index 8261fd31..76c970a7 100644
--- a/test/correctness/routines/level3/xhemm.cc
+++ b/test/correctness/routines/level3/xhemm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xhemm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xhemm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xher2k.cc b/test/correctness/routines/level3/xher2k.cpp
index 381071c8..c653265e 100644
--- a/test/correctness/routines/level3/xher2k.cc
+++ b/test/correctness/routines/level3/xher2k.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xher2k.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xher2k.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xherk.cc b/test/correctness/routines/level3/xherk.cpp
index a5efb263..09ea9e4d 100644
--- a/test/correctness/routines/level3/xherk.cc
+++ b/test/correctness/routines/level3/xherk.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xherk.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xherk.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xsymm.cc b/test/correctness/routines/level3/xsymm.cpp
index 9005f6e6..3cb3515a 100644
--- a/test/correctness/routines/level3/xsymm.cc
+++ b/test/correctness/routines/level3/xsymm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xsymm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xsymm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xsyr2k.cc b/test/correctness/routines/level3/xsyr2k.cpp
index 2d131f21..617af04d 100644
--- a/test/correctness/routines/level3/xsyr2k.cc
+++ b/test/correctness/routines/level3/xsyr2k.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xsyr2k.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xsyr2k.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xsyrk.cc b/test/correctness/routines/level3/xsyrk.cpp
index 32e19ed6..2014b8d0 100644
--- a/test/correctness/routines/level3/xsyrk.cc
+++ b/test/correctness/routines/level3/xsyrk.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xsyrk.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xsyrk.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xtrmm.cc b/test/correctness/routines/level3/xtrmm.cpp
index 3eb89829..32640d52 100644
--- a/test/correctness/routines/level3/xtrmm.cc
+++ b/test/correctness/routines/level3/xtrmm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xtrmm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xtrmm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/level3/xtrsm.cc b/test/correctness/routines/level3/xtrsm.cpp
index f3637e2e..6119bd17 100644
--- a/test/correctness/routines/level3/xtrsm.cc
+++ b/test/correctness/routines/level3/xtrsm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/level3/xtrsm.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/level3/xtrsm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/routines/levelx/xomatcopy.cc b/test/correctness/routines/levelx/xomatcopy.cpp
index 43021bc9..e034bc18 100644
--- a/test/correctness/routines/levelx/xomatcopy.cc
+++ b/test/correctness/routines/levelx/xomatcopy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "correctness/testblas.h"
-#include "routines/levelx/xomatcopy.h"
+#include "test/correctness/testblas.hpp"
+#include "test/routines/levelx/xomatcopy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/correctness/testblas.cc b/test/correctness/testblas.cpp
index 9f842d91..cec8bafa 100644
--- a/test/correctness/testblas.cc
+++ b/test/correctness/testblas.cpp
@@ -14,7 +14,7 @@
#include <algorithm>
#include <iostream>
-#include "correctness/testblas.h"
+#include "test/correctness/testblas.hpp"
namespace clblast {
// =================================================================================================
diff --git a/test/correctness/testblas.h b/test/correctness/testblas.hpp
index e849466a..d01cd06c 100644
--- a/test/correctness/testblas.h
+++ b/test/correctness/testblas.hpp
@@ -21,7 +21,7 @@
#include <string>
#include <algorithm>
-#include "correctness/tester.h"
+#include "test/correctness/tester.hpp"
namespace clblast {
// =================================================================================================
diff --git a/test/correctness/tester.cc b/test/correctness/tester.cpp
index 68c02da6..92e2c1b8 100644
--- a/test/correctness/tester.cc
+++ b/test/correctness/tester.cpp
@@ -11,13 +11,13 @@
//
// =================================================================================================
-#include "correctness/tester.h"
-
#include <string>
#include <vector>
#include <iostream>
#include <cmath>
+#include "test/correctness/tester.hpp"
+
namespace clblast {
// =================================================================================================
diff --git a/test/correctness/tester.h b/test/correctness/tester.hpp
index 0defacec..5e5db6a1 100644
--- a/test/correctness/tester.h
+++ b/test/correctness/tester.hpp
@@ -28,7 +28,7 @@
#endif
#include "clblast.h"
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
// =================================================================================================
diff --git a/test/performance/client.cc b/test/performance/client.cpp
index 4c0c79a6..d0068f8b 100644
--- a/test/performance/client.cc
+++ b/test/performance/client.cpp
@@ -11,7 +11,7 @@
//
// =================================================================================================
-#include "performance/client.h"
+#include "test/performance/client.hpp"
#include <string>
#include <vector>
diff --git a/test/performance/client.h b/test/performance/client.hpp
index 493a7aed..5ff2aec7 100644
--- a/test/performance/client.h
+++ b/test/performance/client.hpp
@@ -31,7 +31,7 @@
#endif
#include "clblast.h"
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
// =================================================================================================
diff --git a/test/performance/routines/level1/xamax.cc b/test/performance/routines/level1/xamax.cpp
index 4af1f1c0..450678e0 100644
--- a/test/performance/routines/level1/xamax.cc
+++ b/test/performance/routines/level1/xamax.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xamax.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xamax.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xasum.cc b/test/performance/routines/level1/xasum.cpp
index 8e098890..c21102f5 100644
--- a/test/performance/routines/level1/xasum.cc
+++ b/test/performance/routines/level1/xasum.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xasum.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xasum.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xaxpy.cc b/test/performance/routines/level1/xaxpy.cpp
index b48c290d..e1c4935e 100644
--- a/test/performance/routines/level1/xaxpy.cc
+++ b/test/performance/routines/level1/xaxpy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xaxpy.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xaxpy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xcopy.cc b/test/performance/routines/level1/xcopy.cpp
index b7c60f0f..ea3531a0 100644
--- a/test/performance/routines/level1/xcopy.cc
+++ b/test/performance/routines/level1/xcopy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xcopy.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xcopy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xdot.cc b/test/performance/routines/level1/xdot.cpp
index 3edf2590..09fe9258 100644
--- a/test/performance/routines/level1/xdot.cc
+++ b/test/performance/routines/level1/xdot.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xdot.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xdot.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xdotc.cc b/test/performance/routines/level1/xdotc.cpp
index 5f36b80e..6e716ebb 100644
--- a/test/performance/routines/level1/xdotc.cc
+++ b/test/performance/routines/level1/xdotc.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xdotc.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xdotc.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xdotu.cc b/test/performance/routines/level1/xdotu.cpp
index f19f751b..d011d558 100644
--- a/test/performance/routines/level1/xdotu.cc
+++ b/test/performance/routines/level1/xdotu.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xdotu.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xdotu.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xnrm2.cc b/test/performance/routines/level1/xnrm2.cpp
index f167df95..1d6e177d 100644
--- a/test/performance/routines/level1/xnrm2.cc
+++ b/test/performance/routines/level1/xnrm2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xnrm2.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xnrm2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xrot.cc b/test/performance/routines/level1/xrot.cpp
index 3ff59ace..4b543f1b 100644
--- a/test/performance/routines/level1/xrot.cc
+++ b/test/performance/routines/level1/xrot.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xrot.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xrot.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xrotg.cc b/test/performance/routines/level1/xrotg.cpp
index 0320c314..e52704b0 100644
--- a/test/performance/routines/level1/xrotg.cc
+++ b/test/performance/routines/level1/xrotg.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xrotg.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xrotg.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xrotm.cc b/test/performance/routines/level1/xrotm.cpp
index 7af94d0f..83ee1d9d 100644
--- a/test/performance/routines/level1/xrotm.cc
+++ b/test/performance/routines/level1/xrotm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xrotm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xrotm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xrotmg.cc b/test/performance/routines/level1/xrotmg.cpp
index a326347b..ee1539d9 100644
--- a/test/performance/routines/level1/xrotmg.cc
+++ b/test/performance/routines/level1/xrotmg.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xrotmg.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xrotmg.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xscal.cc b/test/performance/routines/level1/xscal.cpp
index 35e21ba8..adb83a90 100644
--- a/test/performance/routines/level1/xscal.cc
+++ b/test/performance/routines/level1/xscal.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xscal.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xscal.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level1/xswap.cc b/test/performance/routines/level1/xswap.cpp
index 4791d4c3..7f591d19 100644
--- a/test/performance/routines/level1/xswap.cc
+++ b/test/performance/routines/level1/xswap.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level1/xswap.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level1/xswap.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xgbmv.cc b/test/performance/routines/level2/xgbmv.cpp
index be4056de..6aa72ded 100644
--- a/test/performance/routines/level2/xgbmv.cc
+++ b/test/performance/routines/level2/xgbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xgbmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xgbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xgemv.cc b/test/performance/routines/level2/xgemv.cpp
index 50e6225a..fdcef95d 100644
--- a/test/performance/routines/level2/xgemv.cc
+++ b/test/performance/routines/level2/xgemv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xgemv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xgemv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xger.cc b/test/performance/routines/level2/xger.cpp
index b1b5a268..c4f3699d 100644
--- a/test/performance/routines/level2/xger.cc
+++ b/test/performance/routines/level2/xger.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xger.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xger.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xgerc.cc b/test/performance/routines/level2/xgerc.cpp
index acd0fab7..f855dc11 100644
--- a/test/performance/routines/level2/xgerc.cc
+++ b/test/performance/routines/level2/xgerc.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xgerc.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xgerc.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xgeru.cc b/test/performance/routines/level2/xgeru.cpp
index a5973777..2bf885e3 100644
--- a/test/performance/routines/level2/xgeru.cc
+++ b/test/performance/routines/level2/xgeru.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xgeru.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xgeru.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xhbmv.cc b/test/performance/routines/level2/xhbmv.cpp
index 28b71045..b7f3b9ad 100644
--- a/test/performance/routines/level2/xhbmv.cc
+++ b/test/performance/routines/level2/xhbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xhbmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xhbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xhemv.cc b/test/performance/routines/level2/xhemv.cpp
index 622854a7..e1168083 100644
--- a/test/performance/routines/level2/xhemv.cc
+++ b/test/performance/routines/level2/xhemv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xhemv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xhemv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xher.cc b/test/performance/routines/level2/xher.cpp
index 613d7766..0d1bc1dd 100644
--- a/test/performance/routines/level2/xher.cc
+++ b/test/performance/routines/level2/xher.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xher.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xher.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xher2.cc b/test/performance/routines/level2/xher2.cpp
index c335d3be..3d98c838 100644
--- a/test/performance/routines/level2/xher2.cc
+++ b/test/performance/routines/level2/xher2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xher2.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xher2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xhpmv.cc b/test/performance/routines/level2/xhpmv.cpp
index 1e726569..c3bc3d9c 100644
--- a/test/performance/routines/level2/xhpmv.cc
+++ b/test/performance/routines/level2/xhpmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xhpmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xhpmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xhpr.cc b/test/performance/routines/level2/xhpr.cpp
index 000b69af..afc65b25 100644
--- a/test/performance/routines/level2/xhpr.cc
+++ b/test/performance/routines/level2/xhpr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xhpr.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xhpr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xhpr2.cc b/test/performance/routines/level2/xhpr2.cpp
index 19bafc46..c543dc90 100644
--- a/test/performance/routines/level2/xhpr2.cc
+++ b/test/performance/routines/level2/xhpr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xhpr2.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xhpr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xsbmv.cc b/test/performance/routines/level2/xsbmv.cpp
index 5fb6e8c0..32899a74 100644
--- a/test/performance/routines/level2/xsbmv.cc
+++ b/test/performance/routines/level2/xsbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xsbmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xsbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xspmv.cc b/test/performance/routines/level2/xspmv.cpp
index e0ee2075..0b0d2409 100644
--- a/test/performance/routines/level2/xspmv.cc
+++ b/test/performance/routines/level2/xspmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xspmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xspmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xspr.cc b/test/performance/routines/level2/xspr.cpp
index 19651679..9c1c80a0 100644
--- a/test/performance/routines/level2/xspr.cc
+++ b/test/performance/routines/level2/xspr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xspr.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xspr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xspr2.cc b/test/performance/routines/level2/xspr2.cpp
index 8745c004..117e9c2f 100644
--- a/test/performance/routines/level2/xspr2.cc
+++ b/test/performance/routines/level2/xspr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xspr2.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xspr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xsymv.cc b/test/performance/routines/level2/xsymv.cpp
index 42de1ed5..60db1ae9 100644
--- a/test/performance/routines/level2/xsymv.cc
+++ b/test/performance/routines/level2/xsymv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xsymv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xsymv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xsyr.cc b/test/performance/routines/level2/xsyr.cpp
index 310bfb5e..d9ecd38a 100644
--- a/test/performance/routines/level2/xsyr.cc
+++ b/test/performance/routines/level2/xsyr.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xsyr.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xsyr.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xsyr2.cc b/test/performance/routines/level2/xsyr2.cpp
index bbeed3db..24e0a517 100644
--- a/test/performance/routines/level2/xsyr2.cc
+++ b/test/performance/routines/level2/xsyr2.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xsyr2.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xsyr2.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtbmv.cc b/test/performance/routines/level2/xtbmv.cpp
index 24eec61f..ed9d26a8 100644
--- a/test/performance/routines/level2/xtbmv.cc
+++ b/test/performance/routines/level2/xtbmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtbmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtbmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtbsv.cc b/test/performance/routines/level2/xtbsv.cpp
index 4dcd9a06..f0b80330 100644
--- a/test/performance/routines/level2/xtbsv.cc
+++ b/test/performance/routines/level2/xtbsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtbsv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtbsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtpmv.cc b/test/performance/routines/level2/xtpmv.cpp
index 2f2487f8..c5801205 100644
--- a/test/performance/routines/level2/xtpmv.cc
+++ b/test/performance/routines/level2/xtpmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtpmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtpmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtpsv.cc b/test/performance/routines/level2/xtpsv.cpp
index a3e3f7f1..db956c9d 100644
--- a/test/performance/routines/level2/xtpsv.cc
+++ b/test/performance/routines/level2/xtpsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtpsv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtpsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtrmv.cc b/test/performance/routines/level2/xtrmv.cpp
index 3f23afd1..629c773c 100644
--- a/test/performance/routines/level2/xtrmv.cc
+++ b/test/performance/routines/level2/xtrmv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtrmv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtrmv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level2/xtrsv.cc b/test/performance/routines/level2/xtrsv.cpp
index e8c65b0f..d6c2968c 100644
--- a/test/performance/routines/level2/xtrsv.cc
+++ b/test/performance/routines/level2/xtrsv.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level2/xtrsv.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level2/xtrsv.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xgemm.cc b/test/performance/routines/level3/xgemm.cpp
index 8e48dc3a..3f68096e 100644
--- a/test/performance/routines/level3/xgemm.cc
+++ b/test/performance/routines/level3/xgemm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xgemm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xgemm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xhemm.cc b/test/performance/routines/level3/xhemm.cpp
index 87650b9e..ff6d0f71 100644
--- a/test/performance/routines/level3/xhemm.cc
+++ b/test/performance/routines/level3/xhemm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xhemm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xhemm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xher2k.cc b/test/performance/routines/level3/xher2k.cpp
index 06894816..9636959e 100644
--- a/test/performance/routines/level3/xher2k.cc
+++ b/test/performance/routines/level3/xher2k.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xher2k.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xher2k.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xherk.cc b/test/performance/routines/level3/xherk.cpp
index d6f38fb2..d51400f0 100644
--- a/test/performance/routines/level3/xherk.cc
+++ b/test/performance/routines/level3/xherk.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xherk.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xherk.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xsymm.cc b/test/performance/routines/level3/xsymm.cpp
index 7eac5537..38c3dc9b 100644
--- a/test/performance/routines/level3/xsymm.cc
+++ b/test/performance/routines/level3/xsymm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xsymm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xsymm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xsyr2k.cc b/test/performance/routines/level3/xsyr2k.cpp
index 49d00f34..5360e297 100644
--- a/test/performance/routines/level3/xsyr2k.cc
+++ b/test/performance/routines/level3/xsyr2k.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xsyr2k.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xsyr2k.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xsyrk.cc b/test/performance/routines/level3/xsyrk.cpp
index ad0a06b4..30612f99 100644
--- a/test/performance/routines/level3/xsyrk.cc
+++ b/test/performance/routines/level3/xsyrk.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xsyrk.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xsyrk.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xtrmm.cc b/test/performance/routines/level3/xtrmm.cpp
index 92526844..264a34e7 100644
--- a/test/performance/routines/level3/xtrmm.cc
+++ b/test/performance/routines/level3/xtrmm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xtrmm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xtrmm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/level3/xtrsm.cc b/test/performance/routines/level3/xtrsm.cpp
index 08e4b4a9..80c46d91 100644
--- a/test/performance/routines/level3/xtrsm.cc
+++ b/test/performance/routines/level3/xtrsm.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/level3/xtrsm.h"
+#include "test/performance/client.hpp"
+#include "test/routines/level3/xtrsm.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/performance/routines/levelx/xomatcopy.cc b/test/performance/routines/levelx/xomatcopy.cpp
index 851f6ee1..0bd5773e 100644
--- a/test/performance/routines/levelx/xomatcopy.cc
+++ b/test/performance/routines/levelx/xomatcopy.cpp
@@ -9,8 +9,8 @@
//
// =================================================================================================
-#include "performance/client.h"
-#include "routines/levelx/xomatcopy.h"
+#include "test/performance/client.hpp"
+#include "test/routines/levelx/xomatcopy.hpp"
// Shortcuts to the clblast namespace
using float2 = clblast::float2;
diff --git a/test/routines/level1/xamax.h b/test/routines/level1/xamax.hpp
index 12b031bc..4423845e 100644
--- a/test/routines/level1/xamax.h
+++ b/test/routines/level1/xamax.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xasum.h b/test/routines/level1/xasum.hpp
index eb83817b..b1f02dcd 100644
--- a/test/routines/level1/xasum.h
+++ b/test/routines/level1/xasum.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xaxpy.h b/test/routines/level1/xaxpy.hpp
index c241da91..c276a42e 100644
--- a/test/routines/level1/xaxpy.h
+++ b/test/routines/level1/xaxpy.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xcopy.h b/test/routines/level1/xcopy.hpp
index a1ff06ce..a96bb9ae 100644
--- a/test/routines/level1/xcopy.h
+++ b/test/routines/level1/xcopy.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xdot.h b/test/routines/level1/xdot.hpp
index 0bbc93d5..f6cf2809 100644
--- a/test/routines/level1/xdot.h
+++ b/test/routines/level1/xdot.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xdotc.h b/test/routines/level1/xdotc.hpp
index e1cc1854..2b00d04b 100644
--- a/test/routines/level1/xdotc.h
+++ b/test/routines/level1/xdotc.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xdotu.h b/test/routines/level1/xdotu.hpp
index 558257cc..31a867e0 100644
--- a/test/routines/level1/xdotu.h
+++ b/test/routines/level1/xdotu.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xnrm2.h b/test/routines/level1/xnrm2.hpp
index 19074ca2..62d649e3 100644
--- a/test/routines/level1/xnrm2.h
+++ b/test/routines/level1/xnrm2.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xscal.h b/test/routines/level1/xscal.hpp
index 84d14ac7..79926890 100644
--- a/test/routines/level1/xscal.h
+++ b/test/routines/level1/xscal.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level1/xswap.h b/test/routines/level1/xswap.hpp
index e870b602..8f7e4cfe 100644
--- a/test/routines/level1/xswap.h
+++ b/test/routines/level1/xswap.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xgbmv.h b/test/routines/level2/xgbmv.hpp
index c777ff73..5a907077 100644
--- a/test/routines/level2/xgbmv.h
+++ b/test/routines/level2/xgbmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xgemv.h b/test/routines/level2/xgemv.hpp
index f8a7e1d0..1499b2d2 100644
--- a/test/routines/level2/xgemv.h
+++ b/test/routines/level2/xgemv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xger.h b/test/routines/level2/xger.hpp
index e0d1fe49..5cbed505 100644
--- a/test/routines/level2/xger.h
+++ b/test/routines/level2/xger.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xgerc.h b/test/routines/level2/xgerc.hpp
index 7449146b..d50092cb 100644
--- a/test/routines/level2/xgerc.h
+++ b/test/routines/level2/xgerc.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xgeru.h b/test/routines/level2/xgeru.hpp
index 07837657..9c823b73 100644
--- a/test/routines/level2/xgeru.h
+++ b/test/routines/level2/xgeru.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xhbmv.h b/test/routines/level2/xhbmv.hpp
index 73194975..01cb3f51 100644
--- a/test/routines/level2/xhbmv.h
+++ b/test/routines/level2/xhbmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xhemv.h b/test/routines/level2/xhemv.hpp
index aabbf14a..dadd3975 100644
--- a/test/routines/level2/xhemv.h
+++ b/test/routines/level2/xhemv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xher.h b/test/routines/level2/xher.hpp
index 1294832c..b21c0a9b 100644
--- a/test/routines/level2/xher.h
+++ b/test/routines/level2/xher.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xher2.h b/test/routines/level2/xher2.hpp
index 5e90174d..070f823c 100644
--- a/test/routines/level2/xher2.h
+++ b/test/routines/level2/xher2.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xhpmv.h b/test/routines/level2/xhpmv.hpp
index 8face6b6..d7f9634e 100644
--- a/test/routines/level2/xhpmv.h
+++ b/test/routines/level2/xhpmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xhpr.h b/test/routines/level2/xhpr.hpp
index 63cab31f..8f44a68d 100644
--- a/test/routines/level2/xhpr.h
+++ b/test/routines/level2/xhpr.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xhpr2.h b/test/routines/level2/xhpr2.hpp
index 64d205a0..666a8dfc 100644
--- a/test/routines/level2/xhpr2.h
+++ b/test/routines/level2/xhpr2.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xsbmv.h b/test/routines/level2/xsbmv.hpp
index 3f1446c8..fd5dd68e 100644
--- a/test/routines/level2/xsbmv.h
+++ b/test/routines/level2/xsbmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xspmv.h b/test/routines/level2/xspmv.hpp
index 2add3cdd..63286248 100644
--- a/test/routines/level2/xspmv.h
+++ b/test/routines/level2/xspmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xspr.h b/test/routines/level2/xspr.hpp
index ad21bdf6..f9dead53 100644
--- a/test/routines/level2/xspr.h
+++ b/test/routines/level2/xspr.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xspr2.h b/test/routines/level2/xspr2.hpp
index c55e8181..a2f22098 100644
--- a/test/routines/level2/xspr2.h
+++ b/test/routines/level2/xspr2.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xsymv.h b/test/routines/level2/xsymv.hpp
index b6583a24..0d3ca632 100644
--- a/test/routines/level2/xsymv.h
+++ b/test/routines/level2/xsymv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xsyr.h b/test/routines/level2/xsyr.hpp
index f3929588..15ad9595 100644
--- a/test/routines/level2/xsyr.h
+++ b/test/routines/level2/xsyr.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xsyr2.h b/test/routines/level2/xsyr2.hpp
index 8cdb6a14..a9a61a1f 100644
--- a/test/routines/level2/xsyr2.h
+++ b/test/routines/level2/xsyr2.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xtbmv.h b/test/routines/level2/xtbmv.hpp
index 9c4131ec..54e7fe18 100644
--- a/test/routines/level2/xtbmv.h
+++ b/test/routines/level2/xtbmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xtpmv.h b/test/routines/level2/xtpmv.hpp
index 58249227..9776c4de 100644
--- a/test/routines/level2/xtpmv.h
+++ b/test/routines/level2/xtpmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level2/xtrmv.h b/test/routines/level2/xtrmv.hpp
index 635a1319..18300e50 100644
--- a/test/routines/level2/xtrmv.h
+++ b/test/routines/level2/xtrmv.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xgemm.h b/test/routines/level3/xgemm.hpp
index 842dae93..5f9bea81 100644
--- a/test/routines/level3/xgemm.h
+++ b/test/routines/level3/xgemm.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xhemm.h b/test/routines/level3/xhemm.hpp
index 106b99ff..8c44be25 100644
--- a/test/routines/level3/xhemm.h
+++ b/test/routines/level3/xhemm.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xher2k.h b/test/routines/level3/xher2k.hpp
index e2f4448f..fd20bbb5 100644
--- a/test/routines/level3/xher2k.h
+++ b/test/routines/level3/xher2k.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xherk.h b/test/routines/level3/xherk.hpp
index 43d7cfcd..12990d39 100644
--- a/test/routines/level3/xherk.h
+++ b/test/routines/level3/xherk.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xsymm.h b/test/routines/level3/xsymm.hpp
index c32b4cf7..f8e90927 100644
--- a/test/routines/level3/xsymm.h
+++ b/test/routines/level3/xsymm.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xsyr2k.h b/test/routines/level3/xsyr2k.hpp
index 57c3c203..4e4ba0b7 100644
--- a/test/routines/level3/xsyr2k.h
+++ b/test/routines/level3/xsyr2k.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xsyrk.h b/test/routines/level3/xsyrk.hpp
index 6c3a3786..f5509c88 100644
--- a/test/routines/level3/xsyrk.h
+++ b/test/routines/level3/xsyrk.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/level3/xtrmm.h b/test/routines/level3/xtrmm.hpp
index 3eb63030..45e17e45 100644
--- a/test/routines/level3/xtrmm.h
+++ b/test/routines/level3/xtrmm.hpp
@@ -20,10 +20,10 @@
#include <string>
#ifdef CLBLAST_REF_CLBLAS
- #include "wrapper_clblas.h"
+ #include "test/wrapper_clblas.hpp"
#endif
#ifdef CLBLAST_REF_CBLAS
- #include "wrapper_cblas.h"
+ #include "test/wrapper_cblas.hpp"
#endif
namespace clblast {
diff --git a/test/routines/levelx/xomatcopy.h b/test/routines/levelx/xomatcopy.hpp
index c499ba75..c499ba75 100644
--- a/test/routines/levelx/xomatcopy.h
+++ b/test/routines/levelx/xomatcopy.hpp
diff --git a/test/wrapper_cblas.h b/test/wrapper_cblas.hpp
index bf59aa94..7bc674ab 100644
--- a/test/wrapper_cblas.h
+++ b/test/wrapper_cblas.hpp
@@ -20,7 +20,7 @@ extern "C"
#include <cblas.h>
}
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {
diff --git a/test/wrapper_clblas.h b/test/wrapper_clblas.hpp
index 5115b3d9..3f33890a 100644
--- a/test/wrapper_clblas.h
+++ b/test/wrapper_clblas.hpp
@@ -17,7 +17,7 @@
#include <clBLAS.h>
-#include "internal/utilities.h"
+#include "utilities.hpp"
namespace clblast {