File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed
Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -171,9 +171,13 @@ cc_library(
171171 ":litert_environment_options" ,
172172 "//litert/cc:litert_macros" ,
173173 "//litert/core:environment" ,
174- "//litert/runtime/accelerators:auto_registration" ,
175174 "@com_google_absl//absl/types:span" ,
176175 ] + select ({
176+ "//litert/build_common:build_include_npu_enabled" : [
177+ "//litert/runtime/accelerators:auto_registration" ,
178+ ],
179+ "//conditions:default" : [],
180+ }) + select ({
177181 "//litert/build_common:build_include_gpu_enabled" : [
178182 "//litert/runtime:gpu_environment" ,
179183 ],
Original file line number Diff line number Diff line change 2323#include " litert/c/litert_environment_options.h"
2424#include " litert/cc/litert_macros.h"
2525#include " litert/core/environment.h"
26+ #if !defined(LITERT_DISABLE_NPU)
2627#include " litert/runtime/accelerators/auto_registration.h"
28+ #endif // !defined(LITERT_DISABLE_NPU)
2729#if !defined(LITERT_DISABLE_GPU)
2830#include " litert/runtime/gpu_environment.h"
2931#endif // !defined(LITERT_DISABLE_GPU)
@@ -41,7 +43,9 @@ LiteRtStatus LiteRtCreateEnvironment(int num_options,
4143 auto options_span = absl::MakeSpan (options, num_options);
4244 LITERT_ASSIGN_OR_RETURN (auto env,
4345 LiteRtEnvironmentT::CreateWithOptions (options_span));
46+ #if !defined(LITERT_DISABLE_NPU)
4447 litert::TriggerAcceleratorAutomaticRegistration (*env);
48+ #endif // !defined(LITERT_DISABLE_NPU)
4549
4650 // Check if any GPU-related options are present using modern C++ algorithms
4751 constexpr std::array<LiteRtEnvOptionTag, 7 > kGpuOptionTags = {
Original file line number Diff line number Diff line change @@ -442,7 +442,6 @@ cc_library(
442442 "//litert/cc:litert_macros" ,
443443 "//litert/cc:litert_opaque_options" ,
444444 "//litert/cc/internal:litert_tensor_buffer_utils" ,
445- "//litert/compiler/plugin:compiler_plugin" ,
446445 "//litert/core:buffer_error_reporter" ,
447446 "//litert/core:build_stamp" ,
448447 "//litert/core:environment" ,
@@ -474,6 +473,7 @@ cc_library(
474473 "@com_google_absl//absl/types:span" ,
475474 ] + select ({
476475 "//litert/build_common:build_include_npu_enabled" : [
476+ "//litert/compiler/plugin:compiler_plugin" ,
477477 "//litert/core/cache:compilation_cache" ,
478478 "//litert/core/model:model_serialize" ,
479479 ],
Original file line number Diff line number Diff line change 6161#include " litert/cc/litert_handle.h"
6262#include " litert/cc/litert_macros.h"
6363#include " litert/cc/litert_opaque_options.h"
64- #include " litert/compiler/plugin/compiler_plugin.h"
6564#include " litert/core/buffer_error_reporter.h"
6665#include " litert/core/build_stamp.h"
6766#include " litert/core/error_reporter.h"
6867#include " litert/core/model/model.h"
6968#if !defined(LITERT_DISABLE_NPU)
69+ #include " litert/compiler/plugin/compiler_plugin.h"
7070#include " litert/core/cache/compilation_cache.h"
7171#include " litert/core/model/model_serialize.h"
7272#endif // !defined(LITERT_DISABLE_NPU)
You can’t perform that action at this time.
0 commit comments