Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Minor update to CMake configurations (#501)
Browse files Browse the repository at this point in the history
* Introduced check for recursive clone of the repository 
* Added cmake error if libclang_rt file is not available with the selected compiler
  (required by rocblas benchmarks)
  • Loading branch information
s-Nick authored Mar 4, 2024
1 parent fec888f commit fbd2646
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ if (NOT INSTALL_HEADER_ONLY)
include(ConfigurePORTBLAS)
include(SYCL)
find_package(PythonInterp 3 REQUIRED)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external/py_gen/README.md" )
message(FATAL_ERROR "Repository not cloned recursively, missing submodule.\n"
"To continue please clone submodule using `git submodule update --init`")
endif()
endif()

if (MSVC)
Expand Down
2 changes: 1 addition & 1 deletion benchmark/cublas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ set(HALF_DATA_OPS "gemm"
foreach(cublas_bench ${sources})
get_filename_component(bench_cublas_exec ${cublas_bench} NAME_WE)
add_executable(bench_cublas_${bench_cublas_exec} ${cublas_bench} main.cpp)
target_link_libraries(bench_cublas_${bench_cublas_exec} PRIVATE benchmark CUDA::toolkit CUDA::cublas CUDA::cudart portblas Clara::Clara bench_info)
target_link_libraries(bench_cublas_${bench_cublas_exec} PRIVATE benchmark CUDA::toolkit CUDA::cublas CUDA::cudart Clara::Clara bench_info)
target_compile_definitions(bench_cublas_${bench_cublas_exec} PRIVATE -DBLAS_INDEX_T=${BLAS_BENCHMARK_INDEX_TYPE})
if((${BLAS_ENABLE_COMPLEX}) AND ("${bench_cublas_exec}" IN_LIST CPLX_OPS))
target_compile_definitions(bench_cublas_${bench_cublas_exec} PRIVATE BLAS_ENABLE_COMPLEX=1)
Expand Down
17 changes: 17 additions & 0 deletions benchmark/rocblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,23 @@ set(HALF_DATA_OPS "gemm"
"gemm_batched_strided"
)

# HIP_CXX_COMPILER is defined equal to CMAKE_CXX_COMPILER while looking for rocblas (line 30)
# if it is passed by user it is supposed to be different from standard compiler, than it is up
# to the user provide the correct path with the correct library.
if("${HIP_CXX_COMPILER}" STREQUAL "${CMAKE_CXX_COMPILER}" )
# Verify that libclang_rt.builtins exists for current compiler
if(EXISTS ${CLANGRT_BUILTINS} )
message("libclang_rt found at " ${CLANGRT_BUILTINS})
else()
message(FATAL_ERROR "libclang_rt not found at " ${CLANGRT_BUILTINS}
"\nCheck library availability for current CXX compiler. "
"Using HIP_CXX_COMPILER option, set another compiler compatible with ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} that has libclang_rt.builtins for x86_64."
"If not possible skip rocBLAS benchmarks compilation")
endif()
else()
message(WARNING "using CLANGRT_BUILTINS defined by user at " ${CLANGRT_BUILTINS})
endif()

# Add individual benchmarks for each method
foreach(rocblas_benchmark ${sources})
get_filename_component(rocblas_bench_exec ${rocblas_benchmark} NAME_WE)
Expand Down

0 comments on commit fbd2646

Please sign in to comment.