Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • wslda wslda
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wtools
  • wsldawslda
  • Wiki
  • Converting the toolkit to HIP

Last edited by Gabriel Wlazłowski Mar 17, 2023
Page history

Converting the toolkit to HIP

Hipify the code

To be able to use the toolkit with AMD ROCm you need to first hipify the code. Use provided script hipify.sh. The script uses hipify-perl conversion tool. You can download it from here. In the script you need to set correctly invocation of the hipify-perl tool.

# SETTINGS
HIPIFY_CMD="hipify-perl -hip-kernel-execution-syntax"

The script must be executed from the main folder of W-SLDA Toolkit:

gawlazlo@uan02:/project/project_465000150/share/wslda> ./hipify.sh 
---> Converting WSLDA to HIP environment
+ cd hpc-engine
+ mkdir -p hip
+ rm -rf *
+ for cufile in *.cu
+ hipify-perl -hip-kernel-execution-syntax -o hip/ccpca_dens.cpp ccpca_dens.cu
...
+ set +x
---> Conversion of WSLDA to HIP is DONE.

Compiling the code with HIP

In order to activate compilation with hipcc compiler (analog of nvcc compiler) add to Makefile flags HIPCC and HIPCCFLAGS. For example:

# COMPILERS
CXX=cc
# NVCC= commented intentionally, it is replaced by HIPCC below
HIPCC=hipcc
PYTHON=python

# DIRECTORY SETTINGS 
WSLDADIR=$(WSLDA)
OBJDIR=./obj/
# folder where executable binary will be placed (will be created automatically)
BINDIR=./

# COMPILER FLAGS
# You may need to add also info about the platform 
# and path to HIP include files for C compiler
CFLAGS=-D__HIP_PLATFORM_AMD__ -I$(HIP_PATH)/include
# NVCCFLAGS= commented intentionally, it is replaced by HIPCCFLAGS below
HIPCCFLAGS=-std=c++14 --offload-arch=gfx90a 

# LIBRARIES
# You need to link to amdhip64 and hipfft libs
LIBS= -L$(HIP_LIB_PATH) -lamdhip64 -L$(EBROOTHIPFFT)/lib -lhipfft -lm

Example

See for LUMI supercomputer templates.

Clone repository

Content of Documentation
Official webpage
W-BSK Toolkit