Skip to content

Commit

Permalink
correct 'graph-compiler.cmake'
Browse files Browse the repository at this point in the history
Signed-off-by: dchigarev <[email protected]>
  • Loading branch information
dchigarev committed Oct 1, 2024
1 parent e86c699 commit dc78071
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
5 changes: 2 additions & 3 deletions cmake/graph-compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ if (NOT DEFINED GRAPH_COMPILER_LIBS)
FIND_PACKAGE_ARGS NAMES GraphCompiler
)

set(GC_ENABLE_OPT OFF)
set(GC_ENABLE_IMEX ${ENABLE_INTEL_GPU})
set(GC_ENABLE_TOOLS OFF)
set(GC_ENABLE_TEST OFF)
set(GC_ENABLE_DNNL OFF)
set(GC_ENABLE_DNNL_API OFF)
set(GC_ENABLE_LEGACY OFF)
set(GC_ENABLE_BINDINGS_PYTHON OFF)
Expand All @@ -35,7 +35,6 @@ if (NOT DEFINED GRAPH_COMPILER_LIBS)
)

if (GC_ENABLE_IMEX)
add_definitions(-DGC_ENABLE_IMEX)
list(APPEND GRAPH_COMPILER_LIBS GcGpuOclRuntime)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ void ov::pass::transformMLIR(std::shared_ptr<ov::Model> model,
"[ ERROR ] OpenVINO wasn't compiled with GRAPH_COMPILER support, "
"but OV_MLIR_MODE environment variable is set to GC_GPU.");
#endif
#ifndef GC_ENABLE_IMEX
#ifndef GC_USE_IMEX // GC_GPU requires IMEX support
OPENVINO_THROW(
"[ ERROR ] GraphCompiler wasn't compiled with IMEX support (-DGC_ENABLE_IMEX), "
"but OV_MLIR_MODE environment variable is set to GC_GPU.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#ifdef GRAPH_COMPILER
#include "gc/Transforms/Passes.h"

#ifdef GC_ENABLE_IMEX
#ifdef GC_USE_IMEX // GC_GPU requires IMEX support
#include "gc/Utils/Error.h"
#include "gc/ExecutionEngine/GPURuntime/GpuOclRuntime.h"
#include "openvino/runtime/intel_gpu/remote_properties.hpp"
Expand Down Expand Up @@ -294,7 +294,7 @@ std::shared_ptr<MLIREvaluateBase> MLIREvaluateBase::create(OwningOpRef<ModuleOp>
MlirMode mode,
std::shared_ptr<ov::EvaluationContext> loweringContext) {
switch (mode) {
#if defined(GRAPH_COMPILER) && defined(GC_ENABLE_IMEX)
#ifdef GC_USE_IMEX // GC_GPU requires IMEX support
case MLIR_MODE_GC_GPU:
return std::make_shared<MLIREvaluateGcGPU>(std::move(module), loweringContext);
#endif
Expand All @@ -307,7 +307,7 @@ std::shared_ptr<MLIREvaluateBase> MLIREvaluateBase::create(OwningOpRef<ModuleOp>
}
}

#if defined(GRAPH_COMPILER) && defined(GC_ENABLE_IMEX)
#ifdef GC_USE_IMEX // GC_GPU requires IMEX support

cl_device_id extract_device_from_context(cl_context context) {
size_t devices_size;
Expand Down Expand Up @@ -421,7 +421,7 @@ gc::gpu::OclContext MLIREvaluateGcGPU::build_ocl_context(const ov::EvaluationCon
return gc::gpu::OclContext(module->runtime, queue, waitListLen, reinterpret_cast<cl_event*>(waitList.data()));
}

#endif // GRAPH_COMPILER && GC_ENABLE_IMEX
#endif // GC_USE_IMEX

MLIREvaluate::MLIREvaluate(OwningOpRef<mlir::ModuleOp> _module, MlirMode mode) :
module(std::move(_module)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "convert_common.hpp"

#if defined(GRAPH_COMPILER) && defined(GC_ENABLE_IMEX)
#ifdef GC_USE_IMEX // GC_GPU requires IMEX support
#include "gc/Utils/Error.h"
#include "gc/ExecutionEngine/GPURuntime/GpuOclRuntime.h"
#endif
Expand Down Expand Up @@ -49,7 +49,7 @@ class MLIREvaluateBase {
virtual ~MLIREvaluateBase() = default;
};

#if defined(GRAPH_COMPILER) && defined(GC_ENABLE_IMEX)
#ifdef GC_USE_IMEX // GC_GPU requires IMEX support

class MLIREvaluateGcGPU : public MLIREvaluateBase {
std::shared_ptr<const gc::gpu::OclModule> module;
Expand All @@ -65,7 +65,7 @@ class MLIREvaluateGcGPU : public MLIREvaluateBase {
gc::gpu::OclContext build_ocl_context(const ov::EvaluationContext& evaluationContext);
};

#endif // GRAPH_COMPILER && GC_ENABLE_IMEX
#endif // GC_USE_IMEX

class MLIREvaluate : public MLIREvaluateBase {
OwningOpRef<ModuleOp> module; // FIXME: needs to be kept?
Expand Down
4 changes: 1 addition & 3 deletions src/plugins/intel_gpu/src/plugin/ops/mlir_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
#include "intel_gpu/plugin/program_builder.hpp"
#include "intel_gpu/primitives/generic_primitive.hpp"
#include "ocl/ocl_memory.hpp"

#if defined(GRAPH_COMPILER) && defined(GC_ENABLE_IMEX)
#include "runtime/ocl/ocl_stream.hpp"
#include "runtime/ocl/ocl_base_event.hpp"

#include "openvino/runtime/intel_gpu/remote_properties.hpp"
#include "openvino/runtime/intel_gpu/properties.hpp"
#endif

namespace ov {
namespace op {
Expand Down

0 comments on commit dc78071

Please sign in to comment.