-
Notifications
You must be signed in to change notification settings - Fork 320
Fix/modernize thrust examples #7094
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
Conversation
|
/ok to test e89e7c2 |
Co-authored-by: Bernhard Manfred Gruber <[email protected]>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Michael Schellenberger Costa <[email protected]>
Co-authored-by: Michael Schellenberger Costa <[email protected]>
|
/ok to test a104277 |
|
pre-commit.ci autofix |
|
From the CI: Please add a new file target_compile_options(
${example_target}
PRIVATE $<$<COMPILE_LANG_AND_ID:CUDA,NVIDIA>: --extended-lambda>
) |
@Flawxd I wonder how you verfied this, because the example in the PR cannot be compiled without |
Yes, I did test it using --extend-lambda, it was an oversight from me to not include it in a cmake file, I'll push the new file |
|
pre-commit.ci autofix |
|
/ok to test 3f87a1d |
This comment has been minimized.
This comment has been minimized.
|
Please also add this to the cmake file: we already have this fix in other places. |
|
Hello, isnt the correct variable example_target instead of test_target ? |
Correct. I copied this from a test.
Yes, but this may be trickier than it sounds. |
|
Alright then, I'll do what you suggested with the correct variable |
|
/ok to test 3fd0ed9 |
This comment has been minimized.
This comment has been minimized.
|
/ok to test e92d109 |
This comment has been minimized.
This comment has been minimized.
It seems I confused something, since we still have not exclude the flag for MSVC. Looking into other files, I see that we do limit the flag to when the CXX compiler is clang >=13. I pushed the change. Sorry for the noise! |
|
No problem, thank you for the heads-up ! |
|
/ok to test 113bb15 |
🥳 CI Workflow Results🟩 Finished in 1h 18m: Pass: 100%/51 | Total: 17h 28m | Max: 1h 11m | Hits: 99%/97068See results here. |
|
Thanks a lot for improving the examples 🎉 |
|
NP, Thanks for your guidance ! |
Following #724
Modernizes the thrust/examples/word_count.cu example by replacing the functor struct is_word_start with an extended lambda
to align with modern C++ practices and to make it easier to read
Changes:
Replaced struct is_word_start with a host device lambda.
Replaced C-style array pointer arithmetic with std::begin() and std::end() for safer iterator access.
The code was verified using a T4 GPU and ran perfectly