-
Notifications
You must be signed in to change notification settings - Fork 802
[SYCL] Support memset, memcmp in libdevice #4147
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 all commits
0368038
f1b00fa
ea32ef8
b27e1cf
2b0c495
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 |
|---|---|---|
|
|
@@ -229,3 +229,19 @@ Those __devicelib_* functions have the same argument type and return type as cor | |
| complex math functions from <complex.h>, please refer to ISO/IEC 14882:2011 for details. The | ||
| "double __complex__" type is C99 complex type and it is an alias to "struct {double, double}" | ||
| in LLVM IR and SPIR-V. | ||
|
|
||
| cl_intel_devicelib_cstring | ||
| ========================== | ||
|
|
||
| .. code: | ||
| void *__devicelib_memcpy(void *dest, const void *src, size_t n); | ||
|
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. does this work for any combination of address spaces pointed to by dest and src? Might be worth adding a note. Std C library is not concerned with address spaces.
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. Hi, @kbobrovs
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 don't know. I would expect this to work with any combination. My point that such details should be added to the user API description.
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. Actually it will only work for
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. By default, function pointer arguments are generic. But users needs to understand if he/she can do e.g. int arr[100]; // local variable in a function, resides in the private address space
...
auto *s1 = local_accessor.get_pointer();
auto *s2 = &arr[0];
__devicelib_memcpy(s1, s2, 100);
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. Hi, @kbobrovs and @vzakhari |
||
| void *__devicelib_memset(void *dest, int c, size_t n); | ||
| int __devicelib_memcmp(const void *s1, const void *s2, size_t n); | ||
|
|
||
| Semantic: | ||
| Those __devicelib_* functions perform the same operation as the corresponding C string | ||
| library functions. | ||
|
|
||
| Arguments: | ||
| Those __devicelib_* functions have the same argument type and return type as corresponding | ||
| string functions from <string.h>, please refer to ISO/IEC 14882:2011 for details. | ||
Uh oh!
There was an error while loading. Please reload this page.