Commit 6ed78ec
authored
[clr] rely on __builtins for memset/memcpy device functions (#4047)
## Motivation
Simplify the device memset/memcpy code
## Technical Details
Use compiler builtins for memset and memcpy. Compiler has recently made
some changes to make sure that builtins generate good code for these
operations which made it to upstream LLVM, so we can use this from now.
This also changes the signature of memset function, from unsigned char
to something that builtin expects, this should not result in any ABI
break since `unsigned char` basically fits in an `int` (standard int
promotion) and since its a `__device__` function it will be inlined and
will have no traces as a function inside final code.
## JIRA ID
NA
## Test Plan
## Test Result
## Submission Checklist
- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.1 parent e3943fe commit 6ed78ec
File tree
1 file changed
+7
-49
lines changed- projects/clr/hipamd/include/hip/amd_detail
1 file changed
+7
-49
lines changedLines changed: 7 additions & 49 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
892 | | - | |
| 891 | + | |
893 | 892 | | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
| 893 | + | |
917 | 894 | | |
918 | 895 | | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
931 | | - | |
932 | | - | |
933 | | - | |
934 | | - | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
941 | 899 | | |
| 900 | + | |
942 | 901 | | |
943 | 902 | | |
944 | 903 | | |
945 | 904 | | |
946 | 905 | | |
947 | 906 | | |
948 | | - | |
949 | | - | |
| 907 | + | |
950 | 908 | | |
951 | 909 | | |
952 | 910 | | |
| |||
0 commit comments