diff --git a/CMakePresets.json b/CMakePresets.json index e637c73545c..c3e985204c3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -100,6 +100,26 @@ "list": ["Darwin", "Linux", "Windows"] } }, + { + "name": "profiling", + "displayName": "Build ExecuTorch with Profiling Enabled", + "inherits": [ + "common" + ], + "cacheVariables": { + "EXECUTORCH_BUILD_PRESET_FILE": "${sourceDir}/tools/cmake/preset/profiling.cmake", + "CMAKE_OSX_DEPLOYMENT_TARGET": "12.0" + }, + "condition": { + "type": "inList", + "string": "${hostSystemName}", + "list": [ + "Darwin", + "Linux", + "Windows" + ] + } + }, { "name": "zephyr", "displayName": "Build ExecuTorch for Zephyr RTOS", diff --git a/tools/cmake/preset/profiling.cmake b/tools/cmake/preset/profiling.cmake new file mode 100644 index 00000000000..1387d0b00d4 --- /dev/null +++ b/tools/cmake/preset/profiling.cmake @@ -0,0 +1,19 @@ +# 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. + +# Presets to enable profiling in executor runner + +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_DATA_LOADER ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON) +set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) +set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) +set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) +set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) +set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) +set_overridable_option(EXECUTORCH_BUILD_DEVTOOLS ON) +set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON) +set_overridable_option(EXECUTORCH_ENABLE_EVENT_TRACER ON)