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

Commit

Permalink
Enabled benchmark build with AdaptiveCpp when supported
Browse files Browse the repository at this point in the history
  • Loading branch information
OuadiElfarouki committed Jan 17, 2024
1 parent a0ce855 commit 3c37048
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ option(BLAS_ENABLE_EXTENSIONS "Whether to enable portBLAS extensions" ON)
option(BLAS_ENABLE_COMPLEX "Whether to enable complex data type for supported operators" ON)

if (SYCL_COMPILER MATCHES "adaptivecpp" AND BLAS_ENABLE_COMPLEX)
message(STATUS "SYCL Complex data is not supported on AdaptiveCpp/hipSYCL")
message(STATUS "SYCL Complex data is not supported on AdaptiveCpp/hipSYCL. Complex
data type is disabled")
set(BLAS_ENABLE_COMPLEX OFF)
endif()

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ export LD_LIBRARY_PATH=[path/to/AdaptiveCpp/install/lib/hipSYCL:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=[path/to/AdaptiveCpp/install/lib/hipSYCL/llvm-to-backend:$LD_LIBRARY_PATH]
```

*Note :*
Some operator kernels are implemented using extensions / SYCL 2020 features not yet implemented
in AdaptiveCpp and are not supported when portBLAS is built with it. These operators include
`asum`, `nrm2`, `dot`, `sdsdot`, `rot`, `trsv`, `tbsv` and `tpsv`.

### Installing portBLAS
To install the portBLAS library (see `CMAKE_INSTALL_PREFIX` below)

Expand Down
17 changes: 17 additions & 0 deletions benchmark/portblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,29 @@ if(${BLAS_ENABLE_EXTENSIONS})
list(APPEND sources extension/reduction.cpp)
endif()

# Skip these benchmarks for AdaptiveCpp for SPIRV/OpenCL targets
# that use SYCL 2020 features like reduction or hang during execution
# (https://github.com/AdaptiveCpp/AdaptiveCpp/issues/1309)
set(ADAPTIVE_CPP_SKIP
blas1/asum.cpp
blas1/dot.cpp
blas1/sdsdot.cpp
blas1/nrm2.cpp
# Hang during execution (without failing)
blas3/gemm_batched.cpp
blas3/gemm_batched_strided.cpp
blas3/trsm.cpp
)

# Operators supporting COMPLEX types benchmarking
set(CPLX_OPS "gemm" "gemm_batched" "gemm_batched_strided")

# Add individual benchmarks for each method
foreach(portblas_bench ${sources})
get_filename_component(bench_exec ${portblas_bench} NAME_WE)
if(is_adaptivecpp AND ${portblas_bench} IN_LIST ADAPTIVE_CPP_SKIP)
continue()
endif()
add_executable(bench_${bench_exec} ${portblas_bench} main.cpp)
target_link_libraries(bench_${bench_exec} PRIVATE benchmark Clara::Clara portblas bench_info)
target_compile_definitions(bench_${bench_exec} PRIVATE -DBLAS_INDEX_T=${BLAS_BENCHMARK_INDEX_TYPE})
Expand Down
6 changes: 6 additions & 0 deletions cmake/Modules/SYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,10 @@ elseif(is_adaptivecpp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
get_target_property(SYCL_INCLUDE_DIRS AdaptiveCpp::acpp-rt INTERFACE_INCLUDE_DIRECTORIES)
set(HIP_BENCH_UNSUPPORTED_TARGETS "INTEL_GPU" "DEFAULT_CPU")
if(${BLAS_ENABLE_BENCHMARK} AND ${TUNING_TARGET} IN_LIST HIP_BENCH_UNSUPPORTED_TARGETS)
message(STATUS "Benchmarks are not supported when targetting OpenCL/LevelZero backend
devices. portBLAS Benchmarks are disabled.")
set(BLAS_ENABLE_BENCHMARK OFF)
endif()
endif()

0 comments on commit 3c37048

Please sign in to comment.