File tree 9 files changed +116
-194
lines changed 9 files changed +116
-194
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,10 @@ FileDataLoader::~FileDataLoader() {
59
59
// file_name_ can be nullptr if this instance was moved from, but freeing a
60
60
// null pointer is safe.
61
61
std::free (const_cast <char *>(file_name_));
62
- // fd_ can be -1 if this instance was moved from, but closing a negative fd is
63
- // safe (though it will return an error).
64
- #ifdef _WIN32
65
- if (fd_ == -1 )
62
+ // fd_ can be -1 if this instance was moved from.
63
+ if (fd_ == -1 ) {
66
64
return ;
67
- # endif
65
+ }
68
66
::close (fd_);
69
67
}
70
68
Original file line number Diff line number Diff line change @@ -102,6 +102,8 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT)
102
102
103
103
target_link_libraries (custom_ops_aot_lib PUBLIC cpublas torch)
104
104
if (WIN32 )
105
+ # There is no direct replacement for libpthread.so on Windows.
106
+ # For the Windows build, link directly against pthreadpool and cpuinfo.
105
107
target_link_libraries (custom_ops_aot_lib PUBLIC pthreadpool cpuinfo)
106
108
endif ()
107
109
target_compile_options (
Original file line number Diff line number Diff line change
1
+ @ ECHO OFF
2
+
3
+ rem Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ rem All rights reserved.
5
+
6
+ rem This batch file provides a basic functionality similar to the bash script.
7
+
8
+ cd /d " %~dp0 "
9
+
10
+ rem Find the names of the python tools to use (replace with your actual python installation)
11
+ if " %PYTHON_EXECUTABLE% " == " " (
12
+ if " %CONDA_DEFAULT_ENV% " == " " OR " %CONDA_DEFAULT_ENV% " == " base" OR NOT EXIST " python" (
13
+ set PYTHON_EXECUTABLE = python3
14
+ ) else (
15
+ set PYTHON_EXECUTABLE = python
16
+ )
17
+ )
18
+
19
+ " %PYTHON_EXECUTABLE% " install_requirements.py %*
20
+
21
+ exit /b %ERRORLEVEL%
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -83,6 +83,10 @@ def python_is_compatible():
83
83
print (f"Error: Unknown option { arg } " )
84
84
sys .exit (1 )
85
85
86
+ # Use ClangCL on Windows.
87
+ if os .name == "nt" :
88
+ CMAKE_ARGS += " -T ClangCL"
89
+
86
90
# Since ExecuTorch often uses main-branch features of pytorch, only the nightly
87
91
# pip versions will have the required features.
88
92
#
Original file line number Diff line number Diff line change 15
15
#include < cstddef> // size_t
16
16
#include < limits>
17
17
18
- #ifdef _WIN32
19
- #include < stddef.h>
20
- using ssize_t = ptrdiff_t ;
21
- #endif
22
-
23
18
#include < executorch/runtime/core/array_ref.h>
24
19
#include < executorch/runtime/core/error.h>
25
20
#include < executorch/runtime/core/exec_aten/exec_aten.h>
Original file line number Diff line number Diff line change 8
8
9
9
#pragma once
10
10
11
- #ifndef _WIN32
12
- #include < sys/types.h> // TODO(T126923429): Include size_t, ssize_t
13
- #else
14
- #include < stddef.h>
15
- using ssize_t = ptrdiff_t ;
16
- #endif
17
-
18
11
#include < executorch/runtime/core/array_ref.h>
19
12
#include < executorch/runtime/core/error.h>
20
13
#include < executorch/runtime/core/portable_type/scalar_type.h>
Original file line number Diff line number Diff line change 133
133
#endif
134
134
#endif // ifndef
135
135
136
- #ifdef _WIN32
136
+ #ifndef _WIN32
137
+ #include <sys/types.h> // TODO(T126923429): Include size_t, ssize_t
138
+ #else
137
139
#include <stddef.h>
138
140
using ssize_t = ptrdiff_t ;
139
141
#endif
You can’t perform that action at this time.
0 commit comments