Skip to content

Commit

Permalink
Add rocSPARSE and hipSPARSE (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
marbre authored Feb 5, 2025
1 parent 99274cf commit 24fee48
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build_tools/fetch_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,12 @@ def main(argv):
"hipBLAS-common",
"hipBLAS",
"hipBLASLt",
"hipSPARSE",
"rocBLAS",
"rocPRIM",
"rocRAND",
"rocSOLVER",
"rocSPARSE",
],
)
parser.add_argument(
Expand Down
76 changes: 76 additions & 0 deletions math-libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,82 @@ therock_provide_artifact(prim
SUBPROJECT_DEPS rocPRIM
)

#################################################################################
# rocSPARSE
#################################################################################
set(_sparse_subproject_names)

therock_cmake_subproject_declare(rocSPARSE
EXTERNAL_SOURCE_DIR "rocSPARSE"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
-DROCM_DIR=
-DBUILD_WITH_ROCBLAS=ON
-DBUILD_CLIENTS_SAMPLES=OFF
-DBUILD_CLIENTS_BENCHMARKS=OFF
-DBUILD_CLIENTS_SAMPLES=OFF
COMPILER_TOOLCHAIN
amd-hip
BUILD_DEPS
rocBLAS
rocPRIM
RUNTIME_DEPS
hip-clr
)
therock_cmake_subproject_glob_c_sources(rocSPARSE
SUBDIRS
.
)
therock_cmake_subproject_provide_package(rocSPARSE rocsparse lib/cmake/rocsparse)
therock_cmake_subproject_activate(rocSPARSE)
list(APPEND _sparse_subproject_names rocSPARSE)

#################################################################################
# hipSPARSE
#################################################################################

therock_cmake_subproject_declare(hipSPARSE
EXTERNAL_SOURCE_DIR "hipSPARSE"
BACKGROUND_BUILD
CMAKE_ARGS
-DHIP_PLATFORM=amd
-DROCM_PATH=
-DROCM_DIR=
-DBUILD_CLIENTS_SAMPLES=OFF
-DBUILD_CLIENTS_BENCHMARKS=OFF
-DBUILD_CLIENTS_SAMPLES=OFF
COMPILER_TOOLCHAIN
amd-hip
BUILD_DEPS
rocSPARSE
RUNTIME_DEPS
hip-clr
)
therock_cmake_subproject_glob_c_sources(hipSPARSE
SUBDIRS
.
)
therock_cmake_subproject_provide_package(hipSPARSE hipsparse lib/cmake/hipsparse)
therock_cmake_subproject_activate(hipSPARSE)
list(APPEND _sparse_subproject_names hipSPARSE)

#################################################################################
# sparse artifact
#################################################################################

therock_provide_artifact(sparse
DESCRIPTOR artifact-sparse.toml
COMPONENTS
dbg
dev
doc
lib
run
SUBPROJECT_DEPS ${_sparse_subproject_names}
)

#################################################################################
# rocSOLVER
#################################################################################
Expand Down
11 changes: 11 additions & 0 deletions math-libs/artifact-sparse.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# rocSPARSE
[components.dbg."math-libs/rocSPARSE/stage"]
[components.dev."math-libs/rocSPARSE/stage"]
[components.doc."math-libs/rocSPARSE/stage"]
[components.lib."math-libs/rocSPARSE/stage"]

# hipSPARSE
[components.dbg."math-libs/hipSPARSE/stage"]
[components.dev."math-libs/hipSPARSE/stage"]
[components.doc."math-libs/hipSPARSE/stage"]
[components.lib."math-libs/hipSPARSE/stage"]
1 change: 1 addition & 0 deletions math-libs/hipSPARSE
9 changes: 9 additions & 0 deletions math-libs/post_hook_hipSPARSE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
list(APPEND CMAKE_MODULE_PATH "${THEROCK_SOURCE_DIR}/cmake")
include(therock_rpath)

therock_set_install_rpath(
TARGETS
hipsparse
PATHS
.
)
9 changes: 9 additions & 0 deletions math-libs/post_hook_rocSPARSE.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
list(APPEND CMAKE_MODULE_PATH "${THEROCK_SOURCE_DIR}/cmake")
include(therock_rpath)

therock_set_install_rpath(
TARGETS
rocsparse
PATHS
.
)
1 change: 1 addition & 0 deletions math-libs/rocSPARSE

0 comments on commit 24fee48

Please sign in to comment.