diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-06-18 18:44:14 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-06-18 18:44:14 +0200 |
commit | 682c01a80cfcb9556799c790f126957d8d0c07e2 (patch) | |
tree | 6fe3e870192ed5867e4b5b88312b6ea28c6dbfd1 /src | |
parent | af40b8e667b6e369c633247e584baa9c13e86f98 (diff) |
Now returns program from database by reference
Diffstat (limited to 'src')
-rw-r--r-- | src/routine.cc | 2 | ||||
-rw-r--r-- | src/routines/xaxpy.cc | 2 | ||||
-rw-r--r-- | src/routines/xgemm.cc | 2 | ||||
-rw-r--r-- | src/routines/xgemv.cc | 2 | ||||
-rw-r--r-- | src/routines/xsymm.cc | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/routine.cc b/src/routine.cc index 064db754..a4e0bb37 100644 --- a/src/routine.cc +++ b/src/routine.cc @@ -308,7 +308,7 @@ StatusCode Routine::PadCopyTransposeMatrix(const size_t src_one, const size_t sr // Queries the cache and retrieves a matching program. Assumes that the match is available, throws // otherwise. -Program Routine::GetProgramFromCache() const { +const Program& Routine::GetProgramFromCache() const { for (auto &cached_program: program_cache_) { if (cached_program.MatchInCache(device_name_, precision_, routines_)) { return cached_program.program; diff --git a/src/routines/xaxpy.cc b/src/routines/xaxpy.cc index d77bf07e..b68458da 100644 --- a/src/routines/xaxpy.cc +++ b/src/routines/xaxpy.cc @@ -60,7 +60,7 @@ StatusCode Xaxpy<T>::DoAxpy(const size_t n, const T alpha, // Retrieves the Xaxpy kernel from the compiled binary try { - auto program = GetProgramFromCache(); + auto& program = GetProgramFromCache(); auto kernel = Kernel(program, kernel_name); // Sets the kernel arguments diff --git a/src/routines/xgemm.cc b/src/routines/xgemm.cc index db10899c..20cd2675 100644 --- a/src/routines/xgemm.cc +++ b/src/routines/xgemm.cc @@ -102,7 +102,7 @@ StatusCode Xgemm<T>::DoGemm(const Layout layout, auto temp_c = Buffer(context_, CL_MEM_READ_WRITE, m_ceiled*n_ceiled*sizeof(T)); // Loads the program from the database - auto program = GetProgramFromCache(); + auto& program = GetProgramFromCache(); // Runs the pre-processing kernels. This transposes the matrices, but also pads zeros to fill // them up until they reach a certain multiple of size (kernel parameter dependent). diff --git a/src/routines/xgemv.cc b/src/routines/xgemv.cc index 78071c17..1868dec4 100644 --- a/src/routines/xgemv.cc +++ b/src/routines/xgemv.cc @@ -100,7 +100,7 @@ StatusCode Xgemv<T>::DoGemv(const Layout layout, const Transpose a_transpose, // Retrieves the Xgemv kernel from the compiled binary try { - auto program = GetProgramFromCache(); + auto& program = GetProgramFromCache(); auto kernel = Kernel(program, kernel_name); // Sets the kernel arguments diff --git a/src/routines/xsymm.cc b/src/routines/xsymm.cc index aa43593d..97f35be8 100644 --- a/src/routines/xsymm.cc +++ b/src/routines/xsymm.cc @@ -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 { - auto program = GetProgramFromCache(); + auto& program = GetProgramFromCache(); auto kernel = Kernel(program, kernel_name); // Sets the arguments for the symmetric-to-squared kernel |