From 7a2913937480c5034a9310583557fe4e34cc2b5d Mon Sep 17 00:00:00 2001 From: Hansel Yang Date: Sun, 22 Oct 2023 21:58:03 -0700 Subject: [PATCH] Prerequisites - Boost removed (#231) * Bump rocm-docs-core from 0.24.0 to 0.24.1 in /docs/.sphinx (#219) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.24.0...v0.24.1) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.24.1 to 0.24.2 in /docs/.sphinx (#222) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.1 to 0.24.2. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.24.1...v0.24.2) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.24.2 to 0.25.0 in /docs/.sphinx (#225) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.24.2 to 0.25.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.24.2...v0.25.0) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump rocm-docs-core from 0.25.0 to 0.26.0 in /docs/.sphinx (#228) Bumps [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core) from 0.25.0 to 0.26.0. - [Release notes](https://github.com/RadeonOpenCompute/rocm-docs-core/releases) - [Changelog](https://github.com/RadeonOpenCompute/rocm-docs-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/RadeonOpenCompute/rocm-docs-core/compare/v0.25.0...v0.26.0) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ENABLE ASAN packaging RPP (#227) * ENABLE ASAN packaging RPP * Add LICENSE File to RPP Package * Update README.md Pre-reqs * RPP Doxygen Update 2 (#226) * Remove rpp core * Doxygen fixes for rpp.h * Update enum values per line to 1 * Doxygen fixes for rppdefs.h * Doxygen fixes for rppi.h * Doxygen fixes for rppt.h * Doxygen fixes for rppversion.h * Rename Filter struct to GenericFilter to avoid Doxygen autoreference * Add deprecated docs for image ops * Doxygen fixes for all rppi headers * Doxygen fixes for all rppt headers, and replace \ingroup with \addtogroup * Change deprecation note - "To be deprecated" * Add \deprecated flag * Minor fix * Add output samples for doxygen * Add doxygen input * Fix docs for brightness * Add correct image path to Doxyfile * Add input/output images for brightness * Fix doxygen for brightness, blend and gamma correction * Change to add "Sample" to docs * Fix doxygen for color_cast, color_jitter, color_twist * Fix all doxygen docs for color augmentations * Fix doxygen for filter funcs * doxygen fixes for data exchange ops * Add sample second input to docs * Add more sample ouputs for doxygen docs * Fix doxygen docs for gridmask and spatter * Fix docs for swap_channels * Fix doxygen docs for snp, shot and gaussian noise * Fix doxygen docs for blend and non linear blend * Fix doxygen docs for statistical ops * remove boost library * cmake fix * code cleanup * suppress nodiscard attribute error * filesystem modification * filesystem modification * code cleanup * data type fix --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: arvindcheru <90783369+arvindcheru@users.noreply.github.com> Co-authored-by: Kiriti Gowda Co-authored-by: Abishek <52214183+r-abishek@users.noreply.github.com> --- CHANGELOG.md | 1 + CMakeLists.txt | 12 +- README.md | 11 -- docker/rpp-on-ubuntu20.dockerfile | 10 +- docker/rpp-on-ubuntu22.dockerfile | 10 +- docs/prereq.md | 10 -- include/{config.h => filesystem.h} | 9 +- include/rppt_tensor_geometric_augmentations.h | 2 +- .../rppt_tensor_morphological_operations.h | 2 +- src/include/cl/rpp/util.hpp | 41 ------- src/include/common/rpp/binary_cache.hpp | 8 +- src/include/common/rpp/handle.hpp | 2 - src/include/common/rpp/handle_lock.hpp | 110 ------------------ src/include/common/rpp/hip_build_utils.hpp | 6 +- src/include/common/rpp/kernel.hpp | 2 - src/include/common/rpp/op_kernel_args.hpp | 3 +- src/include/common/rpp/tmp_dir.hpp | 4 +- src/include/common/rpp/write_file.hpp | 4 +- src/include/hip/rpp/hip_kernels.hpp | 2 + src/include/hip/rpp/hipoc_program.hpp | 7 +- src/modules/CMakeLists.txt | 4 +- src/modules/binary_cache.cpp | 27 +++-- src/modules/cl/clhelper.cpp | 2 +- src/modules/cl/gcn_asm_utils.cpp | 6 +- src/modules/cl/handleocl.cpp | 25 ++-- src/modules/cl/hip_build_utils.cpp | 14 +-- src/modules/cl/ocl_kernel.cpp | 3 - src/modules/cl/temp_file.cpp | 3 +- src/modules/cl/tmp_dir.cpp | 12 +- src/modules/cl/utilocl.cpp | 2 - src/modules/handlehost.cpp | 2 - src/modules/hip/handlehip.cpp | 9 +- src/modules/hip/hip_build_utils.cpp | 14 +-- src/modules/hip/hipoc_kernel.cpp | 4 +- src/modules/hip/hipoc_program.cpp | 16 +-- src/modules/hip/tmp_dir.cpp | 12 +- src/modules/logger.cpp | 1 - utilities/examples/brightness/CMakeLists.txt | 5 - .../examples/brightness/brightness_hip.h | 1 - .../HIP_NEW/CMakeLists.txt | 5 - .../HOST_NEW/CMakeLists.txt | 7 +- .../OCL_NEW/CMakeLists.txt | 7 +- .../rpp-unittests/HIP_NEW/CMakeLists.txt | 7 +- .../rpp-unittests/HOST_NEW/CMakeLists.txt | 7 +- .../rpp-unittests/OCL_NEW/CMakeLists.txt | 7 +- utilities/test_suite/HIP/CMakeLists.txt | 5 - utilities/test_suite/HOST/CMakeLists.txt | 5 - utilities/test_suite/rpp_test_suite_common.h | 3 +- 48 files changed, 111 insertions(+), 360 deletions(-) rename include/{config.h => filesystem.h} (80%) delete mode 100644 src/include/cl/rpp/util.hpp delete mode 100644 src/include/common/rpp/handle_lock.hpp diff --git a/CHANGELOG.md b/CHANGELOG.md index 310177b6d..482aa241a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ #### Changed * Documentation +* Replaced the boost functions with std c++ library to remove boost library dependency #### Fixed * OCL Backend diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bdb868f6..6de2254b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ cmake_minimum_required(VERSION 3.5) set(CMAKE_CXX_COMPILER clang++) -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) project(rpp CXX) @@ -120,13 +120,8 @@ if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") endif() list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -# BOOST -option(Boost_USE_STATIC_LIBS "Use boost static libraries" OFF) -set(BOOST_COMPONENTS filesystem system) -add_definitions(-DBOOST_ALL_NO_LIB=1) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) +# Filesystem support +set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs) # OpenMP find_package(OpenMP REQUIRED) @@ -262,6 +257,7 @@ else() message("-- ${Red}${PROJECT_NAME} set to build without ENABLE_SIMD_INTRINSICS${ColourReset}") endif() + set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++) message("-- ${White}${PROJECT_NAME} -- Using Compiler - Path:" ${CMAKE_CXX_COMPILER} "\tVersion:" ${CMAKE_CXX_COMPILER_VERSION} "\tCompiler:" ${CMAKE_CXX_COMPILER_ID}${ColourReset}) message("-- ${White}${PROJECT_NAME} -- CMAKE_CXX_FLAGS:${CMAKE_CXX_FLAGS}${ColourReset}") diff --git a/README.md b/README.md index c1db5b5ea..2e7f1beb0 100644 --- a/README.md +++ b/README.md @@ -80,17 +80,6 @@ doxygen .Doxyfile * CMake Version `3.5` and above -* Boost Version `1.66` and above - ``` - wget https://boostorg.jfrog.io/artifactory/main/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 --prefix=${RPP_DEPS_LOCATION} --with-python=python3 - ./b2 install - ``` - + **NOTE:** [Install from source](https://www.boost.org/doc/libs/1_72_0/more/getting_started/unix-variants.html#easy-build-and-install) - + **--prefix=${RPP_DEPS_LOCATION}:** `ENV RPP_DEPS_LOCATION=/usr/local/rpp-deps` - * IEEE 754-based half-precision floating-point library - half.hpp ``` diff --git a/docker/rpp-on-ubuntu20.dockerfile b/docker/rpp-on-ubuntu20.dockerfile index 9ea94ce91..9be10e486 100644 --- a/docker/rpp-on-ubuntu20.dockerfile +++ b/docker/rpp-on-ubuntu20.dockerfile @@ -16,15 +16,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install initramfs-tools libnuma-de sudo apt-get install -y ./${ROCM_INSTALLER_PACKAGE} && \ sudo apt-get update -y && \ sudo amdgpu-install -y --usecase=graphics,rocm -# install rpp dependencies - half.hpp & boost +# install rpp dependencies - half.hpp RUN 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 && mkdir -p /usr/local/include/half && cp half-files/include/half.hpp /usr/local/include/half && \ - wget https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.bz2 && tar xjvf boost_1_72_0.tar.bz2 && \ - cd boost_1_72_0 && ./bootstrap.sh --prefix=/usr/local --with-python=python3 && \ - ./b2 stage -j16 threading=multi link=shared cxxflags="-std=c++11" && \ - ./b2 install threading=multi link=shared --with-system --with-filesystem && \ - ./b2 stage -j16 threading=multi link=static cxxflags="-std=c++11 -fpic" cflags="-fpic" && \ - ./b2 install threading=multi link=static --with-system --with-filesystem + unzip half-1.12.0.zip -d half-files && mkdir -p /usr/local/include/half && cp half-files/include/half.hpp /usr/local/include/half ENV RPP_WORKSPACE=/workspace WORKDIR $RPP_WORKSPACE diff --git a/docker/rpp-on-ubuntu22.dockerfile b/docker/rpp-on-ubuntu22.dockerfile index ffc8f223d..253d752f9 100644 --- a/docker/rpp-on-ubuntu22.dockerfile +++ b/docker/rpp-on-ubuntu22.dockerfile @@ -16,16 +16,10 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install initramfs-tools libnuma-de sudo apt-get install -y ./${ROCM_INSTALLER_PACKAGE} && \ sudo apt-get update -y && \ sudo amdgpu-install -y --usecase=graphics,rocm -# install rpp dependencies - half.hpp & boost +# install rpp dependencies - half.hpp RUN 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 && mkdir -p /usr/local/include/half && cp half-files/include/half.hpp /usr/local/include/half -RUN apt-get -y install sqlite3 libsqlite3-dev libtool build-essential && \ - wget https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2 && tar xjvf boost_1_80_0.tar.bz2 && \ - cd boost_1_80_0 && ./bootstrap.sh --prefix=/usr/local --with-python=python3 && \ - ./b2 stage -j16 threading=multi link=shared cxxflags="-std=c++11" && \ - sudo ./b2 install threading=multi link=shared --with-system --with-filesystem && \ - ./b2 stage -j16 threading=multi link=static cxxflags="-std=c++11 -fpic" cflags="-fpic" && \ - sudo ./b2 install threading=multi link=static --with-system --with-filesystem +RUN apt-get -y install sqlite3 libsqlite3-dev libtool build-essential ENV RPP_WORKSPACE=/workspace WORKDIR $RPP_WORKSPACE diff --git a/docs/prereq.md b/docs/prereq.md index 0b2b22aa8..6b4ef0d46 100644 --- a/docs/prereq.md +++ b/docs/prereq.md @@ -35,16 +35,6 @@ * CMake Version `3.5` and above -* Boost Version `1.72` and above - ``` - wget https://boostorg.jfrog.io/artifactory/main/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 - ``` - + **NOTE:** [Install from source](https://www.boost.org/doc/libs/1_72_0/more/getting_started/unix-variants.html#easy-build-and-install) - * IEEE 754-based half-precision floating-point library - half.hpp ``` diff --git a/include/config.h b/include/filesystem.h similarity index 80% rename from include/config.h rename to include/filesystem.h index e161696a5..b192e4b0f 100644 --- a/include/config.h +++ b/include/filesystem.h @@ -20,5 +20,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -//#cmakedefine HIP_OC_COMPILER "@HIP_OC_COMPILER@" -#define RPP_GPU_SYNC 0 +#if __cplusplus >= 201703L && __has_include() + #include + namespace fs = std::filesystem; +#elif __has_include() + #include + namespace fs = std::experimental::filesystem; +#endif \ No newline at end of file diff --git a/include/rppt_tensor_geometric_augmentations.h b/include/rppt_tensor_geometric_augmentations.h index fb6ca05eb..304e75c4c 100644 --- a/include/rppt_tensor_geometric_augmentations.h +++ b/include/rppt_tensor_geometric_augmentations.h @@ -404,4 +404,4 @@ RppStatus rppt_rotate_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstP #ifdef __cplusplus } #endif -#endif // RPPT_TENSOR_GEOMETRIC_AUGMENTATIONS_H +#endif // RPPT_TENSOR_GEOMETRIC_AUGMENTATIONS_H \ No newline at end of file diff --git a/include/rppt_tensor_morphological_operations.h b/include/rppt_tensor_morphological_operations.h index 7461beb7d..52fc1465d 100644 --- a/include/rppt_tensor_morphological_operations.h +++ b/include/rppt_tensor_morphological_operations.h @@ -96,4 +96,4 @@ RppStatus rppt_dilate_gpu(RppPtr_t srcPtr, RpptDescPtr srcDescPtr, RppPtr_t dstP #ifdef __cplusplus } #endif -#endif // RPPT_TENSOR_MORPHOLOGICAL_OPERATIONS_H +#endif // RPPT_TENSOR_MORPHOLOGICAL_OPERATIONS_H \ No newline at end of file diff --git a/src/include/cl/rpp/util.hpp b/src/include/cl/rpp/util.hpp deleted file mode 100644 index 9608d7661..000000000 --- a/src/include/cl/rpp/util.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/******************************************************************************* - * - * MIT License - * - * Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc. - * - * 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - *******************************************************************************/ -#ifndef RPP_UTIL_HPP_ -#define RPP_UTIL_HPP_ - -#include -#include - -#include - -namespace rpp { - -struct Handle; - - -} // namespace rpp - -#endif // _RPP_UTIL_HPP_ diff --git a/src/include/common/rpp/binary_cache.hpp b/src/include/common/rpp/binary_cache.hpp index 782bfcf0c..2c01e0e0f 100644 --- a/src/include/common/rpp/binary_cache.hpp +++ b/src/include/common/rpp/binary_cache.hpp @@ -28,21 +28,21 @@ #define GUARD_RPP_BINARY_CACHE_HPP #include -#include +#include "filesystem.h" namespace rpp { -boost::filesystem::path GetCacheFile(const std::string& device, +fs::path GetCacheFile(const std::string& device, const std::string& name, const std::string& args, bool is_kernel_str); -boost::filesystem::path GetCachePath(); +fs::path GetCachePath(); std::string LoadBinary(const std::string& device, const std::string& name, const std::string& args, bool is_kernel_str = false); -void SaveBinary(const boost::filesystem::path& binary_path, +void SaveBinary(const fs::path& binary_path, const std::string& device, const std::string& name, const std::string& args, diff --git a/src/include/common/rpp/handle.hpp b/src/include/common/rpp/handle.hpp index 7dc29e49b..1084a8917 100644 --- a/src/include/common/rpp/handle.hpp +++ b/src/include/common/rpp/handle.hpp @@ -32,10 +32,8 @@ #include #include #include -#include #include "rpp.h" -#include "config.h" #include "rppdefs.h" #include "rpp/common.hpp" #include "rpp/kernel.hpp" diff --git a/src/include/common/rpp/handle_lock.hpp b/src/include/common/rpp/handle_lock.hpp deleted file mode 100644 index 17c468d20..000000000 --- a/src/include/common/rpp/handle_lock.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/******************************************************************************* - * - * MIT License - * - * Copyright (c) 2019 - 2023 Advanced Micro Devices, Inc. - * - * 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 - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - *******************************************************************************/ - -#ifndef GUARD_RPP_HANDLE_LOCK_HPP -#define GUARD_RPP_HANDLE_LOCK_HPP - -#include -#include -#include -#include -#include - -#include "config.h" -#include "rpp/errors.hpp" - -namespace rpp { - -#define RPP_DECLARE_HANDLE_MUTEX(x) \ - struct x \ - { \ - static const char* value() { return ".rpp-" #x ".lock"; } \ - }; - -#if RPP_GPU_SYNC -RPP_DECLARE_HANDLE_MUTEX(gpu_handle_mutex) -#define RPP_HANDLE_LOCK \ - auto rpp_handle_lock_guard_##__LINE__ = rpp::get_handle_lock(rpp::gpu_handle_mutex{}); -#else -#define RPP_HANDLE_LOCK -#endif - -inline boost::filesystem::path get_handle_lock_path(const char* name) -{ - auto p = boost::filesystem::current_path() / name; - if(!boost::filesystem::exists(p)) - { - auto tmp = boost::filesystem::current_path() / boost::filesystem::unique_path(); - boost::filesystem::ofstream{tmp}; - boost::filesystem::rename(tmp, p); - } - return p; -} - -struct handle_mutex -{ - std::recursive_timed_mutex m; - boost::interprocess::file_lock flock; - - handle_mutex(const char* name) : flock(name) {} - - bool try_lock() { return std::try_lock(m, flock) != 0; } - - void lock() { std::lock(m, flock); } - - template - bool try_lock_for(Duration d) - { - return m.try_lock_for(d) && - flock.timed_lock( - boost::posix_time::second_clock::universal_time() + - boost::posix_time::milliseconds( - std::chrono::duration_cast(d).count())); - } - - template - bool try_lock_until(Point p) - { - return m.try_lock_for(p - std::chrono::system_clock::now()); - } - - void unlock() - { - flock.unlock(); - m.unlock(); - } -}; - -template -inline std::unique_lock get_handle_lock(T, int timeout = 120) -{ - static handle_mutex m{get_handle_lock_path(T::value()).c_str()}; - return {m, std::chrono::seconds{timeout}}; -} - -} // namespace rpp - -#endif // GUARD_RPP_HANDLE_LOCK_HPP diff --git a/src/include/common/rpp/hip_build_utils.hpp b/src/include/common/rpp/hip_build_utils.hpp index 3cb5eadaa..87b00bd7f 100644 --- a/src/include/common/rpp/hip_build_utils.hpp +++ b/src/include/common/rpp/hip_build_utils.hpp @@ -25,18 +25,18 @@ *******************************************************************************/ #pragma once -#include +#include #include "rpp/kernel.hpp" #include "rpp/tmp_dir.hpp" #include "rpp/write_file.hpp" namespace rpp { -boost::filesystem::path HipBuild(boost::optional& tmp_dir, +fs::path HipBuild(std::optional& tmp_dir, const std::string& filename, std::string src, std::string params, const std::string& dev_name); -void bin_file_to_str(const boost::filesystem::path& file, std::string& buf); +void bin_file_to_str(const fs::path& file, std::string& buf); } // namespace rpp diff --git a/src/include/common/rpp/kernel.hpp b/src/include/common/rpp/kernel.hpp index 5e3f07d51..72762de22 100644 --- a/src/include/common/rpp/kernel.hpp +++ b/src/include/common/rpp/kernel.hpp @@ -30,8 +30,6 @@ #include #include -#include "config.h" - #ifdef HIP_COMPILE #include "rpp/hipoc_kernel.hpp" diff --git a/src/include/common/rpp/op_kernel_args.hpp b/src/include/common/rpp/op_kernel_args.hpp index 83440676c..409fcf0b1 100644 --- a/src/include/common/rpp/op_kernel_args.hpp +++ b/src/include/common/rpp/op_kernel_args.hpp @@ -26,7 +26,6 @@ THE SOFTWARE. #include #include -#include struct OpKernelArg { @@ -49,6 +48,6 @@ struct OpKernelArg } std::size_t size() const { return buffer.size(); }; - boost::container::small_vector buffer; + std::vector buffer; bool is_ptr = false; }; diff --git a/src/include/common/rpp/tmp_dir.hpp b/src/include/common/rpp/tmp_dir.hpp index 1f989202e..1bc42741e 100644 --- a/src/include/common/rpp/tmp_dir.hpp +++ b/src/include/common/rpp/tmp_dir.hpp @@ -24,7 +24,7 @@ THE SOFTWARE. #define GUARD_RPP_TMP_DIR_HPP #include -#include +#include "filesystem.h" namespace rpp { @@ -32,7 +32,7 @@ void SystemCmd(std::string cmd); struct TmpDir { - boost::filesystem::path path; + fs::path path; TmpDir(std::string prefix); TmpDir(TmpDir const&) = delete; diff --git a/src/include/common/rpp/write_file.hpp b/src/include/common/rpp/write_file.hpp index 879545b6a..3fe4d4d16 100644 --- a/src/include/common/rpp/write_file.hpp +++ b/src/include/common/rpp/write_file.hpp @@ -24,7 +24,7 @@ THE SOFTWARE. #define GUARD_RPP_WRITE_FILE_HPP #include -#include +#include "filesystem.h" #include "rpp/manage_ptr.hpp" @@ -32,7 +32,7 @@ namespace rpp { using FilePtr = RPP_MANAGE_PTR(FILE*, std::fclose); -inline void WriteFile(const std::string& content, const boost::filesystem::path& name) +inline void WriteFile(const std::string& content, const fs::path& name) { FilePtr f{std::fopen(name.string().c_str(), "w")}; if(std::fwrite(content.c_str(), 1, content.size(), f.get()) != content.size()) diff --git a/src/include/hip/rpp/hip_kernels.hpp b/src/include/hip/rpp/hip_kernels.hpp index c67102b2a..623be303e 100644 --- a/src/include/hip/rpp/hip_kernels.hpp +++ b/src/include/hip/rpp/hip_kernels.hpp @@ -23,6 +23,8 @@ THE SOFTWARE. #ifndef HIP_KERNELS_H #define HIP_KERNELS_H +#include + // color_model_conversions extern "C" __global__ void channel_extract_pln(unsigned char* input, unsigned char* output, const unsigned int height, const unsigned int width, const unsigned int channel, const unsigned int extractChannelNumber); extern "C" __global__ void channel_extract_pkd(unsigned char* input, unsigned char* output, const unsigned int height, const unsigned int width, const unsigned int channel, const unsigned int extractChannelNumber); diff --git a/src/include/hip/rpp/hipoc_program.hpp b/src/include/hip/rpp/hipoc_program.hpp index 7579cb035..6e56569ee 100644 --- a/src/include/hip/rpp/hipoc_program.hpp +++ b/src/include/hip/rpp/hipoc_program.hpp @@ -27,9 +27,8 @@ #define GUARD_RPP_HIPOC_PROGRAM_HPP #include -#include #include - +#include "filesystem.h" #include "rpp/manage_ptr.hpp" namespace rpp { @@ -44,10 +43,10 @@ struct HIPOCProgram bool is_kernel_str, std::string dev_name, const std::string& kernel_src); - HIPOCProgram(const std::string& program_name, const boost::filesystem::path& hsaco); + HIPOCProgram(const std::string& program_name, const fs::path& hsaco); std::shared_ptr impl; hipModule_t GetModule() const; - boost::filesystem::path GetBinary() const; + fs::path GetBinary() const; }; } // namespace rpp diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt index f1331283c..2a64d7706 100644 --- a/src/modules/CMakeLists.txt +++ b/src/modules/CMakeLists.txt @@ -120,6 +120,8 @@ elseif( "${BACKEND}" STREQUAL "CPU") set(INCLUDE_LIST ${CMAKE_SOURCE_DIR}/src/include/common/) endif() message("-- ${White}AMD RPP ${PROJECT_NAME} -- Include Directories:${INCLUDE_LIST}${ColourReset}") +add_compile_options("-Wno-unused-result") + # Kernels and includes additions add_kernels("${RPP_KERNELS}") @@ -152,4 +154,4 @@ elseif( "${BACKEND}" STREQUAL "OCL") PRIVATE ${CMAKE_SOURCE_DIR}/src/include/cl ) -endif() \ No newline at end of file +endif() diff --git a/src/modules/binary_cache.cpp b/src/modules/binary_cache.cpp index dcd03b4ba..c1f7ccc39 100644 --- a/src/modules/binary_cache.cpp +++ b/src/modules/binary_cache.cpp @@ -26,8 +26,7 @@ #include #include -#include - +#include "filesystem.h" #include "rpp.h" #include "rppversion.h" #include "rpp/binary_cache.hpp" @@ -40,7 +39,7 @@ namespace rpp { RPP_DECLARE_ENV_VAR(RPP_DISABLE_CACHE) -boost::filesystem::path ComputeCachePath() +fs::path ComputeCachePath() { #ifdef RPP_CACHE_DIR std::string cache_dir = RPP_CACHE_DIR; @@ -49,9 +48,9 @@ boost::filesystem::path ComputeCachePath() std::to_string(RPP_VERSION_MINOR) + "." + std::to_string(RPP_VERSION_PATCH); - auto p = boost::filesystem::path{cache_dir} / version; - if(!boost::filesystem::exists(p)) - boost::filesystem::create_directories(p); + auto p = fs::path{cache_dir} / version; + if(!fs::exists(p)) + fs::create_directories(p); // auto p = cache_dir; //std::cerr<<"\n cache_dir"<(device); ParseDevName(device_name); - boost::optional dir(program_name); + std::optional dir(program_name); #if RPP_BUILD_DEV params += " -Werror"; #ifdef __linux__ diff --git a/src/modules/cl/gcn_asm_utils.cpp b/src/modules/cl/gcn_asm_utils.cpp index c7a00e130..0674ea2f0 100644 --- a/src/modules/cl/gcn_asm_utils.cpp +++ b/src/modules/cl/gcn_asm_utils.cpp @@ -23,12 +23,12 @@ * SOFTWARE. * *******************************************************************************/ +#include #include #include #include #include #include -#include #include #include #include @@ -285,7 +285,7 @@ static void AmdgcnAssembleQuiet(std::string& source, const std::string& params) static bool GcnAssemblerHasBug34765Impl() { - auto p = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path(); + auto p = fs::temp_directory_path() / std::to_string(std::chrono::system_clock::now().time_since_epoch().count()); rpp::WriteFile(rpp::GetKernelSrc("bugzilla_34765_detect"), p); auto src = p.string(); try @@ -308,7 +308,7 @@ bool GcnAssemblerHasBug34765() static bool GcnAssemblerSupportsOption(const std::string& option) { - auto p = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path(); + auto p = fs::temp_directory_path() / std::to_string(std::chrono::system_clock::now().time_since_epoch().count()); rpp::WriteFile(rpp::GetKernelSrc("dummy_kernel"), p); auto src = p.string(); try diff --git a/src/modules/cl/handleocl.cpp b/src/modules/cl/handleocl.cpp index 3ad349310..272099509 100644 --- a/src/modules/cl/handleocl.cpp +++ b/src/modules/cl/handleocl.cpp @@ -24,20 +24,18 @@ * *******************************************************************************/ -#include +#include #ifndef _WIN32 #include #endif #include -#include "config.h" #include "rpp/device_name.hpp" #include "rpp/errors.hpp" #include "rpp/logger.hpp" #include "rpp/handle.hpp" #include "rpp/kernel_cache.hpp" #include "rpp/binary_cache.hpp" -#include "rpp/handle_lock.hpp" #include "rpp/ocldeviceinfo.hpp" #include "rpp/load_file.hpp" @@ -713,7 +711,7 @@ const std::vector& Handle::GetKernelsImpl(const std::string& algorithm, KernelInvoke Handle::Run(Kernel k) { auto q = this->GetStream(); - if(this->impl->enable_profiling || RPP_GPU_SYNC) + if(this->impl->enable_profiling) { return k.Invoke(q, std::bind(&HandleImpl::SetProfilingResult, @@ -728,8 +726,16 @@ KernelInvoke Handle::Run(Kernel k) auto Handle::GetKernels(const std::string& algorithm, const std::string& network_config) { - return this->GetKernelsImpl(algorithm, network_config) | - boost::adaptors::transformed([this](Kernel k) { return this->Run(k); }); + auto kernels = this->GetKernelsImpl(algorithm, network_config); + + std::vector transformedKernels; + + transformedKernels.reserve(kernels.size()); + + std::transform(kernels.begin(), kernels.end(), std::back_inserter(transformedKernels), + [this](Kernel k) { return this->Run(k); }); + + return transformedKernels; } KernelInvoke Handle::GetKernel(const std::string& algorithm, const std::string& network_config) @@ -756,7 +762,7 @@ Program Handle::LoadProgram(const std::string& program_name, std::string params, kernel_src); // Save to cache - auto path = rpp::GetCachePath() / boost::filesystem::unique_path(); + auto path = rpp::GetCachePath() / std::to_string(std::chrono::system_clock::now().time_since_epoch().count()); rpp::SaveProgramBinary(p, path.string()); rpp::SaveBinary(path.string(), this->GetDeviceName(), program_name, params, is_kernel_str); @@ -821,14 +827,12 @@ std::size_t Handle::GetMaxComputeUnits() Allocator::ManageDataPtr Handle::Create(std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); return this->impl->allocator(sz); } Allocator::ManageDataPtr& Handle::WriteTo(const void* data, Allocator::ManageDataPtr& ddata, std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); cl_int status = clEnqueueWriteBuffer(this->GetStream(), ddata.get(), CL_TRUE, 0, sz, data, 0, nullptr, nullptr); if(status != CL_SUCCESS) @@ -840,7 +844,6 @@ Allocator::ManageDataPtr& Handle::WriteTo(const void* data, Allocator::ManageDat void Handle::ReadTo(void* data, const Allocator::ManageDataPtr& ddata, std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); auto status = clEnqueueReadBuffer(this->GetStream(), ddata.get(), CL_TRUE, 0, sz, data, 0, nullptr, nullptr); if(status != CL_SUCCESS) @@ -851,7 +854,6 @@ void Handle::ReadTo(void* data, const Allocator::ManageDataPtr& ddata, std::size void Handle::Copy(ConstData_t src, Data_t dest, std::size_t size) { - RPP_HANDLE_LOCK this->Finish(); auto status = clEnqueueCopyBuffer(this->GetStream(), src, dest, 0, 0, size, 0, nullptr, nullptr); if(status != CL_SUCCESS) @@ -862,7 +864,6 @@ void Handle::Copy(ConstData_t src, Data_t dest, std::size_t size) shared Handle::CreateSubBuffer(Data_t data, std::size_t offset, std::size_t size) { - RPP_HANDLE_LOCK struct region { std::size_t origin; diff --git a/src/modules/cl/hip_build_utils.cpp b/src/modules/cl/hip_build_utils.cpp index 6e575d957..630362aef 100644 --- a/src/modules/cl/hip_build_utils.cpp +++ b/src/modules/cl/hip_build_utils.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ #include -#include +#include #include "rpp/hip_build_utils.hpp" #include "rpp/logger.hpp" @@ -31,7 +31,7 @@ THE SOFTWARE. namespace rpp { -boost::filesystem::path HipBuild(boost::optional& tmp_dir, +fs::path HipBuild(std::optional& tmp_dir, const std::string& filename, std::string src, std::string params, @@ -43,7 +43,7 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, // write out the include files auto inc_list = GetKernelIncList(); auto inc_path = tmp_dir->path; - boost::filesystem::create_directories(inc_path); + fs::create_directories(inc_path); for(auto inc_file : inc_list) { auto inc_src = GetKernelInc(inc_file); @@ -61,13 +61,13 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, auto env = std::string("KMOPTLLC=-mattr=+enable-ds128"); tmp_dir->Execute(env + std::string(" ") + "/opt/rocm/bin/hipcc", params + filename + " -o " + bin_file.string()); - if(!boost::filesystem::exists(bin_file)) + if(!fs::exists(bin_file)) RPP_THROW(filename + " failed to compile"); - auto hsaco = std::find_if(boost::filesystem::directory_iterator{tmp_dir->path}, + auto hsaco = std::find_if(fs::directory_iterator{tmp_dir->path}, {}, [](auto entry) { return (entry.path().extension() == ".hsaco"); }); - if(hsaco == boost::filesystem::directory_iterator{}) + if(hsaco == fs::directory_iterator{}) { RPP_LOG_E("failed to find *.hsaco in " << hsaco->path().string()); } @@ -80,7 +80,7 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, #endif } -void bin_file_to_str(const boost::filesystem::path& file, std::string& buf) +void bin_file_to_str(const fs::path& file, std::string& buf) { std::ifstream bin_file_ptr(file.string().c_str(), std::ios::binary); std::ostringstream bin_file_strm; diff --git a/src/modules/cl/ocl_kernel.cpp b/src/modules/cl/ocl_kernel.cpp index 9a866541c..0eec4853d 100644 --- a/src/modules/cl/ocl_kernel.cpp +++ b/src/modules/cl/ocl_kernel.cpp @@ -25,7 +25,6 @@ *******************************************************************************/ #include "rpp/oclkernel.hpp" -#include "rpp/handle_lock.hpp" #include "rpp/logger.hpp" namespace rpp { @@ -60,8 +59,6 @@ void OCLKernelInvoke::run() const << DimToFormattedString(local_work_dim.data(), work_dim)); #endif // !NDEBUG - RPP_HANDLE_LOCK - cl_event ev; /* way to run OCL group larger than 256 * hack to ensure local_size == 0, just checking that the 1st dim is 0 diff --git a/src/modules/cl/temp_file.cpp b/src/modules/cl/temp_file.cpp index ce0c1b6d2..7a2df141a 100644 --- a/src/modules/cl/temp_file.cpp +++ b/src/modules/cl/temp_file.cpp @@ -20,8 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include -#include +#include #include "rpp/temp_file.hpp" #include "rpp/errors.hpp" diff --git a/src/modules/cl/tmp_dir.cpp b/src/modules/cl/tmp_dir.cpp index 81db2a1fb..d982e424c 100644 --- a/src/modules/cl/tmp_dir.cpp +++ b/src/modules/cl/tmp_dir.cpp @@ -20,8 +20,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include - +#include +#include "filesystem.h" #include "rpp/tmp_dir.hpp" #include "rpp/errors.hpp" #include "rpp/logger.hpp" @@ -43,10 +43,10 @@ void SystemCmd(std::string cmd) } TmpDir::TmpDir(std::string prefix) - : path(boost::filesystem::temp_directory_path() / - boost::filesystem::unique_path("rpp-" + prefix + "-%%%%-%%%%-%%%%-%%%%")) + : path(fs::temp_directory_path() / ("rpp-" + prefix + "-" + + std::to_string(std::chrono::system_clock::now().time_since_epoch().count()))) { - boost::filesystem::create_directories(this->path); + fs::create_directories(this->path); } void TmpDir::Execute(std::string exe, std::string args) @@ -58,6 +58,6 @@ void TmpDir::Execute(std::string exe, std::string args) // std::cout<<"Done with Execute routine"<path); } +TmpDir::~TmpDir() { fs::remove_all(this->path); } } // namespace rpp diff --git a/src/modules/cl/utilocl.cpp b/src/modules/cl/utilocl.cpp index d412afcc8..1802c109d 100644 --- a/src/modules/cl/utilocl.cpp +++ b/src/modules/cl/utilocl.cpp @@ -25,10 +25,8 @@ *******************************************************************************/ #include -#include #include "rpp/kernel_cache.hpp" -#include "rpp/util.hpp" #include "rpp/logger.hpp" #define WG_SIZE 256 diff --git a/src/modules/handlehost.cpp b/src/modules/handlehost.cpp index d8c078645..930e02ab5 100644 --- a/src/modules/handlehost.cpp +++ b/src/modules/handlehost.cpp @@ -24,13 +24,11 @@ * *******************************************************************************/ -#include #ifndef _WIN32 #include #endif #include -#include "config.h" #include "rpp/logger.hpp" #include "rpp/handle.hpp" diff --git a/src/modules/hip/handlehip.cpp b/src/modules/hip/handlehip.cpp index fa5612f6b..a81199891 100644 --- a/src/modules/hip/handlehip.cpp +++ b/src/modules/hip/handlehip.cpp @@ -24,20 +24,17 @@ * *******************************************************************************/ -#include #ifndef _WIN32 #include #endif #include -#include "config.h" #include "rpp/device_name.hpp" #include "rpp/errors.hpp" #include "rpp/logger.hpp" #include "rpp/handle.hpp" #include "rpp/kernel_cache.hpp" #include "rpp/binary_cache.hpp" -#include "rpp/handle_lock.hpp" namespace rpp { @@ -484,7 +481,7 @@ const std::vector& Handle::GetKernelsImpl(const std::string& algorithm, KernelInvoke Handle::Run(Kernel k) { this->impl->set_ctx(); - if(this->impl->enable_profiling || RPP_GPU_SYNC) + if(this->impl->enable_profiling) return k.Invoke(this->GetStream(), this->impl->elapsed_time_handler()); else return k.Invoke(this->GetStream()); @@ -593,14 +590,12 @@ std::size_t Handle::GetMaxComputeUnits() Allocator::ManageDataPtr Handle::Create(std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); return this->impl->allocator(sz); } Allocator::ManageDataPtr& Handle::WriteTo(const void* data, Allocator::ManageDataPtr& ddata, std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); auto status = hipMemcpy(ddata.get(), data, sz, hipMemcpyHostToDevice); if(status != hipSuccess) @@ -610,7 +605,6 @@ Allocator::ManageDataPtr& Handle::WriteTo(const void* data, Allocator::ManageDat void Handle::ReadTo(void* data, const Allocator::ManageDataPtr& ddata, std::size_t sz) { - RPP_HANDLE_LOCK this->Finish(); auto status = hipMemcpy(data, ddata.get(), sz, hipMemcpyDeviceToHost); if(status != hipSuccess) @@ -619,7 +613,6 @@ void Handle::ReadTo(void* data, const Allocator::ManageDataPtr& ddata, std::size void Handle::Copy(ConstData_t src, Data_t dest, std::size_t size) { - RPP_HANDLE_LOCK this->impl->set_ctx(); auto status = hipMemcpy(dest, src, size, hipMemcpyDeviceToDevice); if(status != hipSuccess) diff --git a/src/modules/hip/hip_build_utils.cpp b/src/modules/hip/hip_build_utils.cpp index 6e575d957..630362aef 100644 --- a/src/modules/hip/hip_build_utils.cpp +++ b/src/modules/hip/hip_build_utils.cpp @@ -21,7 +21,7 @@ THE SOFTWARE. */ #include -#include +#include #include "rpp/hip_build_utils.hpp" #include "rpp/logger.hpp" @@ -31,7 +31,7 @@ THE SOFTWARE. namespace rpp { -boost::filesystem::path HipBuild(boost::optional& tmp_dir, +fs::path HipBuild(std::optional& tmp_dir, const std::string& filename, std::string src, std::string params, @@ -43,7 +43,7 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, // write out the include files auto inc_list = GetKernelIncList(); auto inc_path = tmp_dir->path; - boost::filesystem::create_directories(inc_path); + fs::create_directories(inc_path); for(auto inc_file : inc_list) { auto inc_src = GetKernelInc(inc_file); @@ -61,13 +61,13 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, auto env = std::string("KMOPTLLC=-mattr=+enable-ds128"); tmp_dir->Execute(env + std::string(" ") + "/opt/rocm/bin/hipcc", params + filename + " -o " + bin_file.string()); - if(!boost::filesystem::exists(bin_file)) + if(!fs::exists(bin_file)) RPP_THROW(filename + " failed to compile"); - auto hsaco = std::find_if(boost::filesystem::directory_iterator{tmp_dir->path}, + auto hsaco = std::find_if(fs::directory_iterator{tmp_dir->path}, {}, [](auto entry) { return (entry.path().extension() == ".hsaco"); }); - if(hsaco == boost::filesystem::directory_iterator{}) + if(hsaco == fs::directory_iterator{}) { RPP_LOG_E("failed to find *.hsaco in " << hsaco->path().string()); } @@ -80,7 +80,7 @@ boost::filesystem::path HipBuild(boost::optional& tmp_dir, #endif } -void bin_file_to_str(const boost::filesystem::path& file, std::string& buf) +void bin_file_to_str(const fs::path& file, std::string& buf) { std::ifstream bin_file_ptr(file.string().c_str(), std::ios::binary); std::ostringstream bin_file_strm; diff --git a/src/modules/hip/hipoc_kernel.cpp b/src/modules/hip/hipoc_kernel.cpp index b207d8757..db639fe15 100644 --- a/src/modules/hip/hipoc_kernel.cpp +++ b/src/modules/hip/hipoc_kernel.cpp @@ -31,7 +31,6 @@ #include "rpp/errors.hpp" #include "rpp/hipoc_kernel.hpp" -#include "rpp/handle_lock.hpp" #if defined(STATIC) #include "rpp/hip_kernels.hpp" #endif @@ -61,8 +60,7 @@ void HIPOCKernelInvoke::run(void* args, std::size_t size) const } - RPP_HANDLE_LOCK - + #if defined (HSACOO) || defined (HIPRTC) auto status = hipExtModuleLaunchKernel(fun, diff --git a/src/modules/hip/hipoc_program.cpp b/src/modules/hip/hipoc_program.cpp index f1a4dde98..1909daca1 100644 --- a/src/modules/hip/hipoc_program.cpp +++ b/src/modules/hip/hipoc_program.cpp @@ -25,9 +25,9 @@ *******************************************************************************/ #include +#include #include #include -#include #include "rpp/errors.hpp" #include "rpp/gcn_asm_utils.hpp" @@ -47,7 +47,7 @@ std::string remove_extension(const std::string& filename) { return filename.substr(0, lastdot); } -hipModulePtr CreateModule(const boost::filesystem::path& hsaco_file) +hipModulePtr CreateModule(const fs::path& hsaco_file) { hipModule_t raw_m; // std::cout<<"attempting to run hipModule Load of hsacofile:\n";// <module = CreateModule(this->hsaco_file); @@ -95,9 +95,9 @@ struct HIPOCProgramImpl } std::string name; std::string dev_name; - boost::filesystem::path hsaco_file; + fs::path hsaco_file; hipModulePtr module; - boost::optional dir; + std::optional dir; hipModulePtr BuildAndCreateModuleRTC(const std::string& program_name, std::string params, bool is_kernel_str, @@ -198,7 +198,7 @@ struct HIPOCProgramImpl dir->Execute("/usr/local/bin/clang-ocl", params + " " + filename + " -o " + hsaco_file.string()); } // std::cout<<"Done Building Module to get hsaco_file "<(program_name, hsaco)) { } hipModule_t HIPOCProgram::GetModule() const { return this->impl->module.get(); } -boost::filesystem::path HIPOCProgram::GetBinary() const { return this->impl->hsaco_file; } +fs::path HIPOCProgram::GetBinary() const { return this->impl->hsaco_file; } } // namespace rpp diff --git a/src/modules/hip/tmp_dir.cpp b/src/modules/hip/tmp_dir.cpp index 167e296d5..212655f12 100644 --- a/src/modules/hip/tmp_dir.cpp +++ b/src/modules/hip/tmp_dir.cpp @@ -1,5 +1,5 @@ -#include - +#include +#include "filesystem.h" #include "rpp/tmp_dir.hpp" #include "rpp/errors.hpp" #include "rpp/logger.hpp" @@ -21,10 +21,10 @@ void SystemCmd(std::string cmd) } TmpDir::TmpDir(std::string prefix) - : path(boost::filesystem::temp_directory_path() / - boost::filesystem::unique_path("rpp-" + prefix + "-%%%%-%%%%-%%%%-%%%%")) + : path(fs::temp_directory_path() / ("rpp-" + prefix + "-" + + std::to_string(std::chrono::system_clock::now().time_since_epoch().count()))) { - boost::filesystem::create_directories(this->path); + fs::create_directories(this->path); } void TmpDir::Execute(std::string exe, std::string args) @@ -36,6 +36,6 @@ void TmpDir::Execute(std::string exe, std::string args) // std::cout<<"Done with Execute routine"<path); } +TmpDir::~TmpDir() { fs::remove_all(this->path); } } // namespace rpp diff --git a/src/modules/logger.cpp b/src/modules/logger.cpp index 0d3a79340..05b8d3dc8 100644 --- a/src/modules/logger.cpp +++ b/src/modules/logger.cpp @@ -24,7 +24,6 @@ * *******************************************************************************/ #include -#include #ifdef __linux__ #include diff --git a/utilities/examples/brightness/CMakeLists.txt b/utilities/examples/brightness/CMakeLists.txt index ec1ed58cd..9787319a6 100644 --- a/utilities/examples/brightness/CMakeLists.txt +++ b/utilities/examples/brightness/CMakeLists.txt @@ -42,11 +42,6 @@ find_package(hip QUIET) find_package(OpenCV QUIET) find_package(TurboJpeg QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") diff --git a/utilities/examples/brightness/brightness_hip.h b/utilities/examples/brightness/brightness_hip.h index dbccf2ec3..e4b0401a1 100644 --- a/utilities/examples/brightness/brightness_hip.h +++ b/utilities/examples/brightness/brightness_hip.h @@ -32,7 +32,6 @@ THE SOFTWARE. #include #include #include -#include using namespace cv; using namespace std; diff --git a/utilities/rpp-performancetests/HIP_NEW/CMakeLists.txt b/utilities/rpp-performancetests/HIP_NEW/CMakeLists.txt index a08154e33..30e4076e9 100644 --- a/utilities/rpp-performancetests/HIP_NEW/CMakeLists.txt +++ b/utilities/rpp-performancetests/HIP_NEW/CMakeLists.txt @@ -41,11 +41,6 @@ endif() find_package(hip QUIET) find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") diff --git a/utilities/rpp-performancetests/HOST_NEW/CMakeLists.txt b/utilities/rpp-performancetests/HOST_NEW/CMakeLists.txt index 786763841..d186175c2 100644 --- a/utilities/rpp-performancetests/HOST_NEW/CMakeLists.txt +++ b/utilities/rpp-performancetests/HOST_NEW/CMakeLists.txt @@ -40,11 +40,6 @@ endif() find_package(OpenCL QUIET) find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") @@ -70,7 +65,7 @@ if (OpenCV_FOUND) target_link_libraries(Tensor_host_pkd3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(Tensor_host_pln1 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(Tensor_host_pln3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) - # target_link_libraries(Single_host ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system ) + # target_link_libraries(Single_host ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ) else() message("-- ${Yellow}Error: OpenCV must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") endif() \ No newline at end of file diff --git a/utilities/rpp-performancetests/OCL_NEW/CMakeLists.txt b/utilities/rpp-performancetests/OCL_NEW/CMakeLists.txt index d116dd845..cd5839aa5 100644 --- a/utilities/rpp-performancetests/OCL_NEW/CMakeLists.txt +++ b/utilities/rpp-performancetests/OCL_NEW/CMakeLists.txt @@ -39,11 +39,6 @@ endif() find_package(OpenCL QUIET) find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") @@ -65,7 +60,7 @@ if (OpenCL_FOUND AND OpenCV_FOUND) target_link_libraries(BatchPD_ocl_pkd3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(BatchPD_ocl_pln1 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(BatchPD_ocl_pln3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) - # target_link_libraries(Single_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system) + # target_link_libraries(Single_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ) target_link_libraries(uniqueFunctionalities_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) else() message("-- ${Yellow}Error: OpenCV and OpenCL must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") diff --git a/utilities/rpp-unittests/HIP_NEW/CMakeLists.txt b/utilities/rpp-unittests/HIP_NEW/CMakeLists.txt index b8d19a421..c1a18a926 100644 --- a/utilities/rpp-unittests/HIP_NEW/CMakeLists.txt +++ b/utilities/rpp-unittests/HIP_NEW/CMakeLists.txt @@ -41,11 +41,6 @@ endif() find_package(hip QUIET) find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") @@ -76,7 +71,7 @@ if (hip_FOUND AND OpenCV_FOUND) target_link_libraries(Tensor_hip_pkd3 ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) target_link_libraries(Tensor_hip_pln1 ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) target_link_libraries(Tensor_hip_pln3 ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) - # target_link_libraries(Single_hip ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread boost_filesystem boost_system hip::device) + # target_link_libraries(Single_hip ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread hip::device) target_link_libraries(uniqueFunctionalities_hip ${OpenCV_LIBS} -lrpp ${hip_LIBRARIES} pthread ${LINK_LIBRARY_LIST} hip::device) else() message("-- ${Yellow}Error: OpenCV and hip must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") diff --git a/utilities/rpp-unittests/HOST_NEW/CMakeLists.txt b/utilities/rpp-unittests/HOST_NEW/CMakeLists.txt index c0a7acec2..842238afb 100644 --- a/utilities/rpp-unittests/HOST_NEW/CMakeLists.txt +++ b/utilities/rpp-unittests/HOST_NEW/CMakeLists.txt @@ -38,11 +38,6 @@ if(NOT WIN32) endif() find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") @@ -70,7 +65,7 @@ if (OpenCV_FOUND) target_link_libraries(Tensor_host_pkd3 ${OpenCV_LIBS} -lrpp pthread ${LINK_LIBRARY_LIST}) target_link_libraries(Tensor_host_pln3 ${OpenCV_LIBS} -lrpp pthread ${LINK_LIBRARY_LIST}) target_link_libraries(Tensor_host_pln1 ${OpenCV_LIBS} -lrpp pthread ${LINK_LIBRARY_LIST}) - # target_link_libraries(Single_host ${OpenCV_LIBS} -lrpp pthread boost_filesystem boost_system ) + # target_link_libraries(Single_host ${OpenCV_LIBS} -lrpp pthread ) target_link_libraries(uniqueFunctionalities_host ${OpenCV_LIBS} -lrpp pthread ${LINK_LIBRARY_LIST}) else() message("-- ${Yellow}Error: OpenCV must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") diff --git a/utilities/rpp-unittests/OCL_NEW/CMakeLists.txt b/utilities/rpp-unittests/OCL_NEW/CMakeLists.txt index de1c53711..2918149f5 100644 --- a/utilities/rpp-unittests/OCL_NEW/CMakeLists.txt +++ b/utilities/rpp-unittests/OCL_NEW/CMakeLists.txt @@ -40,11 +40,6 @@ endif() find_package(OpenCL QUIET) find_package(OpenCV QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") @@ -66,7 +61,7 @@ if (OpenCL_FOUND AND OpenCV_FOUND) target_link_libraries(BatchPD_ocl_pkd3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(BatchPD_ocl_pln1 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) target_link_libraries(BatchPD_ocl_pln3 ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) - # target_link_libraries(Single_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread boost_filesystem boost_system) + # target_link_libraries(Single_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ) target_link_libraries(uniqueFunctionalities_ocl ${OpenCV_LIBS} -lrpp ${OpenCL_LIBRARIES} pthread ${LINK_LIBRARY_LIST}) else() message("-- ${Yellow}Error: OpenCV and OpenCL must be installed to install ${PROJECT_NAME} successfully!${ColourReset}") diff --git a/utilities/test_suite/HIP/CMakeLists.txt b/utilities/test_suite/HIP/CMakeLists.txt index 8f32a66ca..8e67ba014 100644 --- a/utilities/test_suite/HIP/CMakeLists.txt +++ b/utilities/test_suite/HIP/CMakeLists.txt @@ -42,11 +42,6 @@ find_package(hip QUIET) find_package(OpenCV QUIET) find_package(TurboJpeg QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") diff --git a/utilities/test_suite/HOST/CMakeLists.txt b/utilities/test_suite/HOST/CMakeLists.txt index bad0d607a..4ece854e2 100644 --- a/utilities/test_suite/HOST/CMakeLists.txt +++ b/utilities/test_suite/HOST/CMakeLists.txt @@ -39,11 +39,6 @@ endif() find_package(OpenCV QUIET) find_package(TurboJpeg QUIET) -# BOOST -set(BOOST_COMPONENTS filesystem system) -find_package(Boost COMPONENTS ${BOOST_COMPONENTS} REQUIRED) -include_directories(${Boost_INCLUDE_DIRS}) -set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}) # OpenMP find_package(OpenMP REQUIRED) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -ggdb -O0") diff --git a/utilities/test_suite/rpp_test_suite_common.h b/utilities/test_suite/rpp_test_suite_common.h index 3f2295374..80cec68c7 100644 --- a/utilities/test_suite/rpp_test_suite_common.h +++ b/utilities/test_suite/rpp_test_suite_common.h @@ -27,6 +27,7 @@ THE SOFTWARE. #include #include #include +#include "filesystem.h" #include "rpp.h" #include #include @@ -35,7 +36,6 @@ THE SOFTWARE. #include #include #include -#include #ifdef GPU_SUPPORT #include @@ -48,7 +48,6 @@ typedef half Rpp16f; using namespace cv; using namespace std; -namespace fs = boost::filesystem; #define CUTOFF 1 #define DEBUG_MODE 0