Skip to content

Commit 9ecd577

Browse files
Nemi26Nemi Verploegh
authored andcommitted
[rocm-libraries] ROCm/rocm-libraries#4082 (commit 669d133)
fix(rocrand): Fix loop unroll warning ## Motivation Clang was complaining about not being able to unroll a loop which had a variable iteration count ## Technical Details Silencing it seems like the right move ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests. Co-authored-by: Nemi Verploegh <[email protected]>
1 parent af0fd22 commit 9ecd577

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

library/src/rng/system.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ struct host_system
126126
std::tuple<UserArgs...> user_args;
127127
};
128128

129+
// At the call site, the loops use a variable number of iterations,
130+
// so Clang isn't able to unroll them and will (wrongfully) complain about it.
131+
#pragma clang diagnostic push
132+
#pragma clang diagnostic ignored "-Wpass-failed"
129133
template<host::target_arch Arch, typename Kernel, size_t... Is, typename... Args>
130134
static void invoke_kernel(dim3 block,
131135
dim3 thread,
@@ -136,6 +140,7 @@ struct host_system
136140
{
137141
Kernel::template generate<Arch>(block, thread, grid_dim, block_dim, std::get<Is>(args)...);
138142
}
143+
#pragma clang diagnostic pop
139144

140145
template<typename Kernel,
141146
typename ConfigProvider

0 commit comments

Comments
 (0)