9prady9 · GitHub

9prady9

@cschreib-ibex

umar456

Forgot to convert the result of std::hash (an int) into a string before appending to "KER".
This prevents data races where two threads or two processes might write to the same file.

umar456

umar456

umar456 previously approved these changes Apr 23, 2020

umar456

9prady9

@cschreib-ibex

9prady9

9prady9 previously approved these changes Apr 24, 2020

@cschreib-ibex

@cschreib-ibex

@cschreib-ibex

@9prady9

@cschreib-ibex

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

Read the original on github.com ↗