diff options
Diffstat (limited to 'include/internal')
26 files changed, 32 insertions, 49 deletions
diff --git a/include/internal/cache.h b/include/internal/cache.h index 4a11b70f..bc7e87d9 100644 --- a/include/internal/cache.h +++ b/include/internal/cache.h @@ -21,7 +21,6 @@ #include "internal/utilities.h" 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/include/internal/routine.h b/include/internal/routine.h index e1888f1f..c64abc4c 100644 --- a/include/internal/routine.h +++ b/include/internal/routine.h @@ -41,30 +41,6 @@ class Routine { protected: - // 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_; diff --git a/include/internal/routines/level1/xamax.h b/include/internal/routines/level1/xamax.h index 54434362..ec1de346 100644 --- a/include/internal/routines/level1/xamax.h +++ b/include/internal/routines/level1/xamax.h @@ -31,7 +31,7 @@ class Xamax: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xamax(Queue &queue, EventPointer event, const std::string &name = "AMAX"); diff --git a/include/internal/routines/level1/xasum.h b/include/internal/routines/level1/xasum.h index ee593e30..b6c8e4e6 100644 --- a/include/internal/routines/level1/xasum.h +++ b/include/internal/routines/level1/xasum.h @@ -31,7 +31,7 @@ class Xasum: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xasum(Queue &queue, EventPointer event, const std::string &name = "ASUM"); diff --git a/include/internal/routines/level1/xaxpy.h b/include/internal/routines/level1/xaxpy.h index 6ea3264b..71e7c01c 100644 --- a/include/internal/routines/level1/xaxpy.h +++ b/include/internal/routines/level1/xaxpy.h @@ -31,7 +31,7 @@ class Xaxpy: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xaxpy(Queue &queue, EventPointer event, const std::string &name = "AXPY"); diff --git a/include/internal/routines/level1/xcopy.h b/include/internal/routines/level1/xcopy.h index b371ca9b..de9edaaf 100644 --- a/include/internal/routines/level1/xcopy.h +++ b/include/internal/routines/level1/xcopy.h @@ -30,7 +30,8 @@ class Xcopy: public Routine<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::event_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::context_; + using Routine<T>::routine_name_; // Constructor Xcopy(Queue &queue, EventPointer event, const std::string &name = "COPY"); diff --git a/include/internal/routines/level1/xdot.h b/include/internal/routines/level1/xdot.h index 7c69a902..b70ff3fe 100644 --- a/include/internal/routines/level1/xdot.h +++ b/include/internal/routines/level1/xdot.h @@ -31,7 +31,7 @@ class Xdot: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xdot(Queue &queue, EventPointer event, const std::string &name = "DOT"); diff --git a/include/internal/routines/level1/xnrm2.h b/include/internal/routines/level1/xnrm2.h index f83cc2ce..1cb22728 100644 --- a/include/internal/routines/level1/xnrm2.h +++ b/include/internal/routines/level1/xnrm2.h @@ -31,7 +31,7 @@ class Xnrm2: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xnrm2(Queue &queue, EventPointer event, const std::string &name = "NRM2"); diff --git a/include/internal/routines/level1/xscal.h b/include/internal/routines/level1/xscal.h index 40f017f2..c2b2c1bf 100644 --- a/include/internal/routines/level1/xscal.h +++ b/include/internal/routines/level1/xscal.h @@ -30,7 +30,8 @@ class Xscal: public Routine<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::event_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::context_; + using Routine<T>::routine_name_; // Constructor Xscal(Queue &queue, EventPointer event, const std::string &name = "SCAL"); diff --git a/include/internal/routines/level1/xswap.h b/include/internal/routines/level1/xswap.h index f794a1b4..45e34dd6 100644 --- a/include/internal/routines/level1/xswap.h +++ b/include/internal/routines/level1/xswap.h @@ -30,7 +30,8 @@ class Xswap: public Routine<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::event_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::context_; + using Routine<T>::routine_name_; // Constructor Xswap(Queue &queue, EventPointer event, const std::string &name = "SWAP"); diff --git a/include/internal/routines/level2/xgemv.h b/include/internal/routines/level2/xgemv.h index aec8b35b..b28536bd 100644 --- a/include/internal/routines/level2/xgemv.h +++ b/include/internal/routines/level2/xgemv.h @@ -31,7 +31,7 @@ class Xgemv: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xgemv(Queue &queue, EventPointer event, const std::string &name = "GEMV"); diff --git a/include/internal/routines/level2/xger.h b/include/internal/routines/level2/xger.h index 260325cb..996e0fc8 100644 --- a/include/internal/routines/level2/xger.h +++ b/include/internal/routines/level2/xger.h @@ -31,7 +31,7 @@ class Xger: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xger(Queue &queue, EventPointer event, const std::string &name = "GER"); diff --git a/include/internal/routines/level2/xher.h b/include/internal/routines/level2/xher.h index d66b2603..a4a25c3c 100644 --- a/include/internal/routines/level2/xher.h +++ b/include/internal/routines/level2/xher.h @@ -31,7 +31,7 @@ class Xher: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xher(Queue &queue, EventPointer event, const std::string &name = "HER"); diff --git a/include/internal/routines/level2/xher2.h b/include/internal/routines/level2/xher2.h index 35bf8190..de8583f4 100644 --- a/include/internal/routines/level2/xher2.h +++ b/include/internal/routines/level2/xher2.h @@ -31,7 +31,7 @@ class Xher2: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xher2(Queue &queue, EventPointer event, const std::string &name = "HER2"); diff --git a/include/internal/routines/level2/xtbmv.h b/include/internal/routines/level2/xtbmv.h index c9107c25..3ccdf3f8 100644 --- a/include/internal/routines/level2/xtbmv.h +++ b/include/internal/routines/level2/xtbmv.h @@ -30,6 +30,7 @@ class Xtbmv: public Xgemv<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; + using Routine<T>::routine_name_; // Uses the generic matrix-vector routine using Xgemv<T>::MatVec; diff --git a/include/internal/routines/level2/xtpmv.h b/include/internal/routines/level2/xtpmv.h index e85c225f..7619197d 100644 --- a/include/internal/routines/level2/xtpmv.h +++ b/include/internal/routines/level2/xtpmv.h @@ -30,6 +30,7 @@ class Xtpmv: public Xgemv<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; + using Routine<T>::routine_name_; // Uses the generic matrix-vector routine using Xgemv<T>::MatVec; diff --git a/include/internal/routines/level2/xtrmv.h b/include/internal/routines/level2/xtrmv.h index 97a180ff..4021b39c 100644 --- a/include/internal/routines/level2/xtrmv.h +++ b/include/internal/routines/level2/xtrmv.h @@ -30,6 +30,7 @@ class Xtrmv: public Xgemv<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; + using Routine<T>::routine_name_; // Uses the generic matrix-vector routine using Xgemv<T>::MatVec; diff --git a/include/internal/routines/level3/xgemm.h b/include/internal/routines/level3/xgemm.h index 2fd853a9..211ae990 100644 --- a/include/internal/routines/level3/xgemm.h +++ b/include/internal/routines/level3/xgemm.h @@ -31,7 +31,7 @@ class Xgemm: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xgemm(Queue &queue, EventPointer event, const std::string &name = "GEMM"); @@ -45,7 +45,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/include/internal/routines/level3/xhemm.h b/include/internal/routines/level3/xhemm.h index 8bd38393..a9a422b0 100644 --- a/include/internal/routines/level3/xhemm.h +++ b/include/internal/routines/level3/xhemm.h @@ -30,10 +30,11 @@ class Xhemm: public Xgemm<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Uses the regular Xgemm routine using Xgemm<T>::DoGemm; + using Xgemm<T>::precision_; // Constructor Xhemm(Queue &queue, EventPointer event, const std::string &name = "HEMM"); diff --git a/include/internal/routines/level3/xher2k.h b/include/internal/routines/level3/xher2k.h index 1afe87a6..092d7246 100644 --- a/include/internal/routines/level3/xher2k.h +++ b/include/internal/routines/level3/xher2k.h @@ -33,7 +33,7 @@ class Xher2k: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xher2k(Queue &queue, EventPointer event, const std::string &name = "HER2K"); diff --git a/include/internal/routines/level3/xherk.h b/include/internal/routines/level3/xherk.h index 64abae3b..b5e2d723 100644 --- a/include/internal/routines/level3/xherk.h +++ b/include/internal/routines/level3/xherk.h @@ -33,7 +33,7 @@ class Xherk: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xherk(Queue &queue, EventPointer event, const std::string &name = "HERK"); diff --git a/include/internal/routines/level3/xsymm.h b/include/internal/routines/level3/xsymm.h index c35dfb5e..991284f5 100644 --- a/include/internal/routines/level3/xsymm.h +++ b/include/internal/routines/level3/xsymm.h @@ -32,10 +32,11 @@ class Xsymm: public Xgemm<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Uses the regular Xgemm routine using Xgemm<T>::DoGemm; + using Xgemm<T>::precision_; // Constructor Xsymm(Queue &queue, EventPointer event, const std::string &name = "SYMM"); diff --git a/include/internal/routines/level3/xsyr2k.h b/include/internal/routines/level3/xsyr2k.h index 73d11b0b..c7ae1678 100644 --- a/include/internal/routines/level3/xsyr2k.h +++ b/include/internal/routines/level3/xsyr2k.h @@ -33,7 +33,7 @@ class Xsyr2k: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xsyr2k(Queue &queue, EventPointer event, const std::string &name = "SYR2K"); diff --git a/include/internal/routines/level3/xsyrk.h b/include/internal/routines/level3/xsyrk.h index 344c02e2..860f8e10 100644 --- a/include/internal/routines/level3/xsyrk.h +++ b/include/internal/routines/level3/xsyrk.h @@ -35,7 +35,7 @@ class Xsyrk: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xsyrk(Queue &queue, EventPointer event, const std::string &name = "SYRK"); diff --git a/include/internal/routines/level3/xtrmm.h b/include/internal/routines/level3/xtrmm.h index 5c12815d..caf1ca75 100644 --- a/include/internal/routines/level3/xtrmm.h +++ b/include/internal/routines/level3/xtrmm.h @@ -31,10 +31,11 @@ class Xtrmm: public Xgemm<T> { using Routine<T>::queue_; using Routine<T>::device_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Uses the regular Xgemm routine using Xgemm<T>::DoGemm; + using Xgemm<T>::precision_; // Constructor Xtrmm(Queue &queue, EventPointer event, const std::string &name = "TRMM"); diff --git a/include/internal/routines/levelx/xomatcopy.h b/include/internal/routines/levelx/xomatcopy.h index 7c284635..29f33aac 100644 --- a/include/internal/routines/levelx/xomatcopy.h +++ b/include/internal/routines/levelx/xomatcopy.h @@ -31,7 +31,7 @@ class Xomatcopy: public Routine<T> { using Routine<T>::device_; using Routine<T>::event_; using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; + using Routine<T>::routine_name_; // Constructor Xomatcopy(Queue &queue, EventPointer event, const std::string &name = "OMATCOPY"); |