From 4109276fb46ad36c320ebb738eadb4ab2ecc4763 Mon Sep 17 00:00:00 2001 From: yijiagu Date: Tue, 20 Dec 2022 19:00:26 -0800 Subject: [PATCH] Replace void* with std::byte* in AsyncRuntime Replace void* with std::byte* in AsyncRuntime to make it clear that these pointers point to a memory region. Reviewed By: ezhulenev Differential Revision: https://reviews.llvm.org/D140428 --- mlir/include/mlir/ExecutionEngine/AsyncRuntime.h | 3 ++- mlir/lib/ExecutionEngine/AsyncRuntime.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mlir/include/mlir/ExecutionEngine/AsyncRuntime.h b/mlir/include/mlir/ExecutionEngine/AsyncRuntime.h index ba59c39..3f65ec4 100644 --- a/mlir/include/mlir/ExecutionEngine/AsyncRuntime.h +++ b/mlir/include/mlir/ExecutionEngine/AsyncRuntime.h @@ -14,6 +14,7 @@ #ifndef MLIR_EXECUTIONENGINE_ASYNCRUNTIME_H_ #define MLIR_EXECUTIONENGINE_ASYNCRUNTIME_H_ +#include #include #ifdef mlir_async_runtime_EXPORTS @@ -38,7 +39,7 @@ using AsyncGroup = struct AsyncGroup; using AsyncValue = struct AsyncValue; // Async value payload stored in a memory owned by the async.value. -using ValueStorage = void *; +using ValueStorage = std::byte *; // Async runtime uses LLVM coroutines to represent asynchronous tasks. Task // function is a coroutine handle and a resume function that continue coroutine diff --git a/mlir/lib/ExecutionEngine/AsyncRuntime.cpp b/mlir/lib/ExecutionEngine/AsyncRuntime.cpp index 42ec1ce..00cd27b 100644 --- a/mlir/lib/ExecutionEngine/AsyncRuntime.cpp +++ b/mlir/lib/ExecutionEngine/AsyncRuntime.cpp @@ -199,7 +199,7 @@ struct AsyncValue : public RefCounted { std::atomic state; // Use vector of bytes to store async value payload. - std::vector storage; + std::vector storage; // Pending awaiters are guarded by a mutex. std::mutex mu; -- 2.7.4