Do not create a kernel cache file if build failed. Also disregard any

existing cache files with size of zero. Should close #164.
pull/168/head
magnum 8 years ago
parent 9ec2c86cd0
commit f5d6f9b6d4

@ -13547,7 +13547,7 @@ int main (int argc, char **argv)
struct stat cst;
if (stat (cached_file, &cst) == -1)
if ((stat (cached_file, &cst) == -1) || cst.st_size == 0)
{
cached = 0;
}

@ -8671,6 +8671,8 @@ void load_kernel (const char *kernel_file, int num_devices, size_t *kernel_lengt
}
void writeProgramBin (char *dst, u8 *binary, size_t binary_size)
{
if (binary_size > 0)
{
FILE *fp = fopen (dst, "wb");
@ -8679,6 +8681,7 @@ void writeProgramBin (char *dst, u8 *binary, size_t binary_size)
fflush (fp);
fclose (fp);
}
}
/**
* restore

Loading…
Cancel
Save