Skip to content

Commit

Permalink
ROCm 4.1 Updates - Remove extractkernel dependency (#46)
Browse files Browse the repository at this point in the history
* Remove extractkernel dependency

* Readme changes

* Minor fix

* Use OpenCV 3.4.0 to match with MIVisionX
  • Loading branch information
r-abishek committed Mar 27, 2021
1 parent cc0a2be commit cfdaced
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 119 deletions.
18 changes: 3 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright (c) 2015 - 2020 Advanced Micro Devices, Inc. All rights reserved.
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -190,18 +190,6 @@ find_package(OpenCL REQUIRED) # OpenCL_INCLUDE_DIRS, OpenCL_LIBRARIES

set( MODULES_LIST modules)

# look for and register extractkernel
find_program(EXTRACTKERNEL_BIN extractkernel
PATH_SUFFIXES bin
PATHS ${ROCM_PATH}
)
if(EXTRACTKERNEL_BIN)
message(STATUS "${Green}extractkernel found: ${EXTRACTKERNEL_BIN}${ColourReset}")
set(EXTRACTKERNEL_BIN "${EXTRACTKERNEL_BIN}")
else()
message(FATAL_ERROR "${Red}extractkernel not found${ColourReset}")
endif()

foreach (MOD_NAME ${MODULES_LIST})
add_subdirectory(${CMAKE_SOURCE_DIR}/src/${MOD_NAME})
endforeach(MOD_NAME)
Expand Down
31 changes: 28 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,41 @@ RPP is developed for **Linux** operating system.

- [ROCm](https://github.com/RadeonOpenCompute/ROCm#installing-from-amd-rocm-repositories)

- Clang Version `6.0`

sudo apt-get install clang-6.0
sudo ln -s /usr/bin/clang-6.0 /usr/bin/clang
sudo ln -s /usr/bin/clang++-6.0 /usr/bin/clang++

- CMake Version `3.5` or higher

- Boost Version `1.72` or higher (install from source - <https://www.boost.org/>)
sudo apt-get install cmake

- Boost Version `1.72` (install from source: Easy Build and Install - <https://www.boost.org/doc/libs/1_72_0/more/getting_started/unix-variants.html#easy-build-and-install>)

wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz
tar -xzvf boost_1_72_0.tar.gz
cd boost_1_72_0
./bootstrap.sh
./b2 install

- IEEE 754-based half-precision floating-point library - half.hpp
```

wget https://sourceforge.net/projects/half/files/half/1.12.0/half-1.12.0.zip
unzip half-1.12.0.zip -d half-files
sudo cp half-files/include/half.hpp /usr/local/include/
```

## Prerequisites for Test Suite
- OpenCV 3.4.0

wget https://github.com/opencv/opencv/archive/3.4.0.zip
unzip 3.4.0.zip
cd opencv-3.4.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
make -j<number of threads>
sudo make install

## Supported Functionalities and Variants

Expand Down
2 changes: 0 additions & 2 deletions src/modules/cl/hip_build_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ boost::filesystem::path HipBuild(boost::optional<TmpDir>& tmp_dir,
params + filename + " -o " + bin_file.string());
if(!boost::filesystem::exists(bin_file))
RPP_THROW(filename + " failed to compile");
// call extract kernel
tmp_dir->Execute("/opt/rocm/bin/extractkernel", " -i " + bin_file.string());
auto hsaco = std::find_if(boost::filesystem::directory_iterator{tmp_dir->path},
{},
[](auto entry) { return (entry.path().extension() == ".hsaco"); });
Expand Down
2 changes: 0 additions & 2 deletions src/modules/hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ endif()
# add_definitions(-DRPP_BACKEND_HIP)
add_definitions( -DHIP_OC_COMPILER=${HIP_OC_COMPILER})

add_definitions(-DEXTRACTKERNEL_BIN=${EXTRACTKERNEL_BIN})

set_target_properties(${PROJECT_NAME} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_link_libraries (${PROJECT_NAME} ${OpenCL_LIBRARIES} )
target_include_directories( ${PROJECT_NAME}
Expand Down
95 changes: 0 additions & 95 deletions src/modules/hip/\

This file was deleted.

2 changes: 0 additions & 2 deletions src/modules/hip/hip_build_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ boost::filesystem::path HipBuild(boost::optional<TmpDir>& tmp_dir,
params + filename + " -o " + bin_file.string());
if(!boost::filesystem::exists(bin_file))
RPP_THROW(filename + " failed to compile");
// call extract kernel
tmp_dir->Execute("/opt/rocm/bin/extractkernel", " -i " + bin_file.string());
auto hsaco = std::find_if(boost::filesystem::directory_iterator{tmp_dir->path},
{},
[](auto entry) { return (entry.path().extension() == ".hsaco"); });
Expand Down

0 comments on commit cfdaced

Please sign in to comment.