OCL: add cache for OpenCL compiled programs#10018
OCL: add cache for OpenCL compiled programs#10018opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
| namespace cv { namespace utils { namespace fs { | ||
|
|
||
|
|
||
| CV_EXPORTS bool isExist(const cv::String& path); |
There was a problem hiding this comment.
it's wrong grammar. I suggest doesExist(), isValidPath(), pathExist(), isFileOrDirectory() etc.
There was a problem hiding this comment.
Changed to exists(): http://en.cppreference.com/w/cpp/filesystem/exists
|
|
||
| struct Impl; | ||
| inline Impl* getImpl() const { return (Impl*)p; } | ||
| //protected: |
There was a problem hiding this comment.
why Impl* p is not protected anymore if we have getImpl()?
There was a problem hiding this comment.
Because "p" is not protected initially. It is "TODO" mark for future releases.
Accurate testing of libva / directx / opengl integrations is required before apply this.
| * @param configuration_name optional name of configuration parameter name which overrides default behavior. | ||
| * @return Path to cache directory. Returns empty string if cache directories support is not available. Returns "disabled" if cache disabled by user. | ||
| */ | ||
| CV_EXPORTS cv::String getOpenCVCacheDirectory(const char* sub_directory_name, const char* configuration_name = NULL); |
There was a problem hiding this comment.
should we use getOCLCacheDirectory or getOpenCLCacheDirectory name? I think, using OpenCV word in OpenCV function name is unnecessary
There was a problem hiding this comment.
This function is designed not for OpenCL programs cache only, it can be reused in multiple places (ocl4dnn tuning results cache, probably DL MO cache, etc).
Thanks, renamed to getCacheDirectory (without OpenCV, because we already in cv namespace).
| void lock(); //< acquire exclusive (writer) lock | ||
| void unlock(); //< release exclusive (writer) lock | ||
|
|
||
| void lock_sharable(); //< acquire sharable (reader) lock |
There was a problem hiding this comment.
We are trying to use mixed case names for methods everywhere in OpenCV. Can we do it here as well?
|
|
||
| explicit inline optional_lock_guard(Mutex* m) : mutex_(m) { if (mutex_) mutex_->lock(); } | ||
|
|
||
| inline ~optional_lock_guard() { if (mutex_) mutex_->unlock(); } |
There was a problem hiding this comment.
can we use mixed case name for the class?
There was a problem hiding this comment.
This is not OpenCV specific name and not a part of external public API.
Name is selected to be consistent with declarations above: lock_guard, shared_lock_guard (both have alternative implementation in modern C++ / boost library under the same names).
File is renamed to "lock.private.hpp".
|
👍 |
Default cache locations is under:
/home/<user>/.cache/opencv/(in general)C:\Users\<user>\AppData\Local\Temp\opencv\$TMPDIR/opencv/Verified on these configuraions: