-
Notifications
You must be signed in to change notification settings - Fork 75
Add HIP-Clang CMake changes #25
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
Changes from 2 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 |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ add_rocprim_benchmark_hip(benchmark_hip_warp_sort.cpp) | |
| add_rocprim_benchmark_hip(benchmark_hip_device_memory.cpp) | ||
|
|
||
| # rocPRIM HC benchmarks | ||
| if(HIP_COMPILER STREQUAL "HCC") | ||
|
Contributor
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 think you should also disable HC example in
Contributor
Author
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. Right, I had examples OFF during my compiles, I'll add this |
||
| add_rocprim_benchmark_hc(benchmark_hc_block_discontinuity.cpp) | ||
| add_rocprim_benchmark_hc(benchmark_hc_block_exchange.cpp) | ||
| add_rocprim_benchmark_hc(benchmark_hc_block_histogram.cpp) | ||
|
|
@@ -95,3 +96,4 @@ add_rocprim_benchmark_hc(benchmark_hc_device_select.cpp) | |
| add_rocprim_benchmark_hc(benchmark_hc_device_transform.cpp) | ||
| add_rocprim_benchmark_hc(benchmark_hc_warp_scan.cpp) | ||
| add_rocprim_benchmark_hc(benchmark_hc_warp_sort.cpp) | ||
| endif() | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,17 +41,20 @@ target_include_directories(rocprim | |
|
|
||
| # This target allows using only HC interface, links only | ||
| # against HC/HSA library, doesn't require HIP | ||
| add_library(rocprim_hc INTERFACE) | ||
| target_link_libraries(rocprim_hc | ||
| INTERFACE | ||
| rocprim | ||
| hcc::hccrt | ||
| hcc::hc_am | ||
| ) | ||
| target_compile_definitions(rocprim_hc | ||
| INTERFACE | ||
| ROCPRIM_HC_API=1 | ||
| ) | ||
| if(HIP_COMPILER STREQUAL "HCC" OR (hcc_FOUND AND TARGET hcc::hccrt AND TARGET hcc::hc_am)) | ||
|
Contributor
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 think you only need to check Question: If you are using hip-clang to compile HIP code, are
Contributor
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. Also check line 83 of this file.
Contributor
Author
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. If you are using HIP-Clang to compile HIP code, you should have zero dependency on HCC (or any of its targets). But there is still work on removing some of those dependencies. With HIP-Clang, all you need would be llvm/clang/lld/device-libs/and a new HIP runtime. No more dependence on HCC rt.
Contributor
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. ok, so it will HCC rt won't be needed at the time HIP-Clang is ready. Thanks for confirmation. |
||
| add_library(rocprim_hc INTERFACE) | ||
| target_link_libraries(rocprim_hc | ||
| INTERFACE | ||
| rocprim | ||
| hcc::hccrt | ||
| hcc::hc_am | ||
| ) | ||
| target_compile_definitions(rocprim_hc | ||
| INTERFACE | ||
| ROCPRIM_HC_API=1 | ||
| ) | ||
| endif() | ||
|
|
||
|
|
||
| # This target allows using both HIP and HC interfaces, | ||
| # links against HIP library (which depends on HC) | ||
|
|
||
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.
It would be better to move it to
cmake/VerifyCompiler.cmakeafter line 37, so this code it not run ifHIP_PLATFORMisnvccand only hipCUB will be built.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 think I made that comment in the first "big" PR, but I forgot about it here when I did the first review of this PR.
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.
Thanks, that's a good point