Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
Co-authored-by: Yuhsiang Tsai <yhmtsai@gmail.com>
Co-authored-by: Terry Cojean <terry.cojean@kit.edu>
  • Loading branch information
3 people committed Nov 3, 2021
1 parent a0dd374 commit 6d4a017
Show file tree
Hide file tree
Showing 7 changed files with 334 additions and 325 deletions.
4 changes: 2 additions & 2 deletions BENCHMARKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ The supported environment variables are described in the following list:
* `PRECONDS={jacobi,ic,ilu,paric,parict,parilu,parilut,ic-isai,ilu-isai,paric-isai,parict-isai,parilu-isai,parilut-isai,none}`
the preconditioners to use for either `solver` or `preconditioner` benchmarks.
Multiple options can be passed to this variable. Default is `none`.
* `FORMATS={csr,coo,ell,hybrid,sellp,hybridxx,cusp_xx,hipsp_xx}` the matrix
* `FORMATS={csr,coo,ell,hybrid,sellp,hybridxx,cusparse_xx,hipsparse_xx}` the matrix
formats to benchmark for the `spmv` phase of the benchmark. Run
`${ginkgo_build_dir}/benchmark/spmv/spmv --help` for a full list. If needed,
multiple options for hybrid with different optimization parameters are
available. Depending on the libraries available at build time, vendor
library formats (cuSPARSE with `cusp_` prefix or hipSPARSE with `hipsp_`
library formats (cuSPARSE with `cusparse_` prefix or hipSPARSE with `hipsparse_`
prefix) can be used as well. Multiple options can be passed. The default is
`csr,coo,ell,hybrid,sellp`.
* `SOLVERS={bicgstab,bicg,cg,cgs,fcg,gmres,cb_gmres_{keep,reduce1,reduce2,integer,ireduce1,ireduce2},lower_trs,upper_trs}`
Expand Down
24 changes: 11 additions & 13 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ function(ginkgo_benchmark_add_tuning_maybe name)
endif()
endfunction()

function(ginkgo_benchmark_cusp_linops type def)
function(ginkgo_benchmark_cusparse_linops type def)
add_library(cusparse_linops_${type} utils/cuda_linops.cu)
# make the dependency public to catch issues
target_compile_definitions(cusparse_linops_${type} PUBLIC ${def})
target_link_libraries(cusparse_linops_${type} Ginkgo::ginkgo ${CUDA_RUNTIME_LIBS} ${CUBLAS} ${CUSPARSE})
target_include_directories(cusparse_linops_${type} SYSTEM PRIVATE ${CUDA_INCLUDE_DIRS})
if(CMAKE_CUDA_COMPILER_VERSION GREATER_EQUAL "9.2")
target_compile_definitions(cusparse_linops_${type} PRIVATE ALLOWMP=1)
endif()
target_compile_definitions(cusparse_linops_${type} PRIVATE ALLOWMP=1)
endfunction()

function(ginkgo_benchmark_hipsp_linops type def)
function(ginkgo_benchmark_hipsparse_linops type def)
add_library(hipsparse_linops_${type} utils/hip_linops.hip.cpp)
target_compile_definitions(hipsparse_linops_${type} PUBLIC ${def})
EXECUTE_PROCESS(COMMAND ${HIP_PATH}/bin/hipconfig --cpp_config OUTPUT_VARIABLE HIP_CXX_FLAGS)
Expand Down Expand Up @@ -99,19 +97,19 @@ endfunction(ginkgo_add_typed_benchmark_executables)

if (GINKGO_BUILD_CUDA)
enable_language(CUDA)
ginkgo_benchmark_cusp_linops(d GKO_BENCHMARK_USE_DOUBLE_PRECISION)
ginkgo_benchmark_cusp_linops(s GKO_BENCHMARK_USE_SINGLE_PRECISION)
ginkgo_benchmark_cusp_linops(z GKO_BENCHMARK_USE_DOUBLE_COMPLEX_PRECISION)
ginkgo_benchmark_cusp_linops(c GKO_BENCHMARK_USE_SINGLE_COMPLEX_PRECISION)
ginkgo_benchmark_cusparse_linops(d GKO_BENCHMARK_USE_DOUBLE_PRECISION)
ginkgo_benchmark_cusparse_linops(s GKO_BENCHMARK_USE_SINGLE_PRECISION)
ginkgo_benchmark_cusparse_linops(z GKO_BENCHMARK_USE_DOUBLE_COMPLEX_PRECISION)
ginkgo_benchmark_cusparse_linops(c GKO_BENCHMARK_USE_SINGLE_COMPLEX_PRECISION)
add_library(cuda_timer utils/cuda_timer.cu)
target_link_libraries(cuda_timer ginkgo ${CUDA_RUNTIME_LIBS})
target_include_directories(cuda_timer SYSTEM PRIVATE ${CUDA_INCLUDE_DIRS})
endif()
if (GINKGO_BUILD_HIP)
ginkgo_benchmark_hipsp_linops(d GKO_BENCHMARK_USE_DOUBLE_PRECISION)
ginkgo_benchmark_hipsp_linops(s GKO_BENCHMARK_USE_SINGLE_PRECISION)
ginkgo_benchmark_hipsp_linops(z GKO_BENCHMARK_USE_DOUBLE_COMPLEX_PRECISION)
ginkgo_benchmark_hipsp_linops(c GKO_BENCHMARK_USE_SINGLE_COMPLEX_PRECISION)
ginkgo_benchmark_hipsparse_linops(d GKO_BENCHMARK_USE_DOUBLE_PRECISION)
ginkgo_benchmark_hipsparse_linops(s GKO_BENCHMARK_USE_SINGLE_PRECISION)
ginkgo_benchmark_hipsparse_linops(z GKO_BENCHMARK_USE_DOUBLE_COMPLEX_PRECISION)
ginkgo_benchmark_hipsparse_linops(c GKO_BENCHMARK_USE_SINGLE_COMPLEX_PRECISION)
add_library(hip_timer utils/hip_timer.hip.cpp)
EXECUTE_PROCESS(COMMAND ${HIP_PATH}/bin/hipconfig --cpp_config OUTPUT_VARIABLE HIP_CXX_FLAGS)
set_target_properties(hip_timer PROPERTIES COMPILE_FLAGS ${HIP_CXX_FLAGS})
Expand Down
Loading

0 comments on commit 6d4a017

Please sign in to comment.