Skip to content

Commit

Permalink
Jenkins - Fix Test (#489)
Browse files Browse the repository at this point in the history
* Jenkins - Fix Test

* Test - Create sepreate test folder

* FileSystem - Find and process

* Find Filesystem - Updates

* Test - Compiler Updates
  • Loading branch information
kiritigowda authored Dec 17, 2024
1 parent b4210f1 commit ae4b72f
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .jenkins/common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ def runTestCommand (platform, project) {

def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}/build/release
make test ARGS="-VV"
cd ${project.paths.project_build_prefix}/build
mkdir -p test && cd test
cmake /opt/rocm/share/rpp/test
ctest -VV
"""

platform.runCommand(this, command)
Expand Down Expand Up @@ -116,8 +118,6 @@ def runPackageCommand(platform, project) {
mv rpp-test*.${packageType} package/${osType}-rpp-test.${packageType}
mv rpp-dev*.${packageType} package/${osType}-rpp-dev.${packageType}
mv ${packageRunTime}.${packageType} package/${osType}-rpp.${packageType}
mv Testing/Temporary/LastTest.log ${osType}-LastTest.log
mv Testing/Temporary/LastTestsFailed.log ${osType}-LastTestsFailed.log
${packageDetail} package/${osType}-rpp-test.${packageType}
${packageDetail} package/${osType}-rpp-dev.${packageType}
${packageDetail} package/${osType}-rpp.${packageType}
Expand Down
58 changes: 58 additions & 0 deletions cmake/FindStdFilesystem.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
################################################################################
#
# MIT License
#
# Copyright (c) 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.
#
################################################################################
include(CheckCXXSourceCompiles)
include(CMakePushCheckState)

cmake_push_check_state(RESET)

set(CMAKE_REQUIRED_FLAGS "-std=c++17")

check_cxx_source_compiles("
#include <filesystem>
int main() {
std::filesystem::path p;
return 0;
}
" STD_FILESYSTEM_PRESENT)

cmake_pop_check_state()

if(NOT STD_FILESYSTEM_PRESENT)
cmake_push_check_state(RESET)
set(CMAKE_REQUIRED_FLAGS "-std=c++17")

check_cxx_source_compiles("
#include <experimental/filesystem>
int main() {
std::experimental::filesystem::path p;
return 0;
}
" EXPERIMENTAL_FILESYSTEM_PRESENT)

cmake_pop_check_state()
endif()

set(FILESYSTEM_FOUND TRUE)
17 changes: 13 additions & 4 deletions utilities/test_suite/HIP/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ SOFTWARE.
]]

cmake_minimum_required(VERSION 3.10)
project(test_suite/HIP)

# ROCM Path
if(DEFINED ENV{ROCM_PATH})
Expand All @@ -33,6 +32,15 @@ elseif(ROCM_PATH)
else()
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
endif()
# Set AMD Clang as default compiler
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS "${ROCM_PATH}/bin/amdclang++")
set(CMAKE_C_COMPILER ${ROCM_PATH}/bin/amdclang)
set(CMAKE_CXX_COMPILER ${ROCM_PATH}/bin/amdclang++)
elseif(NOT DEFINED CMAKE_CXX_COMPILER AND NOT EXISTS "${ROCM_PATH}/bin/amdclang++")
set(CMAKE_CXX_COMPILER clang++)
endif()

project(test_suite/HIP)

list(APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/share/rpp/test/cmake)
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
Expand Down Expand Up @@ -105,6 +113,9 @@ else()
set(RPP_AUDIO_AUGMENTATIONS_SUPPORT_FOUND ${CMAKE_MATCH_1})
endif()

# add find modules
list(APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/share/rpp/test/cmake)

# find required libraries
find_package(HIP QUIET)
set(Python3_FIND_VIRTUALENV FIRST)
Expand All @@ -117,6 +128,7 @@ else()
find_package(OpenMP QUIET)
find_package(OpenCV QUIET)
find_package(TurboJpeg QUIET)
find_package(StdFilesystem QUIET)

# find required python3-pip imports
execute_process(
Expand Down Expand Up @@ -209,9 +221,6 @@ else()
link_directories(${SndFile_LIBRARIES_DIR} /usr/local/lib/)
message("-- ${Green}${PROJECT_NAME} Tensor-Audio HIP tests set to build with libsnd${ColourReset}")
add_executable(Tensor_audio_hip Tensor_audio_hip.cpp)
if(NOT APPLE)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs)
endif(NOT APPLE)
target_link_libraries(Tensor_audio_hip -lrpp pthread ${libsnd_LIBS} -lsndfile ${LINK_LIBRARY_LIST} ${hip_LIBRARIES})
else()
message("-- ${Yellow}Warning: libsnd must be installed to install ${PROJECT_NAME} Tensor-Audio tests successfully!${ColourReset}")
Expand Down
19 changes: 14 additions & 5 deletions utilities/test_suite/HOST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ SOFTWARE.
]]

cmake_minimum_required(VERSION 3.10)
project(test_suite/HOST)

# ROCM Path
if(DEFINED ENV{ROCM_PATH})
set(ROCM_PATH $ENV{ROCM_PATH} CACHE PATH "Default ROCm installation path")
elseif(ROCM_PATH)
message("-- ${PROJECT_NAME} INFO:ROCM_PATH Set -- ${ROCM_PATH}")
message("-- INFO:ROCM_PATH Set -- ${ROCM_PATH}")
else()
set(ROCM_PATH /opt/rocm CACHE PATH "Default ROCm installation path")
endif()
# Set AMD Clang as default compiler
if(NOT DEFINED CMAKE_CXX_COMPILER AND EXISTS "${ROCM_PATH}/bin/amdclang++")
set(CMAKE_C_COMPILER ${ROCM_PATH}/bin/amdclang)
set(CMAKE_CXX_COMPILER ${ROCM_PATH}/bin/amdclang++)
elseif(NOT DEFINED CMAKE_CXX_COMPILER AND NOT EXISTS "${ROCM_PATH}/bin/amdclang++")
set(CMAKE_CXX_COMPILER clang++)
endif()

project(test_suite/HOST)

list(APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/share/rpp/test/cmake)
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
Expand Down Expand Up @@ -104,6 +112,9 @@ else()
set(RPP_AUDIO_AUGMENTATIONS_SUPPORT_FOUND ${CMAKE_MATCH_1})
endif()

# add find modules
list(APPEND CMAKE_MODULE_PATH ${ROCM_PATH}/share/rpp/test/cmake)

# find required libraries
set(Python3_FIND_VIRTUALENV FIRST)
find_package(Python3 QUIET)
Expand All @@ -115,6 +126,7 @@ else()
find_package(OpenMP QUIET)
find_package(OpenCV QUIET)
find_package(TurboJpeg QUIET)
find_package(StdFilesystem QUIET)

# find required python3-pip imports
execute_process(
Expand Down Expand Up @@ -208,9 +220,6 @@ else()
link_directories(${SndFile_LIBRARIES_DIR} /usr/local/lib/)
message("-- ${Green}${PROJECT_NAME} Tensor-Audio HOST tests set to build with libsnd${ColourReset}")
add_executable(Tensor_audio_host Tensor_audio_host.cpp)
if(NOT APPLE)
set(LINK_LIBRARY_LIST ${LINK_LIBRARY_LIST} stdc++fs)
endif(NOT APPLE)
target_link_libraries(Tensor_audio_host -lrpp pthread ${libsnd_LIBS} -lsndfile ${LINK_LIBRARY_LIST})
else()
message("-- ${Yellow}Warning: libsnd must be installed to install ${PROJECT_NAME} Tensor-Audio tests successfully!${ColourReset}")
Expand Down

0 comments on commit ae4b72f

Please sign in to comment.