Skip to content

Commit

Permalink
Fix local work size first value being uninitialized when not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
Bensuo committed Feb 12, 2024
1 parent ba1006d commit 808ca66
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/adapters/cuda/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ ur_exp_command_buffer_command_handle_t_::
// Local work size may be nullptr
if (LocalWorkSizePtr) {
std::memcpy(LocalWorkSize, LocalWorkSizePtr, CopySize);
} else {
std::memset(LocalWorkSize, 0, sizeof(size_t) * 3);
}

if (WorkDim < 3) {
const size_t ZeroSize = sizeof(size_t) * (3 - WorkDim);
std::memset(GlobalWorkOffset + WorkDim, 0, ZeroSize);
std::memset(GlobalWorkSize + WorkDim, 0, ZeroSize);
std::memset(LocalWorkSize + WorkDim, 0, ZeroSize);
}
}

Expand Down

0 comments on commit 808ca66

Please sign in to comment.