Skip to content

Commit e41017f

Browse files
dbortfacebook-github-bot
authored andcommitted
FileDataLoader::From -> ::from for all of //executorch (#382)
Summary: Pull Request resolved: #382 Use the new name throughout the tree. ghstack-source-id: 200971161 exported-using-ghexport Reviewed By: cccclai Differential Revision: D49351746 fbshipit-source-id: d1cc467b1c3bbf9eb33984fbf1cd8ce1a7a76dac
1 parent e2dd0be commit e41017f

12 files changed

+19
-19
lines changed

examples/bundled_executor_runner/bundled_executor_runner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ int main(int argc, char** argv) {
7676
// DataLoaders that use mmap() or point to data that's already in memory, and
7777
// users can create their own DataLoaders to load from arbitrary sources.
7878
const char* model_path = FLAGS_model_path.c_str();
79-
Result<FileDataLoader> loader = FileDataLoader::From(model_path);
79+
Result<FileDataLoader> loader = FileDataLoader::from(model_path);
8080
ET_CHECK_MSG(
81-
loader.ok(), "FileDataLoader::From() failed: 0x%" PRIx32, loader.error());
81+
loader.ok(), "FileDataLoader::from() failed: 0x%" PRIx32, loader.error());
8282

8383
// Read in the entire file.
8484
Result<FreeableBuffer> file_data = loader->Load(0, loader->size().get());

examples/executor_runner/executor_runner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ int main(int argc, char** argv) {
6161
// DataLoaders that use mmap() or point to data that's already in memory, and
6262
// users can create their own DataLoaders to load from arbitrary sources.
6363
const char* model_path = FLAGS_model_path.c_str();
64-
Result<FileDataLoader> loader = FileDataLoader::From(model_path);
64+
Result<FileDataLoader> loader = FileDataLoader::from(model_path);
6565
ET_CHECK_MSG(
66-
loader.ok(), "FileDataLoader::From() failed: 0x%" PRIx32, loader.error());
66+
loader.ok(), "FileDataLoader::from() failed: 0x%" PRIx32, loader.error());
6767

6868
// Parse the program file. This is immutable, and can also be reused between
6969
// multiple execution invocations across multiple threads.

runtime/executor/test/allocation_failure_stress_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class AllocationFailureStressTest : public ::testing::Test {
4141
void SetUp() override {
4242
// Create a loader for the serialized ModuleAdd program.
4343
const char* path = std::getenv("ET_MODULE_ADD_PATH");
44-
Result<FileDataLoader> loader = FileDataLoader::From(path);
44+
Result<FileDataLoader> loader = FileDataLoader::from(path);
4545
ASSERT_EQ(loader.error(), Error::Ok);
4646
loader_ = std::make_unique<FileDataLoader>(std::move(loader.get()));
4747

runtime/executor/test/backend_integration_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ TEST_P(BackendIntegrationTest, BackendIsPresent) {
292292

293293
// Demonstrate that installed StubBackend initializes successfully by default.
294294
TEST_P(BackendIntegrationTest, BasicInitSucceeds) {
295-
Result<FileDataLoader> loader = FileDataLoader::From(program_path());
295+
Result<FileDataLoader> loader = FileDataLoader::from(program_path());
296296
ASSERT_EQ(loader.error(), Error::Ok);
297297

298298
Result<Program> program = Program::load(&loader.get());
@@ -321,7 +321,7 @@ TEST_P(BackendIntegrationTest, FreeingProcessedBufferSucceeds) {
321321

322322
// Wrap the real loader in a spy so we can see which operations were
323323
// performed.
324-
Result<FileDataLoader> loader = FileDataLoader::From(program_path());
324+
Result<FileDataLoader> loader = FileDataLoader::from(program_path());
325325
ASSERT_EQ(loader.error(), Error::Ok);
326326
DataLoaderSpy spy_loader(&loader.get());
327327

@@ -385,7 +385,7 @@ TEST_P(BackendIntegrationTest, EndToEndTestWithProcessedAsHandle) {
385385

386386
// Wrap the real loader in a spy so we can see which operations were
387387
// performed.
388-
Result<FileDataLoader> loader = FileDataLoader::From(program_path());
388+
Result<FileDataLoader> loader = FileDataLoader::from(program_path());
389389
ASSERT_EQ(loader.error(), Error::Ok);
390390
DataLoaderSpy spy_loader(&loader.get());
391391

@@ -530,7 +530,7 @@ TEST_P(DelegateDataAlignmentTest, ExpectedDataAlignment) {
530530

531531
// Create a loader that can satisfy the alignment required by this program.
532532
Result<FileDataLoader> loader =
533-
FileDataLoader::From(program_path(), /*alignment=*/expected_alignment());
533+
FileDataLoader::from(program_path(), /*alignment=*/expected_alignment());
534534
ASSERT_EQ(loader.error(), Error::Ok);
535535

536536
// Wrap the real loader in a spy so we can see which operations were

runtime/executor/test/execution_plan_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ExecutionPlanTest : public ::testing::Test {
3737
void SetUp() override {
3838
// Create a loader for the serialized ModuleAdd program.
3939
const char* path = std::getenv("ET_MODULE_ADD_PATH");
40-
Result<FileDataLoader> loader = FileDataLoader::From(path);
40+
Result<FileDataLoader> loader = FileDataLoader::from(path);
4141
ASSERT_EQ(loader.error(), Error::Ok);
4242
loader_ = std::make_unique<FileDataLoader>(std::move(loader.get()));
4343

runtime/executor/test/kernel_integration_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class KernelIntegrationTest : public ::testing::Test {
138138

139139
// Create a loader for the serialized ModuleAdd program.
140140
const char* path = std::getenv("ET_MODULE_ADD_PATH");
141-
Result<FileDataLoader> loader = FileDataLoader::From(path);
141+
Result<FileDataLoader> loader = FileDataLoader::from(path);
142142
ASSERT_EQ(loader.error(), Error::Ok);
143143
loader_ = std::make_unique<FileDataLoader>(std::move(loader.get()));
144144

runtime/executor/test/kernel_resolution_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class KernelResolutionTest : public ::testing::Test {
5252

5353
// Create a loader for the serialized ModuleAdd program.
5454
const char* path = std::getenv("ET_MODULE_ADD_PATH");
55-
Result<FileDataLoader> loader = FileDataLoader::From(path);
55+
Result<FileDataLoader> loader = FileDataLoader::from(path);
5656
ASSERT_EQ(loader.error(), Error::Ok);
5757
loader_ = std::make_unique<FileDataLoader>(std::move(loader.get()));
5858

runtime/executor/test/method_meta_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MethodMetaTest : public ::testing::Test {
2929
void SetUp() override {
3030
// Create a loader for the serialized ModuleAdd program.
3131
const char* path = std::getenv("ET_MODULE_ADD_PATH");
32-
Result<FileDataLoader> loader = FileDataLoader::From(path);
32+
Result<FileDataLoader> loader = FileDataLoader::from(path);
3333
ASSERT_EQ(loader.error(), Error::Ok);
3434
loader_ = std::make_unique<FileDataLoader>(std::move(loader.get()));
3535

runtime/executor/test/method_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MethodTest : public ::testing::Test {
3535
protected:
3636
void load_program(const char* path, const char* module_name) {
3737
// Create a loader for the serialized program.
38-
Result<FileDataLoader> loader = FileDataLoader::From(path);
38+
Result<FileDataLoader> loader = FileDataLoader::from(path);
3939
ASSERT_EQ(loader.error(), Error::Ok);
4040
loaders_.insert(
4141
{module_name,

runtime/executor/test/program_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ProgramTest : public ::testing::Test {
4444

4545
// Load the serialized ModuleAdd data.
4646
const char* path = std::getenv("ET_MODULE_ADD_PATH");
47-
Result<FileDataLoader> loader = FileDataLoader::From(path);
47+
Result<FileDataLoader> loader = FileDataLoader::from(path);
4848
ASSERT_EQ(loader.error(), Error::Ok);
4949

5050
// This file should always be compatible.
@@ -59,7 +59,7 @@ class ProgramTest : public ::testing::Test {
5959

6060
// Load the serialized ModuleAdd data.
6161
path = std::getenv("ET_MODULE_MULTI_ENTRY_PATH");
62-
Result<FileDataLoader> multi_loader = FileDataLoader::From(path);
62+
Result<FileDataLoader> multi_loader = FileDataLoader::from(path);
6363
ASSERT_EQ(multi_loader.error(), Error::Ok);
6464

6565
// This file should always be compatible.

sdk/runners/executor_runner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class ProgramData {
105105
// Create a DataLoader that wraps the input file. It may be a plain Program,
106106
// or it may be a BundledProgram that contains a Program.
107107
Result<util::FileDataLoader> loader =
108-
util::FileDataLoader::From(filename.c_str());
108+
util::FileDataLoader::from(filename.c_str());
109109
ET_CHECK_MSG(
110110
loader.ok(),
111111
"Could not create loader for file '%s': 0x%x",

test/size_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ int main(int argc, char** argv) {
5252
&runtime_allocator,
5353
&temp_allocator)};
5454

55-
Result<FileDataLoader> loader = FileDataLoader::From(argv[1]);
55+
Result<FileDataLoader> loader = FileDataLoader::from(argv[1]);
5656
ET_CHECK_MSG(
57-
loader.ok(), "FileDataLoader::From() failed: 0x%" PRIx32, loader.error());
57+
loader.ok(), "FileDataLoader::from() failed: 0x%" PRIx32, loader.error());
5858

5959
uint32_t prof_tok = EXECUTORCH_BEGIN_PROF("de-serialize model");
6060
const auto program = Program::load(&loader.get());

0 commit comments

Comments
 (0)