summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/clblast.md35
-rwxr-xr-xscripts/generator/generator.py16
2 files changed, 50 insertions, 1 deletions
diff --git a/doc/clblast.md b/doc/clblast.md
index 37b99f3d..11560dce 100644
--- a/doc/clblast.md
+++ b/doc/clblast.md
@@ -2781,3 +2781,38 @@ Requirements for OMATCOPY:
+ClearCache: Resets the cache of compiled binaries (auxiliary function)
+-------------
+
+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 it can be useful in case of debugging.
+
+C++ API:
+```
+StatusCode ClearCache()
+```
+
+C API:
+```
+CLBlastStatusCode CLBlastClearCache()
+```
+
+
+
+FillCache: Populates the cache of compiled binaries for a specific device (auxiliary function)
+-------------
+
+CLBlast stores binaries of compiled kernels into a cache in case the same kernel is used later on for the same device. This cache is automatically populated whenever a new binary is created. Thus, the first run of a specific kernel could take extra time. For debugging or performance evaluation purposes, it might be useful to populate the cache upfront. This function populates the cache for all kernels in CLBlast for all precisions, but for a specific device only.
+
+C++ API:
+```
+StatusCode FillCache(const cl_device_id device)
+```
+
+C API:
+```
+CLBlastStatusCode CLBlastFillCache(const cl_device_id device)
+```
+
+Arguments to FillCache:
+
+* `const cl_device_id device`: The OpenCL device to fill the cache for.
diff --git a/scripts/generator/generator.py b/scripts/generator/generator.py
index 9bc48502..38f18e8a 100755
--- a/scripts/generator/generator.py
+++ b/scripts/generator/generator.py
@@ -43,6 +43,8 @@ FILES = [
]
HEADER_LINES = [121, 73, 125, 23, 29, 41, 65, 32]
FOOTER_LINES = [26, 139, 28, 38, 6, 6, 9, 2]
+HEADER_LINES_DOC = 0
+FOOTER_LINES_DOC = 35
# Different possibilities for requirements
ald_m = "The value of `a_ld` must be at least `m`."
@@ -233,11 +235,20 @@ def main(argv):
f.write(cpp.performance_test(routine, level_string))
f.write(cpp.FOOTER)
- # Outputs the API documentation
+ # API documentation
filename = cl_args.clblast_root + "/doc/clblast.md"
+
+ # Stores the header and the footer of the original documentation file
+ with open(filename) as f:
+ original = f.readlines()
+ file_header = original[:HEADER_LINES_DOC]
+ file_footer = original[-FOOTER_LINES_DOC:]
+
+ # Outputs the API documentation
with open(filename, "w") as f:
# Outputs the header
+ f.write("".join(file_header))
doc_header = doc.header()
f.write(doc_header)
@@ -248,5 +259,8 @@ def main(argv):
doc_routine = doc.generate(routine)
f.write(doc_routine)
+ # Outputs the footer
+ f.write("".join(file_footer))
+
if __name__ == '__main__':
main(sys.argv[1:])