-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added clear_persistent_cache and minor update to persistent caching #440
base: master
Are you sure you want to change the base?
Conversation
// Path delimiter symbol for the current OS. | ||
static const std::string delim = boost::filesystem::path("/").make_preferred().string(); | ||
|
||
// Path to appdata folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of copying these lines, could you just call detail::appdata_path()
directly?
Also, could you open a pull request against the |
@@ -82,6 +82,25 @@ class program_cache : boost::noncopyable | |||
m_cache.clear(); | |||
} | |||
|
|||
/// Clears persistent cache by deleting the boost_compute folder | |||
void clear_persistent_cache() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be a static method (so users can just call program_cache::clear_persistent_cache()
directly without having to get/create a program_cache
object).
Regarding @keryell's note: one possible solution is to make detail::sha1 hash;
hash(source);
hash(device_name);
hash(compiler_version);
load_program_binary(hash, context); |
Yes you are right, since boost/uuid/sha1.hpp has already the right interface. So there is no need to have a Merkle's tree approach that would create several sha1 intermediate objects. |
Added
clear_persistent_cache()
inprogram_cache.hpp
which removes.boost_compute
directory.Minor update to persistent caching: instead of computing sha1 hash of just program source, I've also added compiler options and selected device's name so if anything changes, program would be built again.