-
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 1 commit
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 |
---|---|---|
@@ -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,26 @@ | ||||||||||
find_package(OpenCL REQUIRED) | ||||||||||
|
||||||||||
if(NOT OpenCL_FOUND) | ||||||||||
message(FATAL_ERROR "OpenCL not found.") | ||||||||||
endif() | ||||||||||
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.
Suggested change
This is redundant when the REQUIRED option is used. 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. Thanks. Removed now. |
||||||||||
|
||||||||||
add_mlir_library(opencl-runtime | ||||||||||
Menooker marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
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 (opencl-runtime PUBLIC -fexceptions -frtti) | ||||||||||
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.
Suggested change
|
||||||||||
|
||||||||||
target_include_directories(opencl-runtime PRIVATE | ||||||||||
Menooker marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
${MLIR_INCLUDE_DIRS} | ||||||||||
${OpenCL_INCLUDE_DIRS} | ||||||||||
) | ||||||||||
|
||||||||||
message(STATUS "OpenCL Libraries: ${OpenCL_LIBRARIES}") | ||||||||||
target_link_libraries(opencl-runtime PRIVATE ${OpenCL_LIBRARIES}) | ||||||||||
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.
Suggested change
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. Thanks, changed. Also use |
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?