Remove program cache entry?

35 views
Skip to first unread message

Samir Kharchi

unread,
Aug 11, 2016, 4:44:18 AM8/11/16
to boost-compute
Hi,

I am using the program cache which works just fine but I wonder if there is a way to remove a previously added program from the cache (without removing all others existing in that same cache instance)?
All I could find was a call to clear the whole cache.

Cheers
Sam

Jakub Szuppe

unread,
Aug 11, 2016, 5:11:18 AM8/11/16
to boost-compute
Maybe it's not possible, but first: why do you need to clear cache only for a previously added OpenCL program? 

Samir Kharchi

unread,
Aug 11, 2016, 5:35:10 AM8/11/16
to boost-compute
I need individual control over which program in the cache is cleared as it shall be user input driven.
And I don't want to create a cache instance for each program (wanna keep code complexity to a minimum), so it would be very useful to have such a member function in the program cache (and lru_cache for that matter).

Jakub Szuppe

unread,
Aug 11, 2016, 5:51:21 AM8/11/16
to boost-compute
I get it that you need individual control over which program in the program_cache is cleared, I am asking you why you
need it, because normally the cache does not need to be cleared.

If it is because you make changes to the code you just need to use sha1 function to generate cache key

Currently lru_cache that is used for online caching (program_cache) does not have method for removing a previously 
added program (or removing by cache_key). 

Samir Kharchi

unread,
Aug 11, 2016, 7:51:30 AM8/11/16
to boost-compute
Ah I see. That's even better! Thanks. Yes, it's about code changes.

Samir Kharchi

unread,
Aug 11, 2016, 7:56:11 AM8/11/16
to boost-compute
Oh, one question: this mean that if e.g. the kernel code changes this will result in another (additional) cache entry right?

Jakub Szuppe

unread,
Aug 11, 2016, 8:19:53 AM8/11/16
to boost-compute
Yes, this will be additional entry, but I don't think that's a problem, is it? 

Samir Kharchi

unread,
Aug 11, 2016, 2:22:21 PM8/11/16
to boost-compute
Nope, no prob. Just wanted to be sure I know what's happening there. Cheers

Jakub Szuppe

unread,
Aug 11, 2016, 2:25:40 PM8/11/16
to boost-compute
Ok,I'm glad I could help.
Reply all
Reply to author
Forward
0 new messages