Skip to content

Commit

Permalink
Merge pull request #1102 from arrayfire/devel
Browse files Browse the repository at this point in the history
Release 3.2.0
  • Loading branch information
umar456 committed Nov 12, 2015
2 parents 35c89f5 + 46a45b5 commit c9b22d5
Show file tree
Hide file tree
Showing 510 changed files with 14,524 additions and 1,703 deletions.
30 changes: 19 additions & 11 deletions ArrayFireConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
#
# ----------------------------------------------------------------------------
#
# ArrayFire_CPU_FOUND - True of the ArrayFire CPU library has been found.
# ArrayFire_CPU_LIBRARIES - Location of ArrayFire's CPU library, if found
# ArrayFire_CUDA_FOUND - True of the ArrayFire CUDA library has been found.
# ArrayFire_CUDA_LIBRARIES - Location of ArrayFire's CUDA library, if found
# ArrayFire_OpenCL_FOUND - True of the ArrayFire OpenCL library has been found.
# ArrayFire_OpenCL_LIBRARIES - Location of ArrayFire's OpenCL library, if found
# ArrayFire_CPU_FOUND - True of the ArrayFire CPU library has been found.
# ArrayFire_CPU_LIBRARIES - Location of ArrayFire's CPU library, if found
# ArrayFire_CUDA_FOUND - True of the ArrayFire CUDA library has been found.
# ArrayFire_CUDA_LIBRARIES - Location of ArrayFire's CUDA library, if found
# ArrayFire_OpenCL_FOUND - True of the ArrayFire OpenCL library has been found.
# ArrayFire_OpenCL_LIBRARIES - Location of ArrayFire's OpenCL library, if found
# ArrayFire_Unified_FOUND - True of the ArrayFire Unified library has been found.
# ArrayFire_Unified_LIBRARIES - Location of ArrayFire's Unified library, if found
#
#=============================================================================
# Copyright (c) 2015, ArrayFire
Expand Down Expand Up @@ -48,17 +50,23 @@

get_filename_component(ArrayFire_INCLUDE_DIRS "@INCLUDE_DIR@" ABSOLUTE)

# keep in the backends in the slowest to fastest order
foreach(backend CPU OpenCL CUDA)
string(TOLOWER "${backend}" lowerbackend)
macro(find_backend backend libname)
set(targetFile ${CMAKE_CURRENT_LIST_DIR}/@BACKEND_DIR@/ArrayFire${backend}.cmake)
if(EXISTS ${targetFile})
include(${targetFile})
set(ArrayFire_${backend}_FOUND ON)
set(ArrayFire_${backend}_LIBRARIES af${lowerbackend})
set(ArrayFire_${backend}_LIBRARIES af${libname})
# set the default backend
set(ArrayFire_LIBRARIES af${lowerbackend})
set(ArrayFire_LIBRARIES af${libname})
else()
set(ArrayFire_${backend}_FOUND OFF)
endif()
endmacro()

# keep in the backends in the slowest to fastest order
foreach(backend CPU OpenCL CUDA)
string(TOLOWER "${backend}" lowerbackend)
find_backend("${backend}" "${lowerbackend}")
endforeach()

find_backend("Unified" "")
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ OPTION(BUILD_SIFT "Build ArrayFire nonfree algorithms" OFF)

MARK_AS_ADVANCED(BUILD_SIFT)

OPTION(BUILD_UNIFIED "Build Backend-Independent ArrayFire API" ON)

# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
Expand Down Expand Up @@ -163,6 +165,11 @@ IF(${BUILD_OPENCL})
ADD_SUBDIRECTORY(src/backend/opencl)
ENDIF()

IF(${BUILD_UNIFIED})
ADD_DEFINITIONS(-DAF_UNIFIED)
ADD_SUBDIRECTORY(src/api/unified)
ENDIF()

IF(${BUILD_DOCS})
ADD_SUBDIRECTORY(docs)
ENDIF()
Expand Down
4 changes: 2 additions & 2 deletions CMakeModules/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Make a version file that includes the ArrayFire version and git revision
#
SET(AF_VERSION_MAJOR "3")
SET(AF_VERSION_MINOR "1")
SET(AF_VERSION_PATCH "3")
SET(AF_VERSION_MINOR "2")
SET(AF_VERSION_PATCH "0")

SET(AF_VERSION "${AF_VERSION_MAJOR}.${AF_VERSION_MINOR}.${AF_VERSION_PATCH}")
SET(AF_API_VERSION_CURRENT ${AF_VERSION_MAJOR}${AF_VERSION_MINOR})
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/build_clBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENDIF()
ExternalProject_Add(
clBLAS-external
GIT_REPOSITORY https://github.com/arrayfire/clBLAS.git
GIT_TAG 47662a6ac1186c756508109d7fef8827efab4504
GIT_TAG 102c832825e8e4d60ad73ca97e95668463294068
PREFIX "${prefix}"
INSTALL_DIR "${prefix}"
UPDATE_COMMAND ""
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/build_forge.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ENDIF()
ExternalProject_Add(
forge-ext
GIT_REPOSITORY https://github.com/arrayfire/forge.git
GIT_TAG af3.1.2
GIT_TAG af3.2.0
PREFIX "${prefix}"
INSTALL_DIR "${prefix}"
UPDATE_COMMAND ""
Expand Down
16 changes: 12 additions & 4 deletions CMakeModules/osx_install/OSXInstaller.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ PKG_BUILD( PKG_NAME ArrayFireCPU
SCRIPT_DIR ${OSX_INSTALL_DIR}/cpu_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.cpu.lib
PATH_TO_FILES package/lib
FILTERS opencl cuda)
FILTERS opencl cuda unified)

PKG_BUILD( PKG_NAME ArrayFireCUDA
DEPENDS afcuda
Expand All @@ -85,15 +85,23 @@ PKG_BUILD( PKG_NAME ArrayFireCUDA
SCRIPT_DIR ${OSX_INSTALL_DIR}/cuda_scripts
IDENTIFIER com.arrayfire.pkg.arrayfire.cuda.lib
PATH_TO_FILES package/lib
FILTERS cpu opencl)
FILTERS cpu opencl unified)

PKG_BUILD( PKG_NAME ArrayFireOPENCL
DEPENDS afopencl
TARGETS opencl_package
INSTALL_LOCATION /usr/local/lib
IDENTIFIER com.arrayfire.pkg.arrayfire.opencl.lib
PATH_TO_FILES package/lib
FILTERS cpu cuda)
FILTERS cpu cuda unified)

PKG_BUILD( PKG_NAME ArrayFireUNIFIED
DEPENDS af
TARGETS unified_package
INSTALL_LOCATION /usr/local/lib
IDENTIFIER com.arrayfire.pkg.arrayfire.unified.lib
PATH_TO_FILES package/lib
FILTERS cpu cuda opencl)

PKG_BUILD( PKG_NAME ArrayFireHeaders
TARGETS header_package
Expand All @@ -107,5 +115,5 @@ PKG_BUILD( PKG_NAME ArrayFireExtra
IDENTIFIER com.arrayfire.pkg.arrayfire.extra
PATH_TO_FILES package/share)

PRODUCT_BUILD(DEPENDS ${cpu_package} ${cuda_package} ${opencl_package} ${header_package} ${extra_package})
PRODUCT_BUILD(DEPENDS ${cpu_package} ${cuda_package} ${opencl_package} ${unified_package} ${header_package} ${extra_package})

35 changes: 29 additions & 6 deletions CMakeModules/osx_install/distribution.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,55 @@
<welcome file="${WELCOME_FILE_OUT}" />
<readme file="${README_FILE_OUT}" mime-type="test/html" />
<license file="${CMAKE_MODULE_PATH}/../LICENSE" mime-type="test/plain" />
<script>
function CheckBackendSelected() {
return choices.opencl_lib.selected ||
choices.cuda_lib.selected ||
choices.cpu_lib.selected;
}
</script>

<pkg-ref id="com.arrayfire.arrayfire.cpu.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireCPU.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.cuda.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireCUDA.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.opencl.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireOPENCL.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.unified.lib" version="${AF_VERSION}" onConclusion="none">ArrayFireUNIFIED.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.inc" version="${AF_VERSION}" onConclusion="none">ArrayFireHeaders.pkg</pkg-ref>
<pkg-ref id="com.arrayfire.arrayfire.extra" version="${AF_VERSION}" onConclusion="none">ArrayFireExtra.pkg</pkg-ref>
<options customize="always" require-scripts="false"/>
<choices-outline>
<line choice="libs">
<line choice="com.arrayfire.arrayfire.cpu.lib"/>
<line choice="com.arrayfire.arrayfire.cuda.lib"/>
<line choice="com.arrayfire.arrayfire.opencl.lib"/>
<line choice="cpu_lib"/>
<line choice="cuda_lib"/>
<line choice="opencl_lib"/>
<line choice="com.arrayfire.arrayfire.unified.lib"/>
</line>
<line choice="com.arrayfire.arrayfire.inc"/>
<line choice="com.arrayfire.arrayfire.extra"/>
</choices-outline>
<choice id="libs" title="ArrayFire Libraries" visible="true" />
<choice title="CPU Libraries" description="CPU Libraries" id="com.arrayfire.arrayfire.cpu.lib" visible="true" enabled="true">
<choice title="CPU Libraries"
description="ArrayFire targeting CPUs."
id="cpu_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.cpu.lib"/>
</choice>
<choice title="CUDA Libraries" description="CUDA Libraries" id="com.arrayfire.arrayfire.cuda.lib" visible="true" enabled="true">
<choice title="CUDA Libraries"
description="ArrayFire which targets the CUDA platform. This platform allows you to to take advantage of the CUDA enabled GPUs to run ArrayFire code."
id="cuda_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.cuda.lib"/>
</choice>
<choice title="OpenCL Libraries" description="OpenCL Libraries" id="com.arrayfire.arrayfire.opencl.lib" visible="true" enabled="true">
<choice title="OpenCL Libraries"
description="ArrayFire which targets the OpenCL platform. This platform allows you to use the ArrayFire library which targets OpenCL devices. NOTE: Currently ArrayFire does not support OpenCL for the Intel CPU on Apple."
id="opencl_lib" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.opencl.lib"/>
</choice>
<choice title="Unified Library"
description="This library will allow you to choose the platform(cpu, cuda, opencl) at runtime. NOTE: This option requires the other platforms to work properly"
id="com.arrayfire.arrayfire.unified.lib"
selected="CheckBackendSelected()"
visible="true"
enabled="CheckBackendSelected()">
<pkg-ref id="com.arrayfire.arrayfire.unified.lib"/>
</choice>
<choice title="ArrayFire Headers" description="ArrayFire Headers" id="com.arrayfire.arrayfire.inc" visible="true" enabled="true">
<pkg-ref id="com.arrayfire.arrayfire.inc"/>
</choice>
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ ArrayFire binary installers can be downloaded at the [ArrayFire Downloads](http:
* Email: <mailto:technical@arrayfire.com>

### Build Status
| | Build | Tests |
|-----------------|-----------------|-----------------|
| Linux x86 | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-linux/devel)](http://ci.arrayfire.org/job/arrayfire-linux/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-linux-test/devel)](http://ci.arrayfire.org/job/arrayfire-linux-test/branch/devel/) |
| Linux Tegra | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegra/devel)](http://ci.arrayfire.org/job/arrayfire-tegra/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegra-test/devel)](http://ci.arrayfire.org/job/arrayfire-tegra-test/branch/devel/) |
| Windows | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-windows/devel)](http://ci.arrayfire.org/job/arrayfire-windows/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-windows-test/devel)](http://ci.arrayfire.org/job/arrayfire-windows-test/branch/devel/) |
| OSX | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-osx/devel)](http://ci.arrayfire.org/job/arrayfire-osx/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-osx-test/devel)](http://ci.arrayfire.org/job/arrayfire-osx-test/branch/devel/) |
| | Linux x86 | Linux armv7l | Linux aarch64 | Windows | OSX |
|:-------:|:---------:|:------------:|:-------------:|:-------:|:---:|
| Build | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-linux/devel)](http://ci.arrayfire.org/job/arrayfire-linux/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegrak1/devel)](http://ci.arrayfire.org/job/arrayfire-tegrak1/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegrax1/devel)](http://ci.arrayfire.org/job/arrayfire-tegrax1/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-windows/devel)](http://ci.arrayfire.org/job/arrayfire-windows/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-osx/devel)](http://ci.arrayfire.org/job/arrayfire-osx/branch/devel/) |
| Test | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-linux-test/devel)](http://ci.arrayfire.org/job/arrayfire-linux-test/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegrak1-test/devel)](http://ci.arrayfire.org/job/arrayfire-tegrak1-test/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-tegrax1-test/devel)](http://ci.arrayfire.org/job/arrayfire-tegrax1-test/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-windows-test/devel)](http://ci.arrayfire.org/job/arrayfire-windows-test/branch/devel/) | [![Build Status](http://ci.arrayfire.org/buildStatus/icon?job=arrayfire-osx-test/devel)](http://ci.arrayfire.org/job/arrayfire-osx-test/branch/devel/) |

Test coverage: [![Coverage Status](https://coveralls.io/repos/arrayfire/arrayfire/badge.svg?branch=HEAD)](https://coveralls.io/r/arrayfire/arrayfire?branch=HEAD)

Expand Down
38 changes: 37 additions & 1 deletion docs/details/algorithm.dox
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ This function performs the operation across all batches present in the input sim

Find the sum of values in the input

This table defines the return value types for the corresponding input types

Input Type | Output Type
--------------------|---------------------
f32, f64, c32, c64 | same as input
s32, u32, s64, u64 | same as input
s16 | s32
u16, u8, b8 | u32

\copydoc batch_detail_algo


Expand All @@ -25,6 +34,15 @@ Find the sum of values in the input

Find the product of values in the input

This table defines the return value types for the corresponding input types

Input Type | Output Type
--------------------|---------------------
f32, f64, c32, c64 | same as input
s32, u32, s64, u64 | same as input
s16 | s32
u16, u8, b8 | u32

\copydoc batch_detail_algo


Expand Down Expand Up @@ -55,6 +73,8 @@ Find the maximum values and their locations

Find if of all of the values in input are true

Return type is b8 for all input types

\copydoc batch_detail_algo


Expand All @@ -65,6 +85,8 @@ Find if of all of the values in input are true

Find if of any of the values in input are true

Return type is b8 for all input types

\copydoc batch_detail_algo


Expand All @@ -75,6 +97,8 @@ Find if of any of the values in input are true

Count the number of non-zero elements in the input

Return type is u32 for all input types

\copydoc batch_detail_algo


Expand All @@ -85,6 +109,15 @@ Count the number of non-zero elements in the input

Perform exclusive sum along specified dimension

This table defines the return value types for the corresponding input types

Input Type | Output Type
--------------------|---------------------
f32, f64, c32, c64 | same as input
s32, u32, s64, u64 | same as input
s16 | s32
u16, u8, b8 | u32

\copydoc batch_detail_algo


Expand All @@ -95,6 +128,8 @@ Perform exclusive sum along specified dimension

Locate the indices of non-zero elements

Return type is u32 for all input types

The locations are provided by flattening the input into a linear array.


Expand Down Expand Up @@ -135,7 +170,8 @@ Sort an multi dimensional array

Sort input arrays get the sorted indices

Sort a multi dimensional array and return sorted indices
Sort a multi dimensional array and return sorted indices. Index array is of
type u32.



Expand Down
66 changes: 66 additions & 0 deletions docs/details/backend.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/**
\addtogroup arrayfire_func
@{

\defgroup unified_func_setbackend setBackend

\brief Set the current backend when using Unified backend

This is a noop when using one of CPU, CUDA, or OpenCL backend.

However, when using on of those 3 but trying to set it to a different backend
will return in an exception.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getbackendcount getBackendCount

\brief Get the number of backends whose libraries were successfully loaded.

This will be between 0-3. 0 Being no backends were loaded and 3 being all
backends loaded successfully.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getavailbackends getAvailableBackends

\brief Returns an integer indicating the backends loaded successfully.

The number returned denotes the backends available according to the table:

Return Value | Backends Available
-------------|-----------------------
0 | None
1 | CPU
2 | CUDA
3 | CPU and CUDA
4 | OpenCL
5 | CPU and OpenCL
6 | CUDA and OpenCL
7 | CPU, CUDA and OpenCL

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

\defgroup unified_func_getbackendid getBackendId

\brief Get's the backend enum for an array

This will return one of the values from the \ref af_backend enum.
The return value specifies which backend the array was created on.

\ingroup unified_func
\ingroup arrayfire_func

=======================================================================

@}
*/
3 changes: 3 additions & 0 deletions docs/details/image.dox
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ distance as well as the color distance.
The bilateral filter requires the size of the filter (in pixels) and the upper
bound on color values, N, where pixel values range from 0–N inclusively.

The return type of the array is f64 for f64 input, f32 for all other input
types.

=======================================================================

\defgroup image_func_erode erode
Expand Down

0 comments on commit c9b22d5

Please sign in to comment.