Skip to content
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

Generate separate objects for cu and nvrtc #119

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ set(SOURCE_FILES src/cu.cpp src/nvrtc.cpp)
include_directories(./include/)
include_directories(${CUDAToolkit_INCLUDE_DIRS})

add_library(cudawrappers_cu SHARED src/cu.cpp)
add_library(cudawrappers_nvrtc SHARED src/nvrtc.cpp)
add_library(cudawrappers SHARED ${SOURCE_FILES})
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no need to build libcudawrappers.so from source, you could just link all the libcudawrappers_*.so files together?

Copy link
Member Author

Choose a reason for hiding this comment

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

From what I understood no, the .so does not have the necessary information to be merged or linked in another .so.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to consider the use of CMake object libraries. You can make object libraries for cudawrappers_cu and cudawrappers_nvrt and link these into the final libcudawrappers_cu.so and libcudawrappers_nvrtc.so, as well as libcudawrappers.so.


# Including linters rules
Expand Down