File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,4 @@ def preprocess(
4343 shell = True ,
4444 )
4545
46- # with open(so_path, "rb") as f:
47- # data = f.read()
48-
4946 return PreprocessResult (so_path .encode ("utf-8" ))
Original file line number Diff line number Diff line change @@ -427,21 +427,6 @@ class AOTIBackend final : public ::executorch::runtime::BackendInterface {
427427 FreeableBuffer* processed, // This will be the buffer from aoti_backend
428428 ArrayRef<CompileSpec> compile_specs // This will be my empty list
429429 ) const override {
430- // We could load the .so content directly. But I don't want to deal with
431- // relocation. So dumping a file and using dlopen
432-
433- // // Create a temporary file
434- // std::ofstream outfile("/tmp/test.so", std::ios::binary);
435-
436- // // Write the ELF buffer to the temporary file
437- // outfile.write((char*)processed->data(), sizeof(void*) * processed->size());
438-
439- // // Finish writing the file to disk
440- // outfile.close();
441-
442- // // Free the in-memory buffer
443- // processed->Free();
444-
445430 const char * so_path = static_cast <const char *>(processed->data ());
446431
447432 printf (" so path: %s\n " , so_path);
@@ -453,6 +438,8 @@ class AOTIBackend final : public ::executorch::runtime::BackendInterface {
453438 return Error::AccessFailed;
454439 }
455440
441+ processed->Free ();
442+
456443 AOTInductorModelContainerCreateWithDevice =
457444 reinterpret_cast <AOTInductorModelContainerCreateWithDeviceFunc>(
458445 dlsym (so_handle, " AOTInductorModelContainerCreateWithDevice" ));
You can’t perform that action at this time.
0 commit comments