-
Notifications
You must be signed in to change notification settings - Fork 17
Add OpenCL runtime #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenCL runtime #191
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ def ConvertOneDNNGraphToLinalg : Pass<"convert-onednn-graph-to-linalg"> { | |
]; | ||
} | ||
|
||
|
||
#ifdef GC_USE_GPU | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dchigarev Please help to view this change. Thx!. This is to totally disable xegpu passes when GPU is OFF. Just to make compiler & CI happy for CPU mode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm good with this change |
||
def LinalgToXeGPU : Pass<"linalg-to-xegpu", "func::FuncOp"> { | ||
let summary = "Convert linalg dialect to XeGPU dialect."; | ||
let description = [{ | ||
|
@@ -57,5 +57,6 @@ def LinalgToXeGPU : Pass<"linalg-to-xegpu", "func::FuncOp"> { | |
"DPAS register block sizes MxNxK">, | ||
]; | ||
} | ||
#endif | ||
|
||
#endif // GC_DIALECT_GC_PASSES |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
set(GC_ALL_LIBS | ||
MLIROneDNNGraph | ||
MLIRCPURuntimeDialect | ||
GCPasses | ||
MLIRCPURuntimeTransforms) | ||
|
||
if(GC_USE_GPU) | ||
list(APPEND GC_ALL_LIBS GCGPUPasses) | ||
endif() | ||
|
||
add_mlir_public_c_api_library(GcCAPI | ||
Dialects.cpp | ||
Passes.cpp | ||
LINK_LIBS PUBLIC | ||
MLIROneDNNGraph | ||
MLIRCPURuntimeDialect | ||
GCPasses | ||
GCGPUPasses | ||
MLIRCPURuntimeTransforms | ||
${GC_ALL_LIBS} | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
add_subdirectory(CPURuntime) | ||
add_subdirectory(Driver) | ||
add_subdirectory(Driver) | ||
if(GC_USE_GPU) | ||
add_subdirectory(OpenCLRuntime) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
find_package(OpenCL REQUIRED) | ||
|
||
add_mlir_library(mlir_opencl_runtime | ||
SHARED | ||
OpenCLRuntimeWrappers.cpp | ||
|
||
EXCLUDE_FROM_LIBMLIR | ||
) | ||
|
||
check_cxx_compiler_flag("-frtti" CXX_HAS_FRTTI_FLAG) | ||
if(NOT CXX_HAS_FRTTI_FLAG) | ||
message(FATAL_ERROR "CXX compiler does not accept flag -frtti") | ||
endif() | ||
target_compile_options (mlir_opencl_runtime PUBLIC -fexceptions -frtti) | ||
|
||
target_include_directories(mlir_opencl_runtime PRIVATE | ||
${MLIR_INCLUDE_DIRS} | ||
${OpenCL_INCLUDE_DIRS} | ||
) | ||
|
||
message(STATUS "OpenCL Libraries: ${OpenCL_LIBRARIES}") | ||
target_link_libraries(mlir_opencl_runtime PUBLIC ${OpenCL_LIBRARIES}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the
dev
package needed btw?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was following this link https://dgpu-docs.intel.com/installation-guides/ubuntu/ubuntu-jammy-arc.html
Seems like
intel-opencl-icd
is for the libraries andopencl-c-headers
for the headers?