Skip to content

Commit 16fb744

Browse files
committed
ocl: fix program cache key
1 parent 230f22b commit 16fb744

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

modules/core/src/ocl.cpp

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,6 @@ static uint64 crc64( const uchar* data, size_t size, uint64 crc0=0 )
174174
return ~crc;
175175
}
176176

177-
struct HashKey
178-
{
179-
typedef uint64 part;
180-
HashKey(part _a, part _b) : a(_a), b(_b) {}
181-
part a, b;
182-
};
183-
184-
inline bool operator == (const HashKey& h1, const HashKey& h2)
185-
{
186-
return h1.a == h2.a && h1.b == h2.b;
187-
}
188-
189-
inline bool operator < (const HashKey& h1, const HashKey& h2)
190-
{
191-
return h1.a < h2.a || (h1.a == h2.a && h1.b < h2.b);
192-
}
193-
194-
195177
bool haveOpenCL()
196178
{
197179
#ifdef HAVE_OPENCL
@@ -1351,7 +1333,7 @@ struct Context::Impl
13511333
const String& buildflags, String& errmsg)
13521334
{
13531335
size_t limit = getProgramCountLimit();
1354-
String key = Program::getPrefix(buildflags);
1336+
String key = cv::format("codehash=%08llx ", src.hash()) + Program::getPrefix(buildflags);
13551337
{
13561338
cv::AutoLock lock(program_cache_mutex);
13571339
phash_t::iterator it = phash.find(key);

0 commit comments

Comments
 (0)