Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enqueueWriteBuffer: Initialize host buffer to obtain accurate measure…
…ment When a host buffer is passed as a source into enqueueWriteBuffer(), a memcpy() is used by OpenCL. memcpy() is optimized to copy zero pages. Newly allocated memory points to zero pages, and when the memory is written to, physical memory is allocated. Therefore, initialize host buffer to obtain accurate measurements with enqueueWriteBuffer(). Results on Intel hardware: Before: Platform: Intel(R) OpenCL HD Graphics Device: Intel(R) Gen9 HD Graphics NEO Driver version : 19.03.0 (Linux x64) Compute units : 48 Clock frequency : 1200 MHz Transfer bandwidth (GBPS) enqueueWriteBuffer : 34.18 enqueueReadBuffer : 13.02 enqueueMapBuffer(for read) : 14316530.00 memcpy from mapped ptr : 13.01 enqueueUnmap(after write) : inf memcpy to mapped ptr : 13.37 After: Platform: Intel(R) OpenCL HD Graphics Device: Intel(R) Gen9 HD Graphics NEO Driver version : 19.03.0 (Linux x64) Compute units : 48 Clock frequency : 1200 MHz Transfer bandwidth (GBPS) enqueueWriteBuffer : 13.44 enqueueReadBuffer : 12.91 enqueueMapBuffer(for read) : 21474796.00 memcpy from mapped ptr : 12.91 enqueueUnmap(after write) : inf memcpy to mapped ptr : 13.44
- Loading branch information