diff --git a/runtime/common/KernelWrapper.h b/runtime/common/KernelWrapper.h index 2e82522d91..12b2fb2df3 100644 --- a/runtime/common/KernelWrapper.h +++ b/runtime/common/KernelWrapper.h @@ -520,9 +520,9 @@ std::invoke_result_t invokeKernel(QuantumKernel &&fn, // Just need to JIT code to get it registered. static_cast(fn).jitCode(); auto serializedArgsBuffer = serializeArgs(std::forward(args)...); - cudaq::get_platform().launchKernel(fn.name(), nullptr, - (void *)serializedArgsBuffer.data(), - serializedArgsBuffer.size(), 0, {}); + [[maybe_unused]] auto result = cudaq::get_platform().launchKernel( + fn.name(), nullptr, (void *)serializedArgsBuffer.data(), + serializedArgsBuffer.size(), 0, {}); } else { // In library mode, to use the remote simulator platform, we need to pack // the argument and delegate to the platform's launchKernel rather than