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

Detect architecture features automatically #327

Open
alberto-scolari opened this issue Mar 7, 2024 · 0 comments · May be fixed by #328
Open

Detect architecture features automatically #327

alberto-scolari opened this issue Mar 7, 2024 · 0 comments · May be fixed by #328

Comments

@alberto-scolari
Copy link
Collaborator

alberto-scolari commented Mar 7, 2024

Currently, the user has to manually modify include/graphblas/base/config.hpp to set the architecture parameters. Not only this is inconvenient, but it also leads to multiple issues:

  1. if we forget to do it and then run performance tests, either we report suboptimal results or we recall the mistake and must redo the tests (it happened to everybody, it caused everybody many lost hours)
  2. if you integrate ALP into another project as a dependency, you cannot have a full "out of the box" experience (i.e., the project downloads and deploys ALP automatically), because you have to manually edit that header (example below)

The solution is indeed to automatically detect architectural features of interest and automatically apply them. This should be done in two (independent) phases:

  1. during CMake configuration, to build tests and examples for the target CPU
  2. every time the grbcxx script is invoked to compile; this because the script can be invoked on a different micro-arch than the one used for the CMake configuration (e.g., because of a shared setup in a cluster)

@anyzelman


find_package(ALPGraphBLAS CONFIG) # look for ALP in ALPGraphBLAS_ROOT directory, if given
if(NOT ALPGraphBLAS_FOUND)
    include(FetchContent)
    # download ALP and deploy automatically
    FetchContent_Declare(ALPGraphBLAS
        GIT_REPOSITORY https://github.com/Algebraic-Programming/ALP.git
        GIT_TAG "develop"
        GIT_SHALLOW TRUE
    )
    # here you should modify the header (e.g., by applying a patch): cumbersome ...
    FetchContent_MakeAvailable(ALPGraphBLAS)
endif()
@alberto-scolari alberto-scolari linked a pull request Mar 7, 2024 that will close this issue
@alberto-scolari alberto-scolari linked a pull request Mar 7, 2024 that will close this issue
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 a pull request may close this issue.

1 participant