Skip to content

Commit 54e0fdb

Browse files
committed
Update base for Update on "[3/N] Add get_option/set_option function in backend interface"
Add update function in backend interface class. The update function will receive the backend options from dispatched by the ET runtime. ET runtime's logic: loop over each backend and it's corresponding backend options, dispatch the backend options to the corresponding backend Next step, will add update API in the method and then module exported-using-ghexport Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242/) Differential Revision: [D75919242](https://our.internmc.facebook.com/intern/diff/D75919242) [ghstack-poisoned]
1 parent b4bb793 commit 54e0fdb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/backend/options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using OptionValue =
2929
struct BackendOption {
3030
// key is the name of the backend option, like num_threads, enable_profiling,
3131
// etc
32-
char key[kMaxOptionKeyLength];
32+
char key[kMaxOptionKeyLength]{};
3333
// value is the value of the backend option, like 4, true, etc
3434
OptionValue value;
3535
};
@@ -129,7 +129,7 @@ class BackendOptions {
129129
Error set_option(const char (&key)[N], const char* value) noexcept {
130130
static_assert(N <= kMaxOptionKeyLength, "Option key is too long");
131131
// Create a fixed-size array and copy the string
132-
std::array<char, kMaxOptionValueLength> arr;
132+
std::array<char, kMaxOptionValueLength> arr{};
133133
strncpy(arr.data(), value, kMaxOptionValueLength - 1);
134134
arr[kMaxOptionValueLength - 1] = '\0'; // Ensure null termination
135135
return set_option_impl(key, arr);

0 commit comments

Comments
 (0)