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

Commit fbd2646

Browse files
authored
Minor update to CMake configurations (#501)
* 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)
1 parent fec888f commit fbd2646

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ if (NOT INSTALL_HEADER_ONLY)
7373
include(ConfigurePORTBLAS)
7474
include(SYCL)
7575
find_package(PythonInterp 3 REQUIRED)
76+
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external/py_gen/README.md" )
77+
message(FATAL_ERROR "Repository not cloned recursively, missing submodule.\n"
78+
"To continue please clone submodule using `git submodule update --init`")
79+
endif()
7680
endif()
7781

7882
if (MSVC)

benchmark/cublas/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ set(HALF_DATA_OPS "gemm"
8989
foreach(cublas_bench ${sources})
9090
get_filename_component(bench_cublas_exec ${cublas_bench} NAME_WE)
9191
add_executable(bench_cublas_${bench_cublas_exec} ${cublas_bench} main.cpp)
92-
target_link_libraries(bench_cublas_${bench_cublas_exec} PRIVATE benchmark CUDA::toolkit CUDA::cublas CUDA::cudart portblas Clara::Clara bench_info)
92+
target_link_libraries(bench_cublas_${bench_cublas_exec} PRIVATE benchmark CUDA::toolkit CUDA::cublas CUDA::cudart Clara::Clara bench_info)
9393
target_compile_definitions(bench_cublas_${bench_cublas_exec} PRIVATE -DBLAS_INDEX_T=${BLAS_BENCHMARK_INDEX_TYPE})
9494
if((${BLAS_ENABLE_COMPLEX}) AND ("${bench_cublas_exec}" IN_LIST CPLX_OPS))
9595
target_compile_definitions(bench_cublas_${bench_cublas_exec} PRIVATE BLAS_ENABLE_COMPLEX=1)

benchmark/rocblas/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,23 @@ set(HALF_DATA_OPS "gemm"
8888
"gemm_batched_strided"
8989
)
9090

91+
# HIP_CXX_COMPILER is defined equal to CMAKE_CXX_COMPILER while looking for rocblas (line 30)
92+
# if it is passed by user it is supposed to be different from standard compiler, than it is up
93+
# to the user provide the correct path with the correct library.
94+
if("${HIP_CXX_COMPILER}" STREQUAL "${CMAKE_CXX_COMPILER}" )
95+
# Verify that libclang_rt.builtins exists for current compiler
96+
if(EXISTS ${CLANGRT_BUILTINS} )
97+
message("libclang_rt found at " ${CLANGRT_BUILTINS})
98+
else()
99+
message(FATAL_ERROR "libclang_rt not found at " ${CLANGRT_BUILTINS}
100+
"\nCheck library availability for current CXX compiler. "
101+
"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."
102+
"If not possible skip rocBLAS benchmarks compilation")
103+
endif()
104+
else()
105+
message(WARNING "using CLANGRT_BUILTINS defined by user at " ${CLANGRT_BUILTINS})
106+
endif()
107+
91108
# Add individual benchmarks for each method
92109
foreach(rocblas_benchmark ${sources})
93110
get_filename_component(rocblas_bench_exec ${rocblas_benchmark} NAME_WE)

0 commit comments

Comments
 (0)