Skip to content

Commit

Permalink
[pytorch] Enable memory map file support for Android, Apple, and CXX (#…
Browse files Browse the repository at this point in the history
…88545)

Summary: See title.  Left Windows out so it still compiles.

Test Plan:
Add a `#fail` below [this line](https://fburl.com/code/p0mlhlw4) and build for various platforms and confirm it fails which proves the `#ifdef` was hit.

```
buck2 build xplat/langtech/tuna/cli:tuclixAndroid
buck2 build xplat/langtech/tuna/cli:tuclix
```

CI/CD for the rest.

Differential Revision: D41054824

Pull Request resolved: #88545
Approved by: https://github.com/qihqi
  • Loading branch information
Rittzz authored and pytorchmergebot committed Nov 11, 2022
1 parent 8441443 commit f9221bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions c2_defs.bzl
Expand Up @@ -166,6 +166,7 @@ def get_c2_fbandroid_xplat_compiler_flags():
# T95767731 -- remove this once all builds are on at least llvm-13
"-Wno-unknown-warning-option",
"-Wno-unused-but-set-variable",
"-DHAVE_MMAP",
]

if get_c2_strip_glog():
Expand Down Expand Up @@ -392,6 +393,7 @@ def c2_cxx_library(**kwargs):
args = get_c2_default_cxx_args()
args.update(kwargs)
args.setdefault("platforms", (ANDROID, APPLE, CXX, WINDOWS))

fb_xplat_cxx_library(
labels = [
"supermodule:android/default/caffe2",
Expand Down

0 comments on commit f9221bf

Please sign in to comment.