Skip to content

Commit 0019d67

Browse files
authored
add controls to dump buffer and image hashes (#340)
* add support for dumping buffer and image hashes * added specific dump hashes controls for buffers and images switched more code to use dumpMemoryToFile * regenerate controls doc
1 parent 365c29e commit 0019d67

File tree

4 files changed

+177
-338
lines changed

4 files changed

+177
-338
lines changed

docs/controls.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,14 @@ This is the list of options that is implicitly passed to CLANG to build an OpenC
519519

520520
### Controls for Dumping Buffers and Images
521521

522+
##### `DumpBufferHashes` (bool)
523+
524+
If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump hashes of a buffer, SVM, or USM allocation rather than the full contents of the buffer. This can be useful to identify which kernel enqueues generate different results without requiring a large amount of disk space.
525+
526+
##### `DumpImageHashes` (bool)
527+
528+
If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump hashes of an image rather than the full contents of the image. This can be useful to identify which kernel enqueues generate different results without requiring a large amount of disk space.
529+
522530
##### `DumpArgumentsOnSet` (bool)
523531

524532
If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump the argument value on calls to clSetKernelArg(). Arguments are dumped as raw binary data. The filenames will have the form "SetKernelArg\_\<Enqueue Number\>\_Kernel\_\<Kernel Name\>\_Arg\_\<Argument Number\>.bin".

intercept/src/controls.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ CLI_CONTROL( std::string, DefaultOptions, "-cc1 -x cl
119119
CLI_CONTROL( std::string, OpenCL2Options, "-cc1 -x cl -cl-std=CL2.0 -D__OPENCL_C_VERSION__=200 -D__OPENCL_VERSION__=200 -emit-spirv -triple=spir", "This is the list of options that is implicitly passed to CLANG to build an OpenCL 2.0 SPIR-V module. Any application-provided build options will be appended to these build options." )
120120

121121
CLI_CONTROL_SEPARATOR( Controls for Dumping Buffers and Images: )
122+
CLI_CONTROL( bool, DumpBufferHashes, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump hashes of a buffer, SVM, or USM allocation rather than the full contents of the buffer. This can be useful to identify which kernel enqueues generate different results without requiring a large amount of disk space." )
123+
CLI_CONTROL( bool, DumpImageHashes, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump hashes of an image rather than the full contents of the image. This can be useful to identify which kernel enqueues generate different results without requiring a large amount of disk space." )
122124
CLI_CONTROL( bool, DumpArgumentsOnSet, false, "If set to a nonzero value, the Intercept Layer for OpenCL Applications will dump the argument value on calls to clSetKernelArg(). Arguments are dumped as raw binary data. The filenames will have the form \"SetKernelArg_<Enqueue Number>_Kernel_<Kernel Name>_Arg_<Argument Number>.bin\"." )
123125
CLI_CONTROL( bool, DumpBuffersAfterCreate, false, "If set, the Intercept Layer for OpenCL Applications will dump buffers to a file after creation. This control still honors the enqueue counter limits, even though no enqueues are involved during buffer creation. Currently only works for cl_mem buffers created from host pointers." )
124126
CLI_CONTROL( bool, DumpBuffersAfterMap, false, "If set, the Intercept Layer for OpenCL Applications will dump the contents of a buffer to a file after the buffer is mapped. Only valid if the buffer is NOT mapped with CL_MAP_WRITE_INVALIDATE_REGION. If the buffer was mapped non-blocking, this may insert a clFinish() into the command queue, which may have functional or performance implications." )

0 commit comments

Comments
 (0)