-
Notifications
You must be signed in to change notification settings - Fork 182
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
Refactor <cuda/std/cstring>
#3484
Open
davebayer
wants to merge
2
commits into
NVIDIA:main
Choose a base branch
from
davebayer:refactor_cstring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
davebayer
force-pushed
the
refactor_cstring
branch
2 times, most recently
from
January 22, 2025 17:51
224a155
to
3793a2d
Compare
miscco
approved these changes
Jan 23, 2025
/ok to test |
davebayer
force-pushed
the
refactor_cstring
branch
2 times, most recently
from
January 23, 2025 09:02
694c525
to
e0a7902
Compare
davebayer
force-pushed
the
refactor_cstring
branch
from
January 23, 2025 09:09
e0a7902
to
412c2a3
Compare
miscco
requested changes
Jan 23, 2025
Comment on lines
75
to
97
_CCCL_HOST_DEVICE inline int __atomic_memcmp(void const* __lhs, void const* __rhs, size_t __count) | ||
{ | ||
NV_DISPATCH_TARGET( | ||
NV_IS_DEVICE, | ||
(unsigned char const* __lhs_c; unsigned char const* __rhs_c; | ||
// NVCC recommended laundering through inline asm to compare padding bytes. | ||
asm("mov.b64 %0, %2;\n mov.b64 %1, %3;" : "=l"(__lhs_c), "=l"(__rhs_c) : "l"(__lhs), "l"(__rhs)); | ||
while (__count--) { | ||
auto const __lhs_v = *__lhs_c++; | ||
auto const __rhs_v = *__rhs_c++; | ||
if (__lhs_v < __rhs_v) | ||
{ | ||
return -1; | ||
} | ||
if (__lhs_v > __rhs_v) | ||
{ | ||
return 1; | ||
} | ||
} return 0;), | ||
NV_IS_HOST, | ||
(return _CUDA_VSTD::memcmp(__lhs, __rhs, __count);)) | ||
} | ||
|
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.
@wmaxey I am not sure whether that is still needed?
🟨 CI finished in 7h 17m: Pass: 97%/135 | Total: 3d 05h | Avg: 34m 30s | Max: 1h 18m | Hits: 253%/23315
|
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
CUB | |
Thrust | |
CUDA Experimental | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | libcu++ |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | python |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 135)
# | Runner |
---|---|
92 | linux-amd64-cpu16 |
17 | linux-amd64-gpu-v100-latest-1 |
15 | windows-amd64-cpu16 |
10 | linux-arm64-cpu16 |
1 | linux-amd64-gpu-h100-latest-1-testing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR refactors
<cuda/std/cstring>
and implements missing character array manipulation on device.Changes:
__host__
only, such asstrlen
andstrcat
memcpy
,memset
andmemcmp
are available in device code