umar456 previously approved these changes Apr 23, 2020
9prady9 previously approved these changes Apr 24, 2020
umar456 pushed a commit to umar456/arrayfire that referenced this pull request
Jun 27, 2020…ayfire#2848) * Adds CMake variable AF_CACHE_KERNELS_TO_DISK to enable kernel caching. It is turned ON by default. * cuda::buildKernel() now dumps cubin to disk for reuse * Adds cuda::loadKernel() for loading cached cubin files * cuda::loadKernel() returns empty kernel on failure * Uses XDG_CACHE_HOME as cache directory for Linux * Adds common::deterministicHash() - This uses the FNV-1a hashing algorithm for fast and reproducible hashing of string or binary data. This is meant to replace the use of std::hash in some place, since std::hash does not guarantee its return value will be the same in subsequence executions of the program. * Write cached kernel to temporary file before moving into final file. This prevents data races where two threads or two processes might write to the same file. * Uses deterministicHash() for hashing kernel names and kernel binary data. * Adds kernel binary data file integrity check upon loading from disk
Merged
2 tasks
9prady9 pushed a commit that referenced this pull request
Jun 27, 2020* Adds CMake variable AF_CACHE_KERNELS_TO_DISK to enable kernel caching. It is turned ON by default. * cuda::buildKernel() now dumps cubin to disk for reuse * Adds cuda::loadKernel() for loading cached cubin files * cuda::loadKernel() returns empty kernel on failure * Uses XDG_CACHE_HOME as cache directory for Linux * Adds common::deterministicHash() - This uses the FNV-1a hashing algorithm for fast and reproducible hashing of string or binary data. This is meant to replace the use of std::hash in some place, since std::hash does not guarantee its return value will be the same in subsequence executions of the program. * Write cached kernel to temporary file before moving into final file. This prevents data races where two threads or two processes might write to the same file. * Uses deterministicHash() for hashing kernel names and kernel binary data. * Adds kernel binary data file integrity check upon loading from disk