-
Notifications
You must be signed in to change notification settings - Fork 788
[SYCL]Add device libraries for C math and complex #975
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
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.
approve to trigger testing
sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
Outdated
Show resolved
Hide resolved
13796a6
to
462b76d
Compare
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.
@jinge90, make sure this patch doesn't introduce any regressions.
f09e341
to
0bdb7d3
Compare
sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
Outdated
Show resolved
Hide resolved
sycl/include/CL/sycl/detail/program_manager/program_manager.hpp
Outdated
Show resolved
Hide resolved
sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
Outdated
Show resolved
Hide resolved
0bdb7d3
to
cba4ed7
Compare
sycl/doc/extensions/C-CXX-StandardLibrary/DeviceLibExtensions.rst
Outdated
Show resolved
Hide resolved
sycl/include/CL/sycl/detail/program_manager/program_manager.hpp
Outdated
Show resolved
Hide resolved
cba4ed7
to
a91add6
Compare
Hi, @bader @asavonic , @andykaylor |
a91add6
to
c14973c
Compare
|
c14973c
to
c4ec5ec
Compare
Hi, all. I updated the patch and split device libraries, fallback spir-v libraries and devicelib extension into 2 parts for float and double support. sycl runtime will load fallback spir-v libraries for double support only if underlying device has "cl_khr_fp64" extension, this should fix the problem on some platform without fp64 support. |
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.
LGTM
@jinge90, could you resolve, merge conflict, please? |
Signed-off-by: gejin <[email protected]>
c4ec5ec
to
2ad7dfe
Compare
#ifndef __SYCL_CMATH_WRAPPER_H__ | ||
#define __SYCL_CMATH_WRAPPER_H__ | ||
|
||
double __spirv_ocl_log(double); |
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.
All these declarations should reside in spirv_ops.hpp, shouldn't they?
add_custom_target(devicelib-obj DEPENDS ${devicelib-obj-file}) | ||
add_custom_target(devicelib-spv DEPENDS ${binary_dir}/libsycl-fallback-cassert.spv) | ||
add_custom_command(OUTPUT ${binary_dir}/libsycl-fallback-complex.spv | ||
COMMAND ${clang} -S -fsycl-device-only -fno-sycl-use-bitcode |
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 we should remove -S
here and from all custom commands below.
If I understand it correctly, today compiler doesn't support it, but it implies textual format of SPIR-V file whereas this command must produce binary format.
…m-test-suite#1072) Explicitly including the extension headers since tests are complaining about missing extension functions/classes in : intel#975 (comment). Signed-off-by: JackAKirk [email protected]
Add device libraries for C math and complex functions based on SYCL compiler's device library infrastructure. Fallback implementation for math and complex functions are also provided. The fallback implementation for C math functions are based on _spirv_ocl* math built-ins and the fallback implementation for C99 complex functions are based on algorithm used in libc++ std::complex. All functions supported are listed in sycl/doc/extensions/C-CXX-StandardLibrary/C-CXX-StandardLibrary.rst.