Skip to content

Conversation

@ehmc123
Copy link
Collaborator

@ehmc123 ehmc123 commented May 5, 2025

Description

Changed so that switching between implementation is done during build time with the CMake option -DBUILD=...

It is used like this example:

Example:

src/
--/cuda/
one.cpp
--/default/
one.cpp
two.cpp
include/
one.hpp
two.hpp

Cmake -DBUILD=cuda ..

would use:

src/cuda/one.cpp
src/default/two.cpp
include/one.hpp
include/two.hpp

To follow the same pattern you also add CMake configuration this way by including a CMakeLists.txt with your needed configuration under the implementations like cuda/CmakeLists.txt

Also added a cuda gemm, this was mostly done during my testing but there is no reason to not include it really.

Issue

Closes #220

@ehmc123 ehmc123 added this to the Refactor&Clenaup milestone May 5, 2025
@ehmc123 ehmc123 requested a review from GillisC May 5, 2025 16:32
@ehmc123 ehmc123 self-assigned this May 5, 2025
@ehmc123 ehmc123 added the enhancement New feature or request label May 5, 2025
@ehmc123 ehmc123 linked an issue May 5, 2025 that may be closed by this pull request
@ehmc123 ehmc123 force-pushed the feature/build-modularity branch from 1377489 to 343e4ec Compare May 7, 2025 15:44
@ehmc123
Copy link
Collaborator Author

ehmc123 commented May 7, 2025

It should be ready for merge now, you could probably still change "Makefile" now with the changes made to switching between implementations but I haven't done it right now!

@GillisC
Copy link
Collaborator

GillisC commented May 7, 2025

It should be ready for merge now, you could probably still change "Makefile" now with the changes made to switching between implementations but I haven't done it right now!

I will take a look!

GillisC
GillisC previously approved these changes May 7, 2025
Copy link
Collaborator

@GillisC GillisC left a comment

Choose a reason for hiding this comment

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

Works well for me, saw a decrease 56,000kb --> 48,000kb in just the size of the test executable. One thing that is needed is to add documentation (remove the old stuff) about how the modularity works in the README, so someone new to the project understands how to compile each target e.t.c.

@ehmc123 ehmc123 enabled auto-merge May 9, 2025 19:53
Copy link
Collaborator

@GillisC GillisC left a comment

Choose a reason for hiding this comment

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

LGTM

@ehmc123 ehmc123 merged commit 9e62dc4 into main May 15, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: build time modularization

3 participants