Skip to content

Commit 2e5af85

Browse files
committed
GPU: Add ignoreCacheValid debug option
1 parent 8b9fa3d commit 2e5af85

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +93,28 @@ int GPUReconstructionCUDA::genRTC(std::string& filename, unsigned int& nCompile)
9393
if (fread(sharead, 1, 20, fp) != 20) {
9494
throw std::runtime_error("Cache file corrupt");
9595
}
96-
if (memcmp(sharead, shasource, 20)) {
96+
if (!mProcessingSettings.rtc.ignoreCacheValid && memcmp(sharead, shasource, 20)) {
9797
GPUInfo("Cache file content outdated (source)");
9898
break;
9999
}
100100
if (fread(sharead, 1, 20, fp) != 20) {
101101
throw std::runtime_error("Cache file corrupt");
102102
}
103-
if (memcmp(sharead, shaparam, 20)) {
103+
if (!mProcessingSettings.rtc.ignoreCacheValid && memcmp(sharead, shaparam, 20)) {
104104
GPUInfo("Cache file content outdated (param)");
105105
break;
106106
}
107107
if (fread(sharead, 1, 20, fp) != 20) {
108108
throw std::runtime_error("Cache file corrupt");
109109
}
110-
if (memcmp(sharead, shacmd, 20)) {
110+
if (!mProcessingSettings.rtc.ignoreCacheValid && memcmp(sharead, shacmd, 20)) {
111111
GPUInfo("Cache file content outdated (commandline)");
112112
break;
113113
}
114114
if (fread(sharead, 1, 20, fp) != 20) {
115115
throw std::runtime_error("Cache file corrupt");
116116
}
117-
if (memcmp(sharead, shakernels, 20)) {
117+
if (!mProcessingSettings.rtc.ignoreCacheValid && memcmp(sharead, shakernels, 20)) {
118118
GPUInfo("Cache file content outdated (kernel definitions)");
119119
break;
120120
}
@@ -123,7 +123,7 @@ int GPUReconstructionCUDA::genRTC(std::string& filename, unsigned int& nCompile)
123123
if (fread(&cachedSettings, sizeof(cachedSettings), 1, fp) != 1) {
124124
throw std::runtime_error("Cache file corrupt");
125125
}
126-
if (memcmp(&cachedSettings, &mProcessingSettings.rtc, sizeof(cachedSettings))) {
126+
if (!mProcessingSettings.rtc.ignoreCacheValid && memcmp(&cachedSettings, &mProcessingSettings.rtc, sizeof(cachedSettings))) {
127127
GPUInfo("Cache file content outdated (rtc parameters)");
128128
break;
129129
}

GPU/GPUTracking/Definitions/GPUSettingsList.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ AddOption(compilePerKernel, bool, true, "", 0, "Run one RTC compilation per kern
200200
AddOption(enable, bool, false, "", 0, "Use RTC to optimize GPU code")
201201
AddOption(runTest, int, 0, "", 0, "Do not run the actual benchmark, but just test RTC compilation (1 full test, 2 test only compilation)")
202202
AddOption(cacheMutex, bool, true, "", 0, "Use a file lock to serialize access to the cache folder")
203+
AddOption(ignoreCacheValid, bool, false, "", 0, "If set, allows to use RTC cached code files even if they are not valid for the current source code / parameters")
203204
AddHelp("help", 'h')
204205
EndConfig()
205206

0 commit comments

Comments
 (0)