Skip to content

Commit bcf7d4d

Browse files
[SYCL] kernel_compiler opencl query fix (#13448)
This should have been gotten with #13214 but was accidentally overlooked. Errors discovered by sanitization.
1 parent 363fcef commit bcf7d4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sycl/source/detail/kernel_compiler/kernel_compiler_opencl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ std::string InvokeOclocQuery(uint32_t IPVersion, const char *identifier) {
255255
// Gather the results.
256256
for (uint32_t i = 0; i < NumOutputs; i++) {
257257
if (!strcmp(OutputNames[i], "stdout.log")) {
258-
const char *LogText = reinterpret_cast<const char *>(Outputs[i]);
259-
if (LogText != nullptr && LogText[0] != '\0') {
260-
QueryLog.append(LogText);
258+
if (OutputLengths[i] > 0) {
259+
const char *LogText = reinterpret_cast<const char *>(Outputs[i]);
260+
QueryLog.append(LogText, OutputLengths[i]);
261261
}
262262
}
263263
}

0 commit comments

Comments
 (0)