Skip to content

Commit a7f83d4

Browse files
committed
fix shadow ret
1 parent b21284b commit a7f83d4

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

superbench/benchmarks/micro_benchmarks/gpu_stream/gpu_stream.cu

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,17 @@ int GpuStream::RunStream(std::unique_ptr<BenchArgs<T>> &args, const std::string
607607
// run the stream benchmark over the stream kernels
608608
for (int i = 0; i < static_cast<int>(Kernel::kCount); ++i) {
609609
Kernel kernel = static_cast<Kernel>(i);
610-
int ret = RunStreamKernel<T>(args, kernel, num_threads_in_block);
611-
if (ret == 0 && args->check_data) {
612-
// Compare buffer based on the kernel
610+
ret = RunStreamKernel<T>(args, kernel, num_threads_in_block);
611+
if (ret != 0) {
612+
Destroy(args);
613+
return ret;
614+
}
615+
if (args->check_data) {
613616
ret = CheckBuf(args, i);
617+
if (ret != 0) {
618+
Destroy(args);
619+
return ret;
620+
}
614621
}
615622
}
616623
}

0 commit comments

Comments
 (0)