-
Notifications
You must be signed in to change notification settings - Fork 78
Home
hipBLAS is a thin interface that can be called from hcc or nvcc platforms.
Linux only
hipBLAS is written with HiP so it can run with AMD's ROCM or NVIDIA's CUDA hardware.
For AMD platform and Ubuntu, ROCM can be installed with sudo apt-get install rocm
. For other platforms, see install ROCM. HIP is contained in ROCM.
To verify the installation of ROCM see install ROCM
Alternatively, for either AMD or NVIDIA, install HIP. To check that HIP is installed, enter the command hipconfig
. This should output information on the HIP installation.
On Ubuntu you can install cmake, cmake-gui, and ccmake with the following:
sudo apt-get update
sudo apt-get install cmake
sudo apt-get install cmake-gui
sudo apt-get install cmake-curses-gui
hipBLAS needs to access the include file /opt/rocm/rocblas/include/rocblas.h. Install rocBLAS in the directory /opt/rocm/rocblas. Installation instructions are at the Wiki.
Clone hipBLAS with the following commands: (Here it is assumed you will clone hipBLAS into the directory ~/repos/hipBLAS. You can choose to clone into any directory of your choice.)
cd ~; mkdir -p repos; cd repos
git clone -b master https://github.com/AMDComputeLibraries/hipBLAS.git
Configure using ccmake with the following:
mkdir ~/repos/hipBLAS-build
cd ~/repos/hipBLAS-build
cmake ../hipBLAS -DBUILD_LIBRARY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-fPIC
Build with
cd ~/repos/hipBLAS-build
make VERBOSE=1 >& make.lib.out
Install with the following:
cd ~/repos/hipBLAS-build/library-build
make install
After installing, the library libhipblas-hcc.a
will be in the directory ~/repos/hipBLAS-build/library-package/lib
. The include file hipblas.h
will be in the directory ~/repos/hipBLAS-build/library-package/include
. If you
need the package installed in /opt/rocm/hipblas, copy with the following commands:
sudo mkdir -p /opt/rocm/hipblas
sudo cp -r ~/repos/hipBLAS-build/library-package /opt/rocm/hipblas
If hipcc is used to compile code that calls hipBLAS the correct platform is automatically detected. If another compiler is used, one and only one of the following macros should be defined for hcc and nvcc respectively:
__HIP_PLATFORM_HCC__
__HIP_PLATFORM_NVCC__
- In the hipBLAS configure step the command hipconfig is called to determine if hipBLAS should be built for hcc or nvcc.
- Code that calls hipBLAS functions will include the header hipblas.h. In this file hipblas.h one and only one of the following macros is defined, and this determines of the platform is hcc or nvcc:
__HIP_PLATFORM_HCC__
,__HIP_PLATFORM_HCC__
. The compiler hipcc automatically defines the correct macro. If you use another compiler you must define the appropriate macro in your compile flags.
Build hipblas