pocl_cache.c: add SPIR-V spec constants and program binary type to hash
@@ -386,6 +386,10 @@ build_program_compute_hash (cl_program program, unsigned device_i,
pocl_SHA1_Update(&hash_ctx, (uint8_t*) program->compiler_options,
strlen(program->compiler_options));
+ pocl_SHA1_Update (&hash_ctx,
+ (uint8_t *)&program->binary_type,
+ sizeof(cl_program_binary_type));
+
#ifdef ENABLE_LLVM
/* The kernel compiler work-group function method affects the
produced binary heavily. */
@@ -399,6 +403,21 @@ build_program_compute_hash (cl_program program, unsigned device_i,
}
#endif
+#ifdef ENABLE_SPIR
+ for (size_t i = 0; i < program->num_spec_consts; ++i)
+ {
+ if (program->spec_const_is_set[i])
+ {
+ pocl_SHA1_Update (&hash_ctx,
+ (uint8_t *)&program->spec_const_ids[i],
+ sizeof (cl_uint));
+ pocl_SHA1_Update (&hash_ctx,
+ (uint8_t *)&program->spec_const_values[i],
+ program->spec_const_sizes[i]);
+ }
+ }
+#endif
+
/*devices may include their own information to hash */
if (device->ops->build_hash)
{
