-
Notifications
You must be signed in to change notification settings - Fork 725
Windows x64 Build with support for xnnpack and llama example #6979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
33c9f75
555246a
77d1428
c8beaf3
eaeb483
6c9bc9e
0a56ebc
14324cd
d58c11a
d232bff
d59096a
5d10dfa
ecb0042
19033e2
d46f329
8e2b8bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,27 @@ foreach(fbs_file ${_xnnpack_schema__srcs}) | |
| endforeach() | ||
|
|
||
| # Generate the headers from the .fbs files. | ||
|
|
||
| if(WIN32) | ||
| set(MOVE_COMMAND move) | ||
| else() | ||
| set(MOVE_COMMAND mv) | ||
| endif() | ||
|
|
||
|
|
||
| if (WIN32) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this looks fine to me, i'm assuming this has to be done for every flatbuffer outputted header file
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! As suggested, we will split into smaller PRs (#7217), and apply these "platform-dependent shell command" changes everywhere in a later PR |
||
| add_custom_command( | ||
| OUTPUT ${_xnnpack_schema__outputs} | ||
| COMMAND | ||
| ${FLATC_EXECUTABLE} --cpp --cpp-std c++11 --scoped-enums -o | ||
| "${_xnnpack_schema__include_dir}/executorch/backends/xnnpack/serialization" | ||
| ${_xnnpack_schema__srcs} | ||
| COMMAND powershell -Command "Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}" | ||
| WORKING_DIRECTORY ${EXECUTORCH_ROOT} | ||
| COMMENT "Generating xnnpack_schema headers" | ||
| VERBATIM | ||
| ) | ||
| else() | ||
| add_custom_command( | ||
| OUTPUT ${_xnnpack_schema__outputs} | ||
| COMMAND | ||
|
|
@@ -84,6 +105,7 @@ add_custom_command( | |
| COMMENT "Generating xnnpack_schema headers" | ||
| VERBATIM | ||
| ) | ||
| endif() | ||
|
|
||
| add_library(xnnpack_schema INTERFACE ${_xnnpack_schema__outputs}) | ||
| set_target_properties(xnnpack_schema PROPERTIES LINKER_LANGUAGE CXX) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * All rights reserved. | ||
| * | ||
| * This source code is licensed under the BSD-style license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| */ | ||
|
|
||
| // This file ensures that mman.h compatible functions are defined in the global | ||
| // namespace for windows and posix environments. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <executorch/runtime/platform/compiler.h> | ||
|
|
||
| #ifndef _WIN32 | ||
|
|
||
| #include <sys/mman.h> | ||
| #include <unistd.h> | ||
|
|
||
| ET_INLINE long get_os_page_size(){return sysconf(_SC_PAGESIZE);} | ||
|
|
||
| #else | ||
|
|
||
| #define NOMINMAX | ||
| #include <windows.h> | ||
| #undef NOMINMAX | ||
| #include <io.h> | ||
|
|
||
| #include <executorch/extension/data_loader/mman_windows.h> | ||
|
|
||
| ET_INLINE long get_os_page_size() { | ||
| SYSTEM_INFO si; | ||
| GetSystemInfo(&si); | ||
| long pagesize = si.dwAllocationGranularity > si.dwPageSize | ||
| ? si.dwAllocationGranularity | ||
| : si.dwPageSize; | ||
| return pagesize; | ||
| } | ||
|
|
||
| #endif |
Uh oh!
There was an error while loading. Please reload this page.