Skip to content

[SYCL][libdevice] Simplify SYCL libdevice cmake file. #6037

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

Merged
merged 7 commits into from
Apr 26, 2022

Conversation

jinge90
Copy link
Contributor

@jinge90 jinge90 commented Apr 21, 2022

Signed-off-by: jinge90 [email protected]

@jinge90 jinge90 requested a review from a team as a code owner April 21, 2022 15:22
@jinge90 jinge90 requested a review from cperkinsintel April 21, 2022 15:22
@jinge90
Copy link
Contributor Author

jinge90 commented Apr 21, 2022

/summary:run

@jinge90
Copy link
Contributor Author

jinge90 commented Apr 22, 2022

Hi, @intel/llvm-reviewers-runtime
Could you review this PR? Previously, we had a very simple and not-well-organized cmakefile for libdevice since we have only a small number of files in libdevice. However, as we add more files and functions in libdevice(and we will add much more in the future), previous cmake file can't meet out requirement and will lead to a lot of code redundancy. This PR simplifies libdevice cmakefile by grouping same code into cmake functions.

Thanks very much.

Comment on lines 83 to 107
add_devicelib_obj(libsycl-fallback-cassert SRC fallback-cassert.cpp DEP ${crt_obj_deps})
add_devicelib_obj(libsycl-fallback-cstring SRC fallback-cstring.cpp DEP ${crt_obj_deps})
add_devicelib_spv(libsycl-fallback-cassert SRC fallback-cassert.cpp DEP ${crt_obj_deps})
add_devicelib_spv(libsycl-fallback-cstring SRC fallback-cstring.cpp DEP ${crt_obj_deps})

set(complex_obj_deps device_complex.h device.h sycl-compiler)
add_devicelib_obj(libsycl-complex SRC complex_wrapper.cpp DEP ${complex_obj_deps})
add_devicelib_obj(libsycl-complex-fp64 SRC complex_wrapper_fp64.cpp DEP ${complex_obj_deps} )
add_devicelib_obj(libsycl-fallback-complex SRC fallback-complex.cpp DEP ${complex_obj_deps})
add_devicelib_obj(libsycl-fallback-complex-fp64 SRC fallback-complex-fp64.cpp DEP ${complex_obj_deps} )
add_devicelib_spv(libsycl-fallback-complex SRC fallback-complex.cpp DEP ${complex_obj_deps})
add_devicelib_spv(libsycl-fallback-complex-fp64 SRC fallback-complex-fp64.cpp DEP ${complex_obj_deps})

set(cmath_obj_deps device_math.h device.h sycl-compiler)
add_devicelib_obj(libsycl-cmath SRC cmath_wrapper.cpp DEP ${cmath_obj_deps})
add_devicelib_obj(libsycl-cmath-fp64 SRC cmath_wrapper_fp64.cpp DEP ${cmath_obj_deps} )
add_devicelib_obj(libsycl-fallback-cmath SRC fallback-cmath.cpp DEP ${cmath_obj_deps})
add_devicelib_obj(libsycl-fallback-cmath-fp64 SRC fallback-cmath-fp64.cpp DEP ${cmath_obj_deps})
add_devicelib_spv(libsycl-fallback-cmath SRC fallback-cmath.cpp DEP ${cmath_obj_deps})
add_devicelib_spv(libsycl-fallback-cmath-fp64 SRC fallback-cmath-fp64.cpp DEP ${cmath_obj_deps})

set(itt_obj_deps device_itt.h spirv_vars.h device.h sycl-compiler)
add_devicelib_obj(libsycl-itt-stubs SRC itt_stubs.cpp DEP ${itt_obj_deps})
add_devicelib_obj(libsycl-itt-compiler-wrappers SRC itt_compiler_wrappers.cpp DEP ${itt_obj_deps})
add_devicelib_obj(libsycl-itt-user-wrappers SRC itt_user_wrappers.cpp DEP ${itt_obj_deps})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that having one extra function/macro/etc. that creates both spv and obj simultaneously will make this code easier to read. Can you please implement that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I would be slightly in favor of different grouping - by how we we compile/what type (itt/other obj/fallback(both obj/spv). The reason is that due to #5435 we need to link spv files with itt symbols and so itt should appear before other commands (at least logically, not sure if cmake requires that as well).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that having one extra function/macro/etc. that creates both spv and obj simultaneously will make this code easier to read. Can you please implement that?

The function combining obj and spv creation is added and the grouping is updated too.

Thanks very much.

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but you still need an approve from someone with more rights in the project.

@pvchupin
Copy link
Contributor

Fail is unrelated. Will be addressed in #6059.

@pvchupin pvchupin merged commit 19d2d98 into intel:sycl Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants