portDNN Configuration Options

September 18, 2023 ยท View on GitHub

portDNN's CMake provides a number of configuration options to control which parts of the code will be built, tested and benchmarked. They are described here.

Build options

OptionTypeDefaultDescription
CMAKE_BUILD_TYPESTRINGReleaseRelease, RelWithDebInfo etc. Controls compiler flags.
SNN_FASTBUILDBOOLOFFDisables default-set CMAKE_BUILD_TYPE when ON
SNN_BUILD_TESTSBOOLONEnables the portDNN test suite
SNN_BUILD_SAMPLESBOOLONBuilds portDNN's sample code
SNN_BUILD_BENCHMARKSBOOLONBuilds portDNN's benchmarks
SNN_BUILD_EXTENDED_BENCHMARKSBOOLOFFOFF disables batch sizes 2, 8, 16, 64.
SNN_BUILD_LARGE_BATCH_BENCHMARKSBOOLOFFOFF disables batch sizes 8, 16, 32, 64. Slow.
SNN_BUILD_INTERNAL_BENCHMARKSBOOLOFFBuilds a large tiled convolution benchmark.
SNN_BUILD_DOCUMENTATIONBOOLONGenerates HTML documentation. Requires Doxygen.
SNN_VISIBILITY_HIDDENBOOLONHides library symbols by default, exporting select functions
SNN_FORCE_COLOUR_DIAGNOSTICSBOOLONForces compilers to output error messages in colour
SNN_HIGH_MEM_JOB_LIMITINT8Number of concurrent build jobs for high memory targets (Ninja only)
SNN_DEVICE_TRIPLELISTspir64Sets the DPC++ device triple(s). Semicolon-separated if multiple flags are passed
SNN_DPCPP_ARCHSTRINGEmptySets the specific device architecture for DPC++ builds
SNN_DPCPP_USER_FLAGSLISTEmptySets the extra compiler flags to pass to DPC++. Semicolon-separated if multiple flags are passed

Download options

OptionTypeDefaultDescription
SNN_DOWNLOAD_BENCHMARKBOOLONDownload and build Google Benchmark, rather than look locally
BENCHMARK_GIT_TAGSTRINGv1.3.0Commit-ish object (e.g. tag, branch, commit hash)
SNN_DOWNLOAD_GTESTBOOLOFFDownload and build Google Test, rather than look locally
GTEST_GIT_TAGSTRINGrelease-1.10.0Commit-ish object (e.g. tag, branch, commit hash)
SNN_DOWNLOAD_EIGENBOOLONDownload Eigen, rather than look locally
EIGEN_REPOSTRINGEigen GitLabThe remote to download Eigen from
EIGEN_GIT_TAGSTRING00de5707Commit-ish object (e.g. tag, branch, commit hash)
EIGEN_INCLUDE_DIRSTRINGbuild/eigenThe Eigen include directory. Can be set by download.
SNN_DOWNLOAD_SYCLBLASBOOLONDownload SYCLBLAS, rather than look locally
sycl_blas_REPOSTRINGCodeplay GitHubThe remote to download SYCLBLAS from
sycl_blas_GIT_TAGSTRINGdd2455cCommit-ish object (e.g. tag, branch, commit hash)
SNN_DOWNLOAD_MISSING_DEPSBOOLONDownloads any -NOTFOUND dependencies

Test options

OptionTypeDefaultDescription
SNN_TEST_EIGENBOOLOFFTest the Eigen backend
SNN_TEST_EIGEN_MATMULSBOOLOFFUse Eigen matmuls to test convolutions (very slow)
SNN_TEST_SYCLBLASBOOLOFFTest the SYCLBLAS backend
SNN_TEST_SYCLBLAS_MATMULSBOOLOFFUse SYCLBLAS matmuls to test convolutions (very slow)

Benchmark options

OptionTypeDefaultDescription
SNN_BENCH_EIGENBOOLOFFBuild benchmarks with Eigen matmul support
SNN_BENCH_SYCLBLASBOOLONBuild benchmarks with SYCLBLAS support
SNN_BENCH_MKLDNNBOOLOFFBuild MKLDNN benchmarks
SNN_BENCH_ARM_COMPUTEBOOLOFFBuild ARM Compute Library benchmarks
SNN_BENCH_SNNBOOLOFFBuild benchmarks with portDNN matmul support

Eigen options

OptionTypeDefaultDescription
SNN_EIGEN_LOCAL_MEMBOOLONOnly compile Eigen kernels with local memory support
SNN_EIGEN_NO_LOCAL_MEMBOOLOFFOnly compile Eigen kernels without local memory support
SNN_EIGEN_COMPRESS_NAMESBOOLOFFTurns kernel names into hashes to avoid OpenCL driver bugs
SNN_EIGEN_NO_BARRIERBOOLOFFUse barrier-free matmul. Implies NO_LOCAL_MEM.

ComputeCpp options

OptionTypeDefaultDescription
ComputeCpp_DIRPATHunsetThe ComputeCpp installation location
ComputeCpp_HOST_DIRPATHunsetCrosscompiling only. ComputeCpp location for host arch.
COMPUTECPP_USER_FLAGSSTRINGunsetFlags to be appended to compute++ command line
COMPUTECPP_BITCODESTRINGspir64Format of bitcode to be emitted by compiler (spirv64, nvptx64 etc.)

Kernel options

OptionTypeDefaultDescription
SNN_ENABLE_DOUBLEBOOLOFFCompiles kernels that operate on double-precision floats
SNN_ENABLE_HALFBOOLOFFCompiles kernels that operate on OpenCL half-precision floats
SNN_ENABLE_64BIT_INDICESBOOLOFFEnable 64-bit index types to allow large (> 2bn element) tensors
SNN_CONV2D_STATIC_KERNELSBOOLOFFEnable compilation of static sizes of direct convolutions
SNN_REGISTER_TILE_SPECIALIZATIONSBOOLOFFSpecialises register tiles to help compiler keep data in registers

Install options

OptionTypeDefaultDescription
CMAKE_INSTALL_PREFIXPATH/usr/localPrefix added in front of all install paths
SNN_INSTALL_TESTSBOOLOFFControls installing tests as part of install target
SNN_INSTALL_BENCHMARKSBOOLOFFControls installing benchmarks as part of install target
SNN_INSTALL_SAMPLESBOOLOFFControls installing samples as part of install target