Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ endif()

project( rocblas LANGUAGES CXX )

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# ########################################################################
# NOTE: CUDA compiling path
# ########################################################################
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ rocBLASCI:
rocblas.paths.build_command = './install.sh -lasm_ci -c'

// Define test architectures, optional rocm version argument is available
def nodes = new dockerNodes(['gfx900 && ubuntu', 'gfx906 && centos7'], rocblas)
def nodes = new dockerNodes(['gfx900 && ubuntu', 'gfx906 && ubuntu'], rocblas)

boolean formatCheck = true

Expand Down
10 changes: 10 additions & 0 deletions clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ endif()
# This project may compile dependencies for clients
project( rocblas-clients LANGUAGES CXX )

if(EXISTS /etc/redhat-release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp=libgomp -pthread")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread")
endif()

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)


list( APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake )

include( build-options )
Expand Down
48 changes: 38 additions & 10 deletions clients/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ set( Boost_DETAILED_FAILURE_MSG ON )
set( Boost_ADDITIONAL_VERSIONS 1.65.1 1.65 )
set( Boost_USE_STATIC_LIBS OFF )

if(EXISTS /etc/redhat-release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp=libgomp -pthread")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -pthread")
endif()

find_package( Boost COMPONENTS program_options )

if( NOT Boost_FOUND )
Expand All @@ -20,6 +26,9 @@ if( NOT Boost_FOUND )
endif( )
endif( )

set( THREADS_PREFER_PTHREAD_FLAG ON )
find_package( Threads REQUIRED )

# Linking lapack library requires fortran flags
enable_language( Fortran )
find_package( cblas CONFIG REQUIRED )
Expand Down Expand Up @@ -49,16 +58,35 @@ target_include_directories( rocblas-bench
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)

# External header includes included as system files
target_include_directories( rocblas-bench
SYSTEM PRIVATE
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
)

target_link_libraries( rocblas-bench PRIVATE ${Boost_LIBRARIES} cblas lapack roc::rocblas )
if( EXISTS /etc/redhat-release)
set( OPENMP_INCLUDE_DIR /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/include )
set( OPENMP_LIBRARY /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libgomp.so )
set( CLANG_INCLUDE_DIR /opt/rocm/hcc/lib/clang/9.0.0/include )

# External header includes included as system files
target_include_directories( rocblas-bench
SYSTEM PRIVATE
$<BUILD_INTERFACE:${CLANG_INCLUDE_DIR}>
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${OPENMP_INCLUDE_DIR}>
)

target_link_libraries( rocblas-bench PRIVATE ${Boost_LIBRARIES} ${OPENMP_LIBRARY} cblas lapack roc::rocblas )
else()
# External header includes included as system files
target_include_directories( rocblas-bench
SYSTEM PRIVATE
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
)

target_link_libraries( rocblas-bench PRIVATE ${Boost_LIBRARIES} cblas lapack roc::rocblas )
endif()

get_target_property( HIPHCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )

Expand Down
41 changes: 31 additions & 10 deletions clients/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# For debugging, uncomment this
# set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O0" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")

# set( Boost_DEBUG ON )
set( Boost_USE_MULTITHREADED ON )
Expand Down Expand Up @@ -83,17 +84,37 @@ target_include_directories( rocblas-test
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
)

# External header includes included as system files
target_include_directories( rocblas-test
SYSTEM PRIVATE
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
)
if( EXISTS /etc/redhat-release)
set( OPENMP_INCLUDE_DIR /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/include )
set( OPENMP_LIBRARY /opt/rh/devtoolset-7/root/usr/lib/gcc/x86_64-redhat-linux/7/libgomp.so )
set( CLANG_INCLUDE_DIR /opt/rocm/hcc/lib/clang/9.0.0/include )

# External header includes included as system files
target_include_directories( rocblas-test
SYSTEM PRIVATE
$<BUILD_INTERFACE:${CLANG_INCLUDE_DIR}>
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${OPENMP_INCLUDE_DIR}>
)

target_link_libraries( rocblas-test PRIVATE ${GTEST_LIBRARIES} ${Boost_LIBRARIES} ${OPENMP_LIBRARY} cblas lapack roc::rocblas )
else()
# External header includes included as system files
target_include_directories( rocblas-test
SYSTEM PRIVATE
$<BUILD_INTERFACE:${HIP_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${HCC_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${GTEST_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${CBLAS_INCLUDE_DIRS}>
)

target_link_libraries( rocblas-test PRIVATE ${GTEST_LIBRARIES} ${Boost_LIBRARIES} cblas lapack roc::rocblas Threads::Threads )
target_link_libraries( rocblas-test PRIVATE ${GTEST_LIBRARIES} ${Boost_LIBRARIES} cblas lapack roc::rocblas Threads::Threads )
endif()

get_target_property( HIPHCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )

Expand Down
3 changes: 3 additions & 0 deletions clients/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ get_target_property( HIPHCC_LOCATION hip::hip_hcc IMPORTED_LOCATION_RELEASE )

set( rocblas_samples_common ../common/utility.cpp )

set( THREADS_PREFER_PTHREAD_FLAG ON )
find_package( Threads REQUIRED )

add_executable( example-sscal example_sscal.cpp ${rocblas_samples_common} )
add_executable( example-sgemm example_sgemm.cpp ${rocblas_samples_common} )
add_executable( example-sgemm-strided-batched example_sgemm_strided_batched.cpp ${rocblas_samples_common} )
Expand Down
3 changes: 3 additions & 0 deletions docker/dockerfile-build-centos
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ RUN yum install -y \
python36-pytest \
python36-setuptools \
PyYAML \
llvm7.0-devel \
llvm7.0-static \
libcxx-devel \
boost-devel \
numactl-libs \
rpm-build \
libgomp \
zlib-devel \
deltarpm

Expand Down
3 changes: 3 additions & 0 deletions docker/dockerfile-build-ubuntu-rock
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
python-yaml \
python3-yaml \
gfortran \
llvm-6.0-dev \
libboost-program-options-dev \
libnuma1 \
libpthread-stubs0-dev \
libomp-dev \
zlib1g-dev \
&& \
apt-get clean && \
Expand Down
16 changes: 8 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,16 @@ install_packages( )
# dependencies needed for rocblas and clients to build
local library_dependencies_ubuntu=( "make" "cmake-curses-gui" "pkg-config"
"python2.7" "python3" "python-yaml" "python3-yaml"
"llvm-6.0-dev"
"llvm-6.0-dev" "libomp-dev"
"hip_hcc" "rocm_smi64" "zlib1g-dev")
local library_dependencies_centos=( "epel-release"
"make" "cmake3" "rpm-build"
"python34" "PyYAML" "python3*-PyYAML"
"gcc-c++" "llvm7.0-devel" "llvm7.0-static"
"hip_hcc" "rocm_smi64" "zlib-devel" )
"hip_hcc" "rocm_smi64" "libgomp" "zlib-devel" )
local library_dependencies_fedora=( "make" "cmake" "rpm-build"
"python34" "PyYAML" "python3*-PyYAML"
"gcc-c++" "libcxx-devel"
"gcc-c++" "libcxx-devel" "libgomp"
"hip_hcc" "rocm_smi64" "zlib-devel" )

if [[ "${build_cuda}" == true ]]; then
Expand All @@ -140,9 +140,9 @@ install_packages( )
library_dependencies_fedora+=( "" ) # how to install cuda on fedora?
fi

local client_dependencies_ubuntu=( "gfortran" "libboost-program-options-dev" )
local client_dependencies_centos=( "gcc-gfortran" "boost-devel" )
local client_dependencies_fedora=( "gcc-gfortran" "boost-devel" )
local client_dependencies_ubuntu=( "gfortran" "libboost-program-options-dev" "libomp-dev")
local client_dependencies_centos=( "gcc-gfortran" "boost-devel" "libgomp")
local client_dependencies_fedora=( "gcc-gfortran" "boost-devel" "libgomp")

case "${ID}" in
ubuntu)
Expand Down Expand Up @@ -323,7 +323,7 @@ if [[ "${install_dependencies}" == true ]]; then
pushd .
printf "\033[32mBuilding \033[33mgoogletest & lapack\033[32m from source; installing into \033[33m/usr/local\033[0m\n"
mkdir -p ${build_dir}/deps && cd ${build_dir}/deps
${cmake_executable} -DBUILD_BOOST=OFF ../../deps
${cmake_executable} -lpthread -DBUILD_BOOST=OFF ../../deps
make -j$(nproc)
elevate_if_not_root make install
popd
Expand All @@ -339,7 +339,7 @@ pushd .
# #################################################
cmake_common_options=""
cmake_client_options=""
cmake_common_options="${cmake_common_options} -DTensile_LOGIC=${tensile_logic} -DTensile_CODE_OBJECT_VERSION=${tensile_cov}"
cmake_common_options="${cmake_common_options} -lpthread -DTensile_LOGIC=${tensile_logic} -DTensile_CODE_OBJECT_VERSION=${tensile_cov}"


# build type
Expand Down
3 changes: 3 additions & 0 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function( target_compile_features target_name )
endif( )
endfunction( )

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# ########################################################################
# target_link_libraries() override
# ########################################################################
Expand Down
3 changes: 3 additions & 0 deletions library/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ endfunction( )
# package_targets is used as a list of install target
set( package_targets rocblas )

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Set up Tensile Dependency
if( BUILD_WITH_TENSILE )
# If we want to build a shared rocblas lib, force Tensile to build as a static lib to absorb into rocblas
Expand Down