Skip to content

Commit

Permalink
Make the cast more robust to sneak it past -Werror.
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Schweitz <[email protected]>
  • Loading branch information
schweitzpgi committed Oct 14, 2024
1 parent d27da6d commit 5ecdd15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion runtime/common/ThunkInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ using KernelDegenerateType = void (*)(void *);
/// In some cases, the launcher will bypass the thunk function and call a
/// degenerate stub. That means that the extra `bool` argument will be ignored
/// by the called kernel and the kernel will not return a dynamic result.
///
/// This is a terrible idea, generally speaking. However, if the launcher
/// neither looks for nor attempts to use the second `bool` argument at all, and
/// the launcher will drop any results returned from the kernel (regardless of
/// type) on the floor anyway, then one may be able to get away with using a
/// degenerate kernel type.
inline KernelDegenerateType
make_degenerate_kernel_type(KernelThunkType func_type) {
return reinterpret_cast<KernelDegenerateType>(func_type);
return reinterpret_cast<KernelDegenerateType>(
reinterpret_cast<void *>(func_type));
}

} // namespace cudaq

0 comments on commit 5ecdd15

Please sign in to comment.