summaryrefslogtreecommitdiff
path: root/include/clblast_cuda.h
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2018-01-06 10:05:28 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2018-01-06 10:05:28 +0100
commitce069545d4b9ac32a094117de75919087a7bc21e (patch)
tree94aa7e3293600dce1cf4dee83cb00d4ffb724586 /include/clblast_cuda.h
parent44431daecc63cc4ead3208327bcd70834b3f4bdb (diff)
Added CUDA interface to get temporary-buffer size for GEMM routine
Diffstat (limited to 'include/clblast_cuda.h')
-rw-r--r--include/clblast_cuda.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/clblast_cuda.h b/include/clblast_cuda.h
index 0f510981..e0d1d638 100644
--- a/include/clblast_cuda.h
+++ b/include/clblast_cuda.h
@@ -69,6 +69,7 @@ enum class StatusCode {
kInsufficientMemoryY = -1007, // Vector Y's OpenCL buffer is too small
// Custom additional status codes for CLBlast
+ kInsufficientMemoryTemp = -2050, // Temporary buffer provided to GEMM routine is too small
kInvalidBatchCount = -2049, // The batch count needs to be positive
kInvalidOverrideKernel = -2048, // Trying to override parameters for an invalid kernel
kMissingOverrideParameter = -2047, // Missing override parameter(s) for the target kernel
@@ -620,6 +621,17 @@ StatusCode GemmBatched(const Layout layout, const Transpose a_transpose, const T
// =================================================================================================
+// Retrieves the required size of the temporary buffer for the GEMM kernel (optional)
+template <typename T>
+StatusCode GemmTempBufferSize(const Layout layout, const Transpose a_transpose, const Transpose b_transpose,
+ const size_t m, const size_t n, const size_t k,
+ const size_t a_offset, const size_t a_ld,
+ const size_t b_offset, const size_t b_ld,
+ const size_t c_offset, const size_t c_ld,
+ const CUdevice device, size_t& temp_buffer_size);
+
+// =================================================================================================
+
// CLBlast stores binaries of compiled kernels into a cache in case the same kernel is used later on
// for the same device. This cache can be cleared to free up system memory or in case of debugging.
StatusCode PUBLIC_API ClearCache();