Skip to content
This repository has been archived by the owner on Feb 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #52 from GPUOpen-ProfessionalCompute-Libraries/dev…
Browse files Browse the repository at this point in the history
…elop

release 0.9.7
  • Loading branch information
rgiduthuri authored Sep 30, 2017
2 parents e2ca803 + 102af14 commit bbb599f
Show file tree
Hide file tree
Showing 32 changed files with 1,262 additions and 258 deletions.
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,22 @@
# THE SOFTWARE.

cmake_minimum_required (VERSION 2.8)
project(amdovx)
project(amdovx-core)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

find_package(OpenCL QUIET)
find_package(OpenCV QUIET)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

file(COPY examples DESTINATION ${CMAKE_BINARY_DIR})

add_subdirectory(openvx)
add_subdirectory(runvx)
add_subdirectory(runcl)

if(OpenCL_FOUND)
add_subdirectory(runcl)
endif(OpenCL_FOUND)
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# AMD OpenVX (AMDOVX)
AMD OpenVX (beta preview) is a highly optimized open source implementation of the [Khronos OpenVX](https://www.khronos.org/registry/vx/) computer vision specification. It allows for rapid prototyping as well as fast execution on a wide range of computer hardware, including small embedded x86 CPUs and large workstation discrete GPUs.
# AMD OpenVX (AMDOVX)
AMD OpenVX (beta) is a highly optimized open source implementation of the [Khronos OpenVX](https://www.khronos.org/registry/vx/) computer vision specification. It allows for rapid prototyping as well as fast execution on a wide range of computer hardware, including small embedded x86 CPUs and large workstation discrete GPUs.

The amdovx-core project consists of two components:
* [OpenVX](openvx/README.md): AMD OpenVX library
* [RunVX](runvx/README.md): command-line utility to execute OpenVX graph described in GDF text file
* [RunCL](runcl/README.md): command-line utility to build, execute, and debug OpenCL programs

The OpenVX framework provides a mechanism to add new vision functions to OpenVX by 3rd party vendors. Look into github [amdovx-modules](https://github.com/GPUOpen-ProfessionalCompute-Libraries/amdovx-modules) project for additional OpenVX modules and utilities.
* [vx_loomsl](https://github.com/GPUOpen-ProfessionalCompute-Libraries/amdovx-modules/tree/master/vx_loomsl/README.md): Radeon LOOM stitching library for live 360 degree video applications
* [loom_shell](https://github.com/GPUOpen-ProfessionalCompute-Libraries/amdovx-modules/tree/master/utils/loom_shell/README.md): an interpreter to prototype 360 degree video stitching applications using a script
* [vx_ext_cv](https://github.com/GPUOpen-ProfessionalCompute-Libraries/amdovx-modules/tree/master/vx_ext_cv/README.md): OpenVX module that implemented a mechanism to access OpenCV functionality as OpenVX kernels
* **vx_nn**: OpenVX neural network module that was built on top of [MIOpen](https://github.com/ROCmSoftwarePlatform/MIOpen)
* **vx_loomsl**: Radeon LOOM stitching library for live 360 degree video applications
* **loom_shell**: an interpreter to prototype 360 degree video stitching applications using a script
* **vx_opencv**: OpenVX module that implemented a mechanism to access OpenCV functionality as OpenVX kernels

This software is provided under a MIT-style license, see the file COPYRIGHT.txt for details.

Expand All @@ -21,26 +23,29 @@ This software is provided under a MIT-style license, see the file COPYRIGHT.txt

## Pre-requisites
* CPU: SSE4.1 or above CPU, 64-bit.
* GPU: Radeon R7 Series or above (Kaveri+ APU), Radeon 3xx Series or above (optional)
* DRIVER: AMD Catalyst 15.7 or higher (version 15.20) with OpenCL 2.0 runtimes
* AMD APP SDK 3.0 [download](http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/).
* GPU: Radeon Professional Graphics Cards or Vega Family of Products (16GB required for vx_loomsl and vx_nn libraries)
* Windows: install the latest drivers and OpenCL SDK [download](https://github.com/GPUOpen-LibrariesAndSDKs/OCL-SDK/releases)
* Linux: install [ROCm](https://rocm.github.io/ROCmInstall.html)
* OpenCV 3 (optional) [download](https://github.com/opencv/opencv/releases) for RunVX
* Set OpenCV_DIR environment variable to OpenCV/build folder

## Build Instructions
Build this project to generate AMD OpenVX library and RunVX executable.
* Refer to [openvx/include/VX](openvx/include/VX) for Khronos OpenVX standard header files.
* Refer to [openvx/include/vx_ext_amd.h](openvx/include/vx_ext_amd.h) for vendor extensions in AMD OpenVX library.
* Refer to [runvx/README.md](runvx/README.md) for RunVX details.
* Refer to [runcl/README.md](runcl/README.md) for RunCL details.

### Build using Visual Studio Professional 2013 on 64-bit Windows 10/8.1/7
* Install OpenCV 3.0 [download](http://opencv.org/downloads.html) for RunVX tool to support camera capture and image display
* Install OpenCV 3 with contrib [download](https://github.com/opencv/opencv/releases) for RunVX tool to support camera capture and image display (optional)
* OpenCV_DIR environment variable should point to OpenCV/build folder
* Use amdovx-core/amdovx.sln to build for x64 platform
* If AMD GPU (or OpenCL 2.0) is not available, set build flag ENABLE_OPENCL=0 in openvx/openvx.vcxproj and runvx/runvx.vcxproj.
* If AMD GPU (or OpenCL) is not available, set build flag ENABLE_OPENCL=0 in openvx/openvx.vcxproj and runvx/runvx.vcxproj.

### Build using CMake
* Install CMake 2.8 or newer [download](http://cmake.org/download/).
* Install OpenCV 3.0 [download](https://github.com/opencv/opencv/releases/tag/3.0.0) for RunVX tool to support camera capture and image display
* Install OpenCV 3 with contrib [download](https://github.com/opencv/opencv/releases) for RunVX tool to support camera capture and image display (optional)
* OpenCV_DIR environment variable should point to OpenCV/build folder
* Install libssl-dev on linux (optional)
* Use CMake to configure and generate Makefile
* If AMD GPU (or OpenCL 2.0) is not available, use build flag -DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=TRUE.
* If AMD GPU (or OpenCL) is not available, use build flag -DCMAKE_DISABLE_FIND_PACKAGE_OpenCL=TRUE.
84 changes: 84 additions & 0 deletions cmake/FindOpenCL.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
################################################################################
#
# MIT License
#
# Copyright (c) 2017 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.
#
################################################################################
find_path(OPENCL_INCLUDE_DIRS
NAMES OpenCL/cl.h CL/cl.h
HINTS
${OPENCL_ROOT}/include
$ENV{AMDAPPSDKROOT}/include
$ENV{CUDA_PATH}/include
PATHS
/usr/include
/usr/local/include
/usr/local/cuda/include
/opt/cuda/include
/opt/rocm/opencl/include
DOC "OpenCL header file path"
)
mark_as_advanced( OPENCL_INCLUDE_DIRS )

if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
find_library( OPENCL_LIBRARIES
NAMES OpenCL
HINTS
${OPENCL_ROOT}/lib
$ENV{AMDAPPSDKROOT}/lib
$ENV{CUDA_PATH}/lib
DOC "OpenCL dynamic library path"
PATH_SUFFIXES x86_64 x64 x86_64/sdk
PATHS
/usr/lib
/usr/local/cuda/lib
/opt/cuda/lib
/opt/rocm/opencl/lib
)
else( )
find_library( OPENCL_LIBRARIES
NAMES OpenCL
HINTS
${OPENCL_ROOT}/lib
$ENV{AMDAPPSDKROOT}/lib
$ENV{CUDA_PATH}/lib
DOC "OpenCL dynamic library path"
PATH_SUFFIXES x86 Win32

PATHS
/usr/lib
/usr/local/cuda/lib
/opt/cuda/lib
)
endif( )
mark_as_advanced( OPENCL_LIBRARIES )

include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )

set(OpenCL_FOUND ${OPENCL_FOUND} CACHE INTERNAL "")
set(OpenCL_LIBRARIES ${OPENCL_LIBRARIES} CACHE INTERNAL "")
set(OpenCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIRS} CACHE INTERNAL "")

if( NOT OPENCL_FOUND )
message( STATUS "FindOpenCL looked for libraries named: OpenCL" )
endif()
4 changes: 2 additions & 2 deletions openvx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ if( POLICY CMP0054 )
cmake_policy( SET CMP0054 OLD )
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /DVX_API_ENTRY=__declspec(dllexport)")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd /DVX_API_ENTRY=__declspec(dllexport)")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD /DVX_API_ENTRY=__declspec(dllexport)")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd /DVX_API_ENTRY=__declspec(dllexport)")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2 -std=c++11")
target_link_libraries(openvx dl m)
Expand Down
Loading

0 comments on commit bbb599f

Please sign in to comment.