Skip to content

CLI usage

Sotiris Niarchos edited this page Jun 16, 2020 · 3 revisions

oclude can be used as a command line tool through its CLI (command line interface).

The examples of usage in the README, along with the help message of oclude that follows, are all the documentation you will ever need to use it.

$ oclude -h
usage: oclude [-h] [-f FILE] [-k KERNEL] [-g GSIZE] [-l LSIZE]
              [-p PLATFORM_ID] [-d DEVICE_ID] [-s SAMPLES] [-v] [-i] [-t]
              [-x TIMEOUT] [--clear-cache] [--ignore-cache]
              [--no-cache-warnings]
              [{kernel,device}]

oclude - the OpenCL universal driving environment

positional arguments:
  {kernel,device}       oclude supports the following commands:
                        
                           kernel    Profile an OpenCL kernel from a given source file
                                     (default if <command> is ommited)
                           device    Profile the selected OpenCL device
                                     (only -p and -d flags are taken into consideration)

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  the *.cl file with the OpenCL kernel(s)
  -k KERNEL, --kernel KERNEL
                        the name of the kernel to run from the input file
  -g GSIZE, --gsize GSIZE
                        The global NDRange, i.e. the size of the buffer arguments of the kernel
  -l LSIZE, --lsize LSIZE
                        The local NDRange, i.e. the number of work items in a work group (default: auto-selected)
  -p PLATFORM_ID, --platform PLATFORM_ID
                        the index of the OpenCL platform to use (default: 0)
  -d DEVICE_ID, --device DEVICE_ID
                        the index of the OpenCL device to use (default: 0)
  -s SAMPLES, --samples SAMPLES
                        number of times to execute the given kernel (note that each execution is initialized with different values)
  -v, --verbose         toggle verbose output (default: false)
  -i, --inst-counts     count the LLVM instructions that were executed and dump them to stdout
  -t, --time-it         measure kernel execution time and dump it to stdout
  -x TIMEOUT, --timeout TIMEOUT
                        seconds after which ALL scheduled kernel executions are interrupted; use 0 to never interrupt (default: 30)
  --clear-cache         remove every cached info (irreversible)
  --ignore-cache        do not use (possibly) cached info regarding the provided kernel file
  --no-cache-warnings   suppress cache-related warnings (e.g. cache too large)

IMPORTANT NOTE: If a value greater than 1 is used for the --samples/-s flag, then the reported results (either from --inst-counts/-i or --time-it/-t) will be the average across all samples/executions of the specified OpenCL kernel.

Clone this wiki locally