11################################################################################
2- # Copyright (C) 2024 Intel Corporation
2+ # Copyright (C) 2025 Intel Corporation
33#
44# Licensed under the Apache License, Version 2.0 (the "License");
55# you may not use this file except in compliance with the License.
@@ -45,7 +45,8 @@ option(GC_ENABLE_TEST_DNNL_API "Build the dnnl tests" ${GC_ENABLE_DNNL_API})
4545option (GC_ENABLE_TEST_MLIR "Build the mlir tests" ON )
4646option (GC_ENABLE_TOOLS "Build the tools" ON )
4747option (GC_ENABLE_OPT "Build gc-opt" ${GC_ENABLE_TOOLS} )
48- option (GC_ENABLE_IMEX "Enable Intel® Extension for MLIR" OFF )
48+ option (GC_ENABLE_IMEX "Enable Intel® Extension for MLIR (implicitly enables GPU compilation)" OFF )
49+ option (GC_ENABLE_GPU "Enable compilation for GPU (e.g., XeVM)" OFF )
4950option (GC_ENABLE_BINDINGS_PYTHON "Enable Graph Complier Python Binding" ON )
5051option (GC_DEV_LINK_LLVM_DYLIB "Link dynamic libraries of LLVM and MLIR. For developers only. Do not use it in packing the library." OFF )
5152option (GC_ENABLE_RUNTIME_NAIVE_BRGEMM "Use naive BRGEMM as runtime backend for debug purpose." OFF )
@@ -55,9 +56,15 @@ if(GC_ENABLE_LEGACY)
5556 add_subdirectory (legacy/core)
5657endif ()
5758
59+ if (GC_ENABLE_GPU)
60+ set (GC_ENABLE_GPU ON )
61+ endif ()
62+
5863if (GC_ENABLE_IMEX)
5964 # normalize the value for lit config
6065 set (GC_ENABLE_IMEX ON )
66+ # IMEX is a subset of GPU
67+ set (GC_ENABLE_GPU ON )
6168endif ()
6269
6370if (GC_ENABLE_DNNL_API)
@@ -70,6 +77,9 @@ endif()
7077############################## Targets #########################################
7178# All common options, includes etc. are added to this interface target.
7279add_library (GcInterface INTERFACE )
80+ if (GC_ENABLE_GPU)
81+ target_compile_options (GcInterface INTERFACE -DGC_USE_GPU)
82+ endif ()
7383target_compile_features (GcInterface INTERFACE cxx_std_17)
7484target_include_directories (GcInterface INTERFACE
7585 $<BUILD_INTERFACE:${PROJECT_BINARY_DIR} /include >
0 commit comments