Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cead64f
test(rocsparse): add shared unit-test setup for the coverage work (AI…
kliegeois Oct 21, 2026
25afb73
ci(rocsparse): report unit and integration coverage separately (AISPA…
kliegeois Oct 21, 2026
b0c22b4
test(rocsparse): add host-side unit tests (bfloat16, auxiliary branch…
kliegeois Oct 21, 2026
d68870c
test(rocsparse): add level-2 unit tests (SpMV, SpSV, BSR, iterative t…
kliegeois Oct 21, 2026
a485d8a
test(rocsparse): add conversion unit tests (prune, sort, descriptors,…
kliegeois Oct 21, 2026
0a3cfec
test(rocsparse): add preconditioner unit tests (ILU0, IC0, itilu0, gt…
kliegeois Oct 21, 2026
a149a23
test(rocsparse): add unit tests for SpMM, SpGEMM, SpGEAM, SDDMM, SpSM…
kliegeois Oct 21, 2026
a4d3f29
test(rocsparse): tighten host unit-test checks after review (AISPARSE…
kliegeois Oct 21, 2026
b7f5150
test(rocsparse): tighten level2 unit-test checks after review (AISPAR…
kliegeois Oct 21, 2026
6a19ee0
test(rocsparse): tighten conv unit-test checks after review (AISPARSE…
kliegeois Oct 21, 2026
9ba253d
test(rocsparse): tighten precond unit-test checks after review (AISPA…
kliegeois Oct 21, 2026
8674063
test(rocsparse): tighten extra unit-test checks after review (AISPARS…
kliegeois Oct 21, 2026
5bbcc1d
test(rocsparse): leave library-bug cases to their fix PRs (AISPARSE-879)
kliegeois Oct 21, 2026
fad851f
test(rocsparse): cover remaining missed paths in unit tests (AISPARSE…
kliegeois Oct 21, 2026
fb2cf55
test(rocsparse): fail blocked ELL dense_to_sparse on unexpected statu…
kliegeois Oct 21, 2026
c10f8e1
test(rocsparse): correct itilu0 async_split reachability comments
kliegeois Oct 21, 2026
2c49e3c
test(rocsparse): set the spildlt0 boost on the descriptor too
kliegeois Oct 21, 2026
9a24562
test(rocsparse): match index buffers to i32 descriptors under ILP64 (…
kliegeois Oct 23, 2026
703bb37
test(rocsparse): check unsupported SpMV cases that succeed (AISPARSE-…
kliegeois Oct 23, 2026
b4e2680
test(rocsparse): define the f16 and bf16 type traits once (AISPARSE-879)
kliegeois Oct 23, 2026
a9a2523
test(rocsparse): keep one SpMM buffer across the stages (AISPARSE-879)
kliegeois Oct 23, 2026
f097e93
test(rocsparse): solve several right-hand sides in the SpTRSM cases (…
kliegeois Oct 23, 2026
2d64074
test(rocsparse): assert the SpTRSV zero pivot query result (AISPARSE-…
kliegeois Oct 23, 2026
6824dad
test(rocsparse): run the plain transpose in the real SpSV sweeps (AIS…
kliegeois Oct 23, 2026
8a603e9
test(rocsparse): store entries in the ignored triangle of SpSM, BSRSM…
kliegeois Oct 23, 2026
083fad5
test(rocsparse): pre-fill conversion targets and C row pointers with …
kliegeois Oct 23, 2026
f23ae02
test(rocsparse): add negative entries to the prune and compress input…
kliegeois Oct 23, 2026
ae4e242
test(rocsparse): name the cause of the spildlt0 i32/i64 guard (AISPAR…
kliegeois Oct 23, 2026
d14a873
test(rocsparse): name the tickets at the workaround sites (AISPARSE-879)
kliegeois Oct 23, 2026
d269af6
test(rocsparse): assert the status the library returns instead of acc…
kliegeois Oct 23, 2026
c0a0a29
test(rocsparse): build the unit tests with the library configuration …
kliegeois Oct 23, 2026
0fa38ed
test(rocsparse): report a failed coverage_split and clean the coverag…
kliegeois Oct 23, 2026
cb8152f
test(rocsparse): keep beta 0 real and use complex scalars in the BSR …
kliegeois Oct 23, 2026
be4a943
test(rocsparse): allocate the blas handle passed to blas_destroy_hand…
kliegeois Oct 23, 2026
a2918e0
test(rocsparse): accept the itilu0 stagnation exit in the stopping ru…
kliegeois Oct 23, 2026
9fb9763
test(rocsparse): sequence the random draws of the test values (AISPAR…
kliegeois Oct 23, 2026
edab5f7
test(rocsparse): explain the SpTRSM tolerance (AISPARSE-879)
kliegeois Oct 23, 2026
842314e
test(rocsparse): build and run the unit tests under rocsparse_ILP64 (…
kliegeois Oct 23, 2026
0651d73
Merge branch 'develop' into task/unit-cov-fused
kliegeois Oct 23, 2026
cb6903d
ci(rocsparse): move the rocSPARSE-unit and rocSPARSE-integration flag…
kliegeois Oct 26, 2026
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
9 changes: 9 additions & 0 deletions projects/rocsparse/.jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ def runCoverageCommand (platform, project, gfilter, String dirmode = "release")
GTEST_LISTENER=NO_PASS_LINE_IN_LOG ./clients/staging/rocsparse-unit-test-device --gtest_output=xml:test_detail_unit_device.xml --gtest_color=yes
GTEST_LISTENER=NO_PASS_LINE_IN_LOG make coverage_cleanup coverage GTEST_FILTER=${gfilter}-*known_bug*
/usr/local/bin/codecov -v -U \$http_proxy -t ${CODECOV_TOKEN} --file coverage-report/coverage.info --name rocm-libraries --flags rocSPARSE --sha ${commitSha}
# Also report the unit tests and rocsparse-test as separate flags. Upload only if
# coverage_split succeeded, so a stale or partial file is never sent; a failure here
# must not fail the job.
if make coverage_split; then
/usr/local/bin/codecov -v -U \$http_proxy -t ${CODECOV_TOKEN} --file coverage-report/coverage-unit.info --name rocm-libraries-unit --flags rocSPARSE-unit --sha ${commitSha} || true
/usr/local/bin/codecov -v -U \$http_proxy -t ${CODECOV_TOKEN} --file coverage-report/coverage-integration.info --name rocm-libraries-integration --flags rocSPARSE-integration --sha ${commitSha} || true
else
echo "coverage_split failed; rocSPARSE-unit and rocSPARSE-integration not uploaded"
fi
"""

platform.runCommand(this, command)
Expand Down
40 changes: 36 additions & 4 deletions projects/rocsparse/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,16 +417,18 @@ if(BUILD_CODE_COVERAGE)
add_custom_target(coverage_analysis
COMMAND ${CMAKE_COMMAND} -E make_directory ./coverage-report/profraw
COMMAND echo Coverage GTEST_FILTER=\${GTEST_FILTER}
COMMAND ${CMAKE_COMMAND} -E env LLVM_PROFILE_FILE="./coverage-report/profraw/rocsparse-coverage_%m.profraw" ./clients/staging/rocsparse-test --gtest_filter=\"\${GTEST_FILTER}\"
COMMAND ${CMAKE_COMMAND} -E env LLVM_PROFILE_FILE="./coverage-report/profraw/rocsparse-coverage_integration_%m.profraw" ./clients/staging/rocsparse-test --gtest_filter=\"\${GTEST_FILTER}\"
# Also fold in the standalone unit-test binaries so their host-side coverage
# of librocsparse is counted. The %m module hash keeps profraw names distinct
# per binary; they match the rocsparse-coverage_*.profraw merge glob below.
# per binary. The integration (rocsparse-test) and unit-test files use different
# prefixes so coverage_split can report them separately; all of them still match
# the rocsparse-coverage_*.profraw merge glob below.
# make exports GTEST_FILTER into the recipe environment and gtest honors it,
# which previously selected 0 host tests and 6 device tests. These binaries
# are not categorized that way, so run each suite in full. || true keeps a
# unit-test failure from aborting the coverage upload.
COMMAND sh -c "env -u GTEST_FILTER LLVM_PROFILE_FILE=./coverage-report/profraw/rocsparse-coverage_%m.profraw ./clients/staging/rocsparse-unit-test --gtest_filter='*' || true"
COMMAND sh -c "env -u GTEST_FILTER LLVM_PROFILE_FILE=./coverage-report/profraw/rocsparse-coverage_%m.profraw ./clients/staging/rocsparse-unit-test-device --gtest_filter='*' || true"
COMMAND sh -c "env -u GTEST_FILTER LLVM_PROFILE_FILE=./coverage-report/profraw/rocsparse-coverage_unit_%m.profraw ./clients/staging/rocsparse-unit-test --gtest_filter='*' || true"
COMMAND sh -c "env -u GTEST_FILTER LLVM_PROFILE_FILE=./coverage-report/profraw/rocsparse-coverage_unit_%m.profraw ./clients/staging/rocsparse-unit-test-device --gtest_filter='*' || true"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

Expand Down Expand Up @@ -514,11 +516,41 @@ if(BUILD_CODE_COVERAGE)
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

# Report the unit tests and the rocsparse-test (integration) client separately,
# from the profiles that coverage_analysis already wrote. This does not run any
# test. It only merges and exports subsets of the same profraw files.
# > make coverage_split (after make coverage)
# writes coverage-report/coverage-unit.info and coverage-integration.info.
foreach(_split unit integration)
if(Python3_FOUND AND EXISTS ${COVERAGE_FILTER_SCRIPT})
set(_split_filter_${_split}
COMMAND ${Python3_EXECUTABLE} ${COVERAGE_FILTER_SCRIPT} ./coverage-report/coverage-${_split}-raw.info ./coverage-report/coverage-${_split}.info)
else()
set(_split_filter_${_split}
COMMAND ${CMAKE_COMMAND} -E copy ./coverage-report/coverage-${_split}-raw.info ./coverage-report/coverage-${_split}.info)
endif()
endforeach()

add_custom_target(
coverage_split
COMMAND ${LLVM_PROFDATA} merge -sparse ./coverage-report/profraw/rocsparse-coverage_unit_*.profraw -o ./coverage-report/unit.profdata
COMMAND ${LLVM_COV} report ${COVERAGE_OBJECTS} -instr-profile=./coverage-report/unit.profdata
COMMAND ${LLVM_COV} export ${COVERAGE_OBJECTS} -instr-profile=./coverage-report/unit.profdata -format=lcov > ./coverage-report/coverage-unit-raw.info
${_split_filter_unit}
COMMAND ${LLVM_PROFDATA} merge -sparse ./coverage-report/profraw/rocsparse-coverage_integration_*.profraw -o ./coverage-report/integration.profdata
COMMAND ${LLVM_COV} report ${COVERAGE_OBJECTS} -instr-profile=./coverage-report/integration.profdata
COMMAND ${LLVM_COV} export ${COVERAGE_OBJECTS} -instr-profile=./coverage-report/integration.profdata -format=lcov > ./coverage-report/coverage-integration-raw.info
${_split_filter_integration}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)

#
# Coverage cleanup
#
add_custom_target(coverage_cleanup
COMMAND find ${CMAKE_BINARY_DIR} -name *.gcda -delete
COMMAND ${CMAKE_COMMAND} -E rm -rf ./coverage-report/profraw
COMMAND ${CMAKE_COMMAND} -E rm -f ./coverage-report/rocsparse.profdata ./coverage-report/unit.profdata ./coverage-report/integration.profdata
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
endif()
7 changes: 7 additions & 0 deletions projects/rocsparse/clients/tests/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,13 @@ do not abort the coverage upload. Both binaries are passed as extra `llvm-cov` `
attribute coverage to library translation units compiled into the test executables. Jenkins `codecov.groovy` uploads `coverage.info` to Codecov
with flag `rocSPARSE`.

`make coverage_split` (run after `make coverage`) does not rerun any test. It merges the unit-test
profiles (`rocsparse-unit-test` and `rocsparse-unit-test-device`) and the `rocsparse-test` profiles
separately and writes `coverage-report/coverage-unit.info` and
`coverage-report/coverage-integration.info`. Jenkins uploads them with the Codecov flags
`rocSPARSE-unit` and `rocSPARSE-integration`, only if `coverage_split` succeeds; the combined
`rocSPARSE` flag covers both. `make coverage_cleanup` deletes the profiles of a previous run.

**Code coverage vs. test coverage**:
* *Code coverage* = fraction of lines executed (e.g. 700 of 1,000 → 70%).
* *Test coverage* = fraction of intended functionality exercised (types, index types, formats, sizes,
Expand Down
46 changes: 44 additions & 2 deletions projects/rocsparse/clients/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ add_executable(rocsparse-unit-test
# ROCSPARSE_EXPORT (and *_NO_EXPORT) to nothing on every platform, which is
# correct here: these TUs are compiled *into* the test binary, not consumed from
# the shared library. Test-only; no library change.
target_compile_definitions(rocsparse-unit-test PRIVATE GOOGLE_TEST ROCSPARSE_STATIC_DEFINE)
target_compile_definitions(rocsparse-unit-test
PRIVATE GOOGLE_TEST ROCSPARSE_STATIC_DEFINE ROCSPARSE_KEEP_INTERNAL_U16)
target_compile_options(rocsparse-unit-test PRIVATE
-Wno-deprecated
-Wno-unused-command-line-argument
Expand Down Expand Up @@ -407,6 +408,34 @@ set(ROCSPARSE_UNIT_TEST_DEVICE_LIB_SOURCES
# (CXX_VISIBILITY_PRESET "hidden"), so the defining TU is compiled into this
# binary. Build wiring only -- no library source changes.
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csr2ell_strided_batched.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_ell2dense.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_coo2dense_aos.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_ggthr.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/level1/rocsparse_gthr_impl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_identity.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_gcreate_identity_permutation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csxsldu_compute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csr2csc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csr2coo.cpp
# csritilu0x_*_impl has no public wrapper in the itilu0 API (AISPARSE-921). The symbols
# are hidden in librocsparse, so the defining TUs (and the x-driver TUs they
# reference) are compiled into this test binary.
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_compute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_preprocess.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_buffer_size.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_sync.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_async.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/rocsparse_csritilu0x_sync_fusion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0/common.cpp
# csxsldu buffer-size and preprocess are hidden and the C wrappers are
# garbage-collected from librocsparse (AISPARSE-921). Compile the defining TUs so the
# column-direction and same-direction branches can run.
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csxsldu_buffer_size.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_csxsldu_preprocess.cpp
# rocsparse::internal_spmat_print is declared in a library-internal
# header, called by nothing in the library and hidden in librocsparse
# (AISPARSE-921).
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion/rocsparse_internal_spmat_print.cpp
)

# Internal rocsparse::primitives building blocks under test. Like the host-pure
Expand All @@ -428,6 +457,16 @@ set(ROCSPARSE_UNIT_TEST_PRIMITIVE_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/primitives/rocsparse_segmented_radix_sort_pairs.cpp
)

# Per-area unit-test lists. Each cmake/unit_tests_<area>.cmake appends its
# sources to ROCSPARSE_UNIT_TEST_DEVICE_SOURCES (or, for host-only translation
# units, adds them to the already created rocsparse-unit-test target), so an
# area only adds files and never edits this CMakeLists.txt. A missing area file
# is skipped (OPTIONAL), so every area can be taken on its own. This must stay
# after rocsparse-unit-test is created and before rocsparse-unit-test-device is.
foreach(_unit_test_area level2 conv precond extra host)
Comment thread
kliegeois marked this conversation as resolved.
Resolved
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/unit_tests_${_unit_test_area}.cmake OPTIONAL)
endforeach()

add_executable(rocsparse-unit-test-device
${ROCSPARSE_UNIT_TEST_DEVICE_SOURCES}
${ROCSPARSE_UNIT_TEST_PRIMITIVE_SOURCES}
Expand All @@ -440,7 +479,8 @@ add_executable(rocsparse-unit-test-device
# (e.g. from library/src/auxiliary/rocsparse_auxiliary.cpp compiled in at the
# infostructs leaf and beyond). Correct on Linux too (these are definitions
# built into the executable, not symbols imported from the shared library).
target_compile_definitions(rocsparse-unit-test-device PRIVATE GOOGLE_TEST ROCSPARSE_STATIC_DEFINE)
target_compile_definitions(rocsparse-unit-test-device
PRIVATE GOOGLE_TEST ROCSPARSE_STATIC_DEFINE ROCSPARSE_KEEP_INTERNAL_U16)
target_compile_options(rocsparse-unit-test-device PRIVATE
-Wno-deprecated
-Wno-unused-command-line-argument
Expand All @@ -452,6 +492,8 @@ target_include_directories(rocsparse-unit-test-device PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/level1>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/level3>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/conversion>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../library/src/precond/itilu0>
)

# hip::device provides the HIP device-compilation flags (-x hip, --offload-arch).
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# ########################################################################
# Copyright (C) 2026 Advanced Micro Devices, Inc. All rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ########################################################################

# Unit tests for the conv area (conversion, pruning, sorting, sparse-matrix descriptors).
# Included from clients/unittests/CMakeLists.txt.

list(APPEND ROCSPARSE_UNIT_TEST_DEVICE_SOURCES
unit_test_device_conv_internal.cpp
unit_test_device_conv_extract.cpp
unit_test_device_conv_sort.cpp
unit_test_device_conv_spmat.cpp
unit_test_device_conv_prune.cpp
unit_test_device_conv_gebsr.cpp
unit_test_device_conv_descr.cpp
unit_test_device_conv_hyb.cpp
unit_test_device_conv_edges.cpp
unit_test_device_conv_check.cpp
unit_test_device_conv_dense.cpp
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# ########################################################################
# Copyright (C) 2026 Advanced Micro Devices, Inc. All rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ########################################################################

# Unit tests for the extra area (SpMM, SpGEMM, SpGEAM, SDDMM, SpSM, SpTRSM,
# bsrsm, BELL, gebsrmm, gemmi, spmat_scale).
# Included from clients/unittests/CMakeLists.txt.

list(APPEND ROCSPARSE_UNIT_TEST_DEVICE_SOURCES
unit_test_internal_level3_sddmm_branches.cpp
unit_test_device_extra_bell.cpp
unit_test_device_extra_bsrgeam.cpp
unit_test_device_extra_bsrsm.cpp
unit_test_device_extra_csrgemm_bsrgemm.cpp
unit_test_device_extra_geam.cpp
unit_test_device_extra_gebsrmm.cpp
unit_test_device_extra_gemm_geam.cpp
unit_test_device_extra_gemmi.cpp
unit_test_device_extra_sddmm.cpp
unit_test_device_extra_spgeam.cpp
unit_test_device_extra_spgemm.cpp
unit_test_device_extra_spmm.cpp
unit_test_device_extra_spsm.cpp
)
if(ROCSPARSE_ENABLE_SPMAT_SCALE)
list(APPEND ROCSPARSE_UNIT_TEST_DEVICE_SOURCES unit_test_device_extra_spmat_scale.cpp)
endif()
if(BUILD_WITH_TRSM_REFACTORING)
list(APPEND ROCSPARSE_UNIT_TEST_DEVICE_SOURCES unit_test_device_extra_sptrsm.cpp)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# ########################################################################
# Copyright (C) 2026 Advanced Micro Devices, Inc. All rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ########################################################################

# Unit tests for the host area (bfloat16, BLAS wrappers, auxiliary and
# library-internal host branches).
# Included from clients/unittests/CMakeLists.txt.

# rocsparse_bfloat16.h only defines the full rocsparse_bfloat16 struct when
# compiled as HIP. Build this TU as HIP host code only: no device code object,
# so the binary stays GPU-independent.
target_sources(rocsparse-unit-test PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/unit_test_bfloat16.cpp
)
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/unit_test_bfloat16.cpp PROPERTIES
COMPILE_OPTIONS "-x;hip;--offload-host-only"
)

list(APPEND ROCSPARSE_UNIT_TEST_DEVICE_SOURCES
unit_test_internal_common_blas.cpp
unit_test_host_auxiliary_branches.cpp
unit_test_host_internal_branches.cpp
)
Loading
Loading