Skip to content

Commit 2a1cad2

Browse files
committed
Update
[ghstack-poisoned]
1 parent 556a1a2 commit 2a1cad2

File tree

27 files changed

+45
-22
lines changed

27 files changed

+45
-22
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ if(NOT "${_repo_dir_name}" STREQUAL "executorch")
373373
"fix for this restriction."
374374
)
375375
endif()
376-
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/runtime/core/portable_type)
376+
set(_common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/runtime/core/portable_type/c10)
377377

378378
#
379379
# The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}.

backends/apple/coreml/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ target_include_directories(
134134
coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util
135135
)
136136
target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..)
137-
target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/runtime/core/portable_type)
137+
target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
138138
target_compile_definitions(coremldelegate PRIVATE C10_USING_CUSTOM_GENERATED_MACROS)
139139
target_link_libraries(coremldelegate PRIVATE executorch_core)
140140

backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@
922922
"$(SRCROOT)/../kvstore",
923923
"$(SRCROOT)/../inmemoryfs",
924924
"$(SRCROOT)/../include",
925-
"$(SRCROOT)/../include/executorch/runtime/core/portable_type",
925+
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
926926
"$(SRCROOT)/../sdk",
927927
"$(SRCROOT)/../util",
928928
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",
@@ -954,7 +954,7 @@
954954
"$(SRCROOT)/../kvstore",
955955
"$(SRCROOT)/../inmemoryfs",
956956
"$(SRCROOT)/../include",
957-
"$(SRCROOT)/../include/executorch/runtime/core/portable_type",
957+
"$(SRCROOT)/../include/executorch/runtime/core/portable_type/c10",
958958
"$(SRCROOT)/../sdk",
959959
"$(SRCROOT)/../util",
960960
"$(SRCROOT)/../../third-party/nlohmann_json/single_include",

backends/arm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ endif()
1414

1515
include(${EXECUTORCH_ROOT}/build/Utils.cmake)
1616

17-
set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type)
17+
set(_common_include_directories ${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10)
1818
add_compile_definitions(C10_USING_CUSTOM_GENERATED_MACROS)
1919

2020
# Third-party folder and Ethos-U driver inclued

backends/qualcomm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ endif()
7474
include_directories(
7575
BEFORE ${_common_include_directories} ${QNN_SDK_ROOT}/include/QNN
7676
${EXECUTORCH_SOURCE_DIR}/third-party/flatbuffers/include
77-
${EXECUTORCH_SOURCE_DIR}/runtime/core/portable_type
77+
${EXECUTORCH_SOURCE_DIR}/runtime/core/portable_type/c10
7878
)
7979

8080
set(_qnn_schema__srcs

build/build_apple_frameworks.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ check_command "$BUCK2"
207207
# So, just patch our generated framework to do that.
208208
sed -i '' '1i\
209209
#define C10_USING_CUSTOM_GENERATED_MACROS
210-
' $HEADERS_PATH/executorch/runtime/core/portable_type/c10/macros/Macros.h
210+
' $HEADERS_PATH/executorch/runtime/core/portable_type/c10/c10/macros/Macros.h
211211
sed -i '' '1i\
212212
#define C10_USING_CUSTOM_GENERATED_MACROS
213-
' $HEADERS_PATH/executorch/runtime/core/portable_type/c10/macros/Export.h
214-
cp -r $HEADERS_PATH/executorch/runtime/core/portable_type/c10 "$HEADERS_PATH/"
213+
' $HEADERS_PATH/executorch/runtime/core/portable_type/c10/c10/macros/Export.h
214+
cp -r $HEADERS_PATH/executorch/runtime/core/portable_type/c10/c10 "$HEADERS_PATH/"
215215

216216

217217
cp "$SOURCE_ROOT_DIR/extension/apple/ExecuTorch/Exported/"*.h "$HEADERS_PATH/executorch"

build/executorch-config.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cmake_minimum_required(VERSION 3.19)
2929
set(_root "${CMAKE_CURRENT_LIST_DIR}/../../..")
3030
set(required_lib_list executorch executorch_core portable_kernels)
3131
set(EXECUTORCH_LIBRARIES)
32-
set(EXECUTORCH_INCLUDE_DIRS ${_root}/include ${_root}/include/executorch/runtime/core/portable_type ${_root}/lib)
32+
set(EXECUTORCH_INCLUDE_DIRS ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
3333
foreach(lib ${required_lib_list})
3434
set(lib_var "LIB_${lib}")
3535
add_library(${lib} STATIC IMPORTED)
@@ -40,7 +40,7 @@ foreach(lib ${required_lib_list})
4040
)
4141
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var}}")
4242
target_compile_definitions(${lib} INTERFACE C10_USING_CUSTOM_GENERATED_MACROS)
43-
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type ${_root}/lib)
43+
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
4444
list(APPEND EXECUTORCH_LIBRARIES ${lib})
4545
endforeach()
4646

@@ -110,7 +110,7 @@ foreach(lib ${lib_list})
110110
add_library(${lib} STATIC IMPORTED)
111111
endif()
112112
set_target_properties(${lib} PROPERTIES IMPORTED_LOCATION "${${lib_var}}")
113-
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type ${_root}/lib)
113+
target_include_directories(${lib} INTERFACE ${_root}/include ${_root}/include/executorch/runtime/core/portable_type/c10 ${_root}/lib)
114114
list(APPEND EXECUTORCH_LIBRARIES ${lib})
115115
endif()
116116
endforeach()

examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298
ENABLE_HARDENED_RUNTIME = YES;
299299
HEADER_SEARCH_PATHS = (
300300
"$(SRCROOT)/include",
301-
"$(SRCROOT)/include/executorch/runtime/core/portable_type",
301+
"$(SRCROOT)/include/executorch/runtime/core/portable_type/c10",
302302
);
303303
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
304304
LIBRARY_SEARCH_PATHS = (
@@ -320,7 +320,7 @@
320320
ENABLE_HARDENED_RUNTIME = YES;
321321
HEADER_SEARCH_PATHS = (
322322
"$(SRCROOT)/include",
323-
"$(SRCROOT)/include/executorch/runtime/core/portable_type",
323+
"$(SRCROOT)/include/executorch/runtime/core/portable_type/c10",
324324
);
325325
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
326326
LIBRARY_SEARCH_PATHS = (

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ target_link_options( arm_executor_runner PUBLIC LINKER:-Map=arm_executor_runner.
384384

385385
# ET headers and generated headers includes
386386
target_include_directories(
387-
arm_executor_runner PRIVATE ${ET_INCLUDE_PATH} ${ET_DIR_PATH}/runtime/core/portable_type ${CMAKE_CURRENT_BINARY_DIR}
387+
arm_executor_runner PRIVATE ${ET_INCLUDE_PATH} ${ET_DIR_PATH}/runtime/core/portable_type/c10 ${CMAKE_CURRENT_BINARY_DIR}
388388
)
389389
target_compile_definitions(arm_executor_runner PRIVATE C10_USING_CUSTOM_GENERATED_MACROS)
390390

kernels/optimized/cpu/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _OPTIMIZED_ATEN_OPS = (
3838
name = "op_gelu",
3939
deps = [
4040
"//executorch/kernels/portable/cpu/util:activation_ops_util",
41-
"//executorch/runtime/core/portable_type/c10:aten_headers_for_executorch",
41+
"//executorch/runtime/core/portable_type/c10/c10:aten_headers_for_executorch",
4242
],
4343
),
4444
op_target(
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
We added an extra c10 directory so that runtime/core/portable_type/c10
2+
can be the directory to put on your include path, rather than
3+
runtime/core/portable_type, because using runtime/core/portable_type
4+
would cause all headers in that directory to be includeable with
5+
`#include <foo.h>`. In particular, that includes
6+
runtime/core/portable_type/complex.h, which would shadow the C99
7+
complex.h standard header.

runtime/core/portable_type/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def define_common_targets():
5252
"bits_types.h",
5353
],
5454
exported_deps = [
55-
"//executorch/runtime/core/portable_type/c10:c10",
55+
"//executorch/runtime/core/portable_type/c10/c10:c10",
5656
],
5757
visibility = [
5858
"//executorch/extension/...",

runtime/core/portable_type/test/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../..)
1919

2020
include(${EXECUTORCH_ROOT}/build/Test.cmake)
2121

22-
set(_test_srcs optional_test.cpp tensor_test.cpp half_test.cpp scalar_test.cpp
23-
tensor_impl_test.cpp bfloat16_test.cpp
22+
set(_test_srcs
23+
bfloat16_test.cpp
24+
dont_shadow_complex_test.c
25+
half_test.cpp
26+
optional_test.cpp
27+
scalar_test.cpp
28+
tensor_impl_test.cpp
29+
tensor_test.cpp
2430
)
2531

2632
et_cxx_test(runtime_core_portable_type_test SOURCES ${_test_srcs} EXTRA_LIBS)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This include statement should get the C99 standard header
2+
// complex.h. At one point we messed up our c10 include setup such
3+
// that it instead included runtime/core/portable_type/complex.h. This
4+
// is a regression test for that issue.
5+
#include <complex.h>
6+
7+
#ifndef complex
8+
#warning "complex.h does not define complex"
9+
#endif

test/utils/OSSTestConfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@
6868
{
6969
"directory": "runtime/core/portable_type/test",
7070
"sources": [
71-
"optional_test.cpp",
72-
"tensor_test.cpp",
71+
"bfloat16_test.cpp",
72+
"dont_shadow_complex_test.c",
7373
"half_test.cpp",
74+
"optional_test.cpp",
7475
"scalar_test.cpp",
7576
"tensor_impl_test.cpp",
76-
"bfloat16_test.cpp"
77+
"tensor_test.cpp"
7778
]
7879
},
7980
{

0 commit comments

Comments
 (0)