xref: /aosp_15_r20/external/executorch/backends/vulkan/runtime/graph/containers/SymInt.cpp (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #include <executorch/backends/vulkan/runtime/graph/containers/SymInt.h>
10 
11 namespace vkcompute {
12 
SymInt(api::Context * context_p,const int32_t val)13 SymInt::SymInt(api::Context* context_p, const int32_t val)
14     : gpu_buffer(context_p, val){};
15 
set(const int32_t val)16 void SymInt::set(const int32_t val) {
17   gpu_buffer.update(val);
18 }
19 
get()20 int32_t SymInt::get() {
21   return gpu_buffer.read<int32_t>();
22 }
23 
operator =(const int32_t val)24 void SymInt::operator=(const int32_t val) {
25   gpu_buffer.update(val);
26 }
27 
28 } // namespace vkcompute
29