Skip to content

Commit

Permalink
RPP Updates (#124)
Browse files Browse the repository at this point in the history
* CI - CentOS 7

* Add HIP Backend to CentOS 7

* CentOS 7 - Enable Clang 5

* macOS Package Fix

* Jenkins Updates

* HIP Backend - ROCm 5.3+ updates

* Readme & Changelog updates

* Version 0.97 Release
  • Loading branch information
kiritigowda authored Sep 16, 2022
1 parent 1688474 commit ed20ff1
Show file tree
Hide file tree
Showing 12 changed files with 220 additions and 283 deletions.
10 changes: 10 additions & 0 deletions .github/info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>ExecutableFileName</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
</dict>
</plist>
Binary file added .github/rpp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
String buildTypeArg = debug ? '-DCMAKE_BUILD_TYPE=Debug' : '-DCMAKE_BUILD_TYPE=Release'
String buildTypeDir = debug ? 'debug' : 'release'
String backend = ''
String enableSCL = 'echo build-rpp'

if (platform.jenkinsLabel.contains('centos')) {
backend = 'CPU'
if (platform.jenkinsLabel.contains('centos7')) {
enableSCL = 'source scl_source enable llvm-toolset-7'
}
}
else if (platform.jenkinsLabel.contains('ubuntu18')) {
backend = 'OCL'
Expand All @@ -27,7 +31,7 @@ def runCompileCommand(platform, project, jobName, boolean debug=false, boolean s
echo Build RPP - ${buildTypeDir}
cd ${project.paths.project_build_prefix}
mkdir -p build/${buildTypeDir} && cd build/${buildTypeDir}
cmake -DBACKEND=${backend} ${buildTypeArg} ../..
(${enableSCL}; cmake -DBACKEND=${backend} ${buildTypeArg} ../..)
make -j\$(nproc)
sudo make install
sudo make package
Expand Down
4 changes: 2 additions & 2 deletions .jenkins/precheckin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ci: {
def propertyList = ["compute-rocm-dkms-no-npi-hipclang":[pipelineTriggers([cron('0 1 * * 0')])]]
propertyList = auxiliary.appendPropertyList(propertyList)

def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu18:['gfx908'], ubuntu20:['gfx906'], centos8:['gfx906'], centos8:['gfx908']])]
def jobNameList = ["compute-rocm-dkms-no-npi-hipclang":([ubuntu22:['gfx908'], ubuntu20:['gfx906'], centos8:['gfx908'], centos7:['gfx906']])]
jobNameList = auxiliary.appendJobNameList(jobNameList)

propertyList.each
Expand Down Expand Up @@ -75,4 +75,4 @@ ci: {
runCI([ubuntu18:['gfx906']], urlJobName)
}
}
}
}
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,64 @@
### Online Documentation
[RPP Documentation](https://gpuopen-professionalcompute-libraries.github.io/rpp/)

### RPP 0.97

#### Added
* Support for CentOS 7 & SLES 15 SP2
* Support for ROCm 5.3+
* Support for Ubuntu 22.04

#### Optimizations
* Readme Updates

#### Changed

* CMakeList Updates

#### Fixed
* Minor bugs and warnings

### Tested Configurations
* Linux distribution
+ Ubuntu - `20.04` / `22.04`
+ CentOS - `7`/`8`
* ROCm: rocm-core - `5.3.0.50300-36`
* Clang - Version `5.0.1` and above
* CMake - Version `3.22.3`
* Boost - Version `1.72`
* IEEE 754-based half-precision floating-point library - Version `1.12.0`

### Known issues
*

### RPP 0.96

#### Added
* New Tests

#### Optimizations
* Readme Updates

#### Changed

* `CPU`/`HIP`/`OpenCL` Backend Updates

#### Fixed
* Minor bugs and warnings

### Tested Configurations
* Linux distribution
+ Ubuntu - `18.04` / `20.04`
+ CentOS - `8`
* ROCm: rocm-core - `5.2.0.50200-65`
* Clang - Version `6.0+`
* CMake - Version `3.22.3`
* Boost - Version `1.72`
* IEEE 754-based half-precision floating-point library - Version `1.12.0`

### Known issues
* RPP Build on CentOS 7 & SLES SP2 Not Supported

### RPP 0.95

#### Added
Expand Down
73 changes: 35 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(CMAKE_CXX_COMPILER clang++)
set(CMAKE_CXX_STANDARD 14)

project(amd_rpp CXX)
set(VERSION "0.96")
set(VERSION "0.97")

set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "Library install directory")
include(GNUInstallDirs)
Expand Down Expand Up @@ -95,10 +95,14 @@ if(NOT CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
# -O0 -- Don't Optimize output file; -g -- generate debugging information; -Og -- Optimize for debugging experience rather than speed or size
# -O0 -- Don't Optimize output file
# -g -- generate debugging information
# -Og -- Optimize for debugging experience rather than speed or size
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g -Og")
else()
# -O3 -- Optimize output file; TBD:CHECK -Ofast - Optimize for speed disregarding exact standards compliance; -DNDEBUG -- turn off asserts
# -O3 -- Optimize output file
# TBD:Verify Requirement -Ofast - Optimize for speed disregarding exact standards compliance
# -DNDEBUG -- turn off asserts
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Ofast -DNDEBUG")
endif()
message("-- ${BoldBlue}AMD RPP Build Type -- ${CMAKE_BUILD_TYPE}${ColourReset}")
Expand All @@ -110,7 +114,7 @@ else()
endif()

# CMake checks and setups
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "${Red}${PROJECT_NAME} -- In-source builds are not allowed. Invoke cmake from build directory${ColourReset}")
endif()
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
Expand Down Expand Up @@ -172,34 +176,29 @@ if("${BACKEND}" STREQUAL "HIP")
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed")
endif()
endif()
list(APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake/hip ${HIP_PATH}/cmake)
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH})
find_package(HIP QUIET)
if(HIP_FOUND)
message("-- ${White}${PROJECT_NAME} -- Using HIP - Path:" ${HIP_PATH} "\tVersion:" ${HIP_VERSION} "\tCompiler:" ${HIP_COMPILER}${ColourReset})
if(HIP_COMPILER STREQUAL clang)
# TBD: Set external flag to notify GPU_SUPPORT and HIP backend availability - Compatible with rocAL and MIVisionX
add_definitions(-DGPU_SUPPORT)
# For cmakedefine01 in rpp_backend.h.in
set(RPP_BACKEND_HIP 1)
# To use RPP_BACKEND_HIP
add_definitions(-DRPP_BACKEND_HIP=${RPP_BACKEND_HIP})
set(COMPILER_FOR_HIP ${ROCM_PATH}/${CMAKE_INSTALL_BINDIR}/hipcc)
include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR})
link_directories(${HIP_PATH}/${CMAKE_INSTALL_LIBDIR})
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${HIP_PATH}/${CMAKE_INSTALL_LIBDIR}/libamdhip64.so)

# Add modules
set(MODULES_LIST modules)
foreach(MOD_NAME ${MODULES_LIST})
add_subdirectory(${CMAKE_SOURCE_DIR}/src/${MOD_NAME})
endforeach(MOD_NAME)

message("-- ${Green}${PROJECT_NAME} set to build with HIP backend${ColourReset}")
else()
message("-- ${Yellow}${PROJECT_NAME} -- Unsupported HIP compiler")
set(BACKEND "CPU")
message("-- ${Yellow}${PROJECT_NAME} set to build with CPU backend${ColourReset}")
endif()
if(HIP_FOUND)
message("-- ${White}${PROJECT_NAME} -- Using HIP - Path:" ${HIP_PATH} "\tVersion:" ${HIP_VERSION} "\tCompiler:" ${HIP_COMPILER}${ColourReset})
# TBD: Set external flag to notify GPU_SUPPORT and HIP backend availability - Compatible with rocAL and MIVisionX
add_definitions(-DGPU_SUPPORT)
# For cmakedefine01 in rpp_backend.h.in
set(RPP_BACKEND_HIP 1)
# To use RPP_BACKEND_HIP
add_definitions(-DRPP_BACKEND_HIP=${RPP_BACKEND_HIP})
set(COMPILER_FOR_HIP ${ROCM_PATH}/llvm/bin/clang++)
include_directories(${ROCM_PATH}/${CMAKE_INSTALL_INCLUDEDIR})
link_directories(${HIP_PATH}/${CMAKE_INSTALL_LIBDIR})
# link To HIP Host library -- [hip::host] to use host API
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} hip::host)

# Add modules
set(MODULES_LIST modules)
foreach(MOD_NAME ${MODULES_LIST})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/${MOD_NAME})
endforeach(MOD_NAME)

message("-- ${Green}${PROJECT_NAME} set to build with HIP backend${ColourReset}")
else()
set(BACKEND "CPU")
message("-- ${Yellow}HIP not found! ${PROJECT_NAME} set to build with CPU backend${ColourReset}")
Expand All @@ -219,13 +218,11 @@ elseif("${BACKEND}" STREQUAL "OCL")
# Add modules
set(MODULES_LIST modules)
foreach(MOD_NAME ${MODULES_LIST})
add_subdirectory(${CMAKE_SOURCE_DIR}/src/${MOD_NAME})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/${MOD_NAME})
endforeach(MOD_NAME)

# Set compiler and flags
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${OpenCL_LIBRARIES})
# set(INCLUDE_LIST ${OpenCL_INCLUDE_DIRS} ${INCLUDE_LIST}) # using substitute since OpenCL_INCLUDE_DIRS points to a deprecated /opt/rocm/opencl/include
set(INCLUDE_LIST ${INCLUDE_LIST})
add_definitions(-DRPP_CACHE_DIR="${CACHE_DIR}")

message("-- ${Green}${PROJECT_NAME} set to build with GPU_SUPPORT using OpenCL backend${ColourReset}")
Expand All @@ -240,7 +237,7 @@ if("${BACKEND}" STREQUAL "CPU")
# Add modules
set(MODULES_LIST modules)
foreach(MOD_NAME ${MODULES_LIST})
add_subdirectory(${CMAKE_SOURCE_DIR}/src/${MOD_NAME})
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/${MOD_NAME})
endforeach(MOD_NAME)
endif()

Expand Down Expand Up @@ -297,7 +294,7 @@ add_subdirectory(addkernels)
# install RPP libs -- {ROCM_PATH}/lib
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
# install RPP include files -- {ROCM_PATH}/include/rpp/
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rpp PATTERN "*.h.in" EXCLUDE)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rpp PATTERN "*.h.in" EXCLUDE)
install(FILES ${PROJECT_BINARY_DIR}/include/rpp_backend.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rpp)

# Set package information
Expand Down Expand Up @@ -348,8 +345,8 @@ set(CPACK_RPM_PACKAGE_AUTOREQPROV "no")
if(APPLE)
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_BUNDLE_ICON ${CPACK_PACKAGE_ICON})
set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/.github/info.plist")
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/.github/rpp.png")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/.github/info.plist")
else()
set(CPACK_GENERATOR "TGZ;ZIP")
if(EXISTS ${MAKE_NSIS_EXE})
Expand Down
Loading

0 comments on commit ed20ff1

Please sign in to comment.