Skip to content

Commit 7a79ae7

Browse files
committed
Merge branch 'master' into devel
2 parents 2851540 + fef2063 commit 7a79ae7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1121
-43
lines changed

__af_version__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/python
2+
3+
#######################################################
4+
# Copyright (c) 2015, ArrayFire
5+
# All rights reserved.
6+
#
7+
# This file is distributed under 3-clause BSD license.
8+
# The complete license agreement can be obtained at:
9+
# http://arrayfire.com/licenses/BSD-3-Clause
10+
########################################################
11+
12+
version = "3.3"
13+
release = "20160624"
14+
full_version = version + "." + release

arrayfire/__init__.py

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,22 @@
88
########################################################
99

1010
"""
11-
A high performance scientific computing library for CUDA, OpenCL and CPU devices.
11+
ArrayFire is a high performance scientific computing library with an easy to use API.
1212
13-
The functionality provided by ArrayFire spans the following domains:
1413
15-
1. Vector Algorithms
16-
2. Image Processing
17-
3. Signal Processing
18-
4. Computer Vision
19-
5. Linear Algebra
20-
6. Statistics
14+
>>> # Monte Carlo estimation of pi
15+
>>> def calc_pi_device(samples):
16+
# Simple, array based API
17+
# Generate uniformly distributed random numers
18+
x = af.randu(samples)
19+
y = af.randu(samples)
20+
# Supports Just In Time Compilation
21+
# The following line generates a single kernel
22+
within_unit_circle = (x * x + y * y) < 1
23+
# Intuitive function names
24+
return 4 * af.count(within_unit_circle) / samples
2125
22-
Programs written using ArrayFire are portable across CUDA, OpenCL and CPU devices
26+
Programs written using ArrayFire are portable across CUDA, OpenCL and CPU devices.
2327
2428
The default backend is chosen in the following order of preference based on the available libraries:
2529
@@ -31,7 +35,16 @@
3135
3236
>>> af.set_backend(name)
3337
34-
where name is one of 'cuda', 'opencl' or 'cpu'
38+
where name is one of 'cuda', 'opencl' or 'cpu'.
39+
40+
The functionality provided by ArrayFire spans the following domains:
41+
42+
1. Vector Algorithms
43+
2. Image Processing
44+
3. Signal Processing
45+
4. Computer Vision
46+
5. Linear Algebra
47+
6. Statistics
3548
3649
"""
3750

arrayfire/algorithm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
########################################################
99

1010
"""
11-
Vector algorithms for ArrayFire
11+
Vector algorithms (sum, min, sort, etc).
1212
"""
1313

1414
from .library import *
@@ -283,7 +283,7 @@ def imax(a, dim=None):
283283

284284
def accum(a, dim=0):
285285
"""
286-
Cumulative sum of an array along a specified dimension.
286+
Cumulative sum of an array along a specified dimension
287287
288288
Parameters
289289
----------

arrayfire/arith.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
########################################################
99

1010
"""
11-
Math functions for ArrayFire
11+
Math functions (sin, sqrt, exp, etc).
1212
"""
1313

1414
from .library import *

arrayfire/array.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
########################################################
99

1010
"""
11-
arrayfire.Array class and helper functions.
11+
Array class and helper functions.
1212
"""
1313

1414
import inspect
@@ -492,7 +492,7 @@ def device_ptr(self):
492492
Return the device pointer exclusively held by the array.
493493
494494
Returns
495-
------
495+
--------
496496
ptr : int
497497
Contains location of the device pointer
498498
@@ -512,7 +512,7 @@ def raw_ptr(self):
512512
Return the device pointer held by the array.
513513
514514
Returns
515-
------
515+
--------
516516
ptr : int
517517
Contains location of the device pointer
518518
@@ -533,7 +533,7 @@ def offset(self):
533533
Return the offset, of the first element relative to the raw pointer.
534534
535535
Returns
536-
------
536+
--------
537537
offset : int
538538
The offset in number of elements
539539
"""
@@ -546,7 +546,7 @@ def strides(self):
546546
Return the distance in bytes between consecutive elements for each dimension.
547547
548548
Returns
549-
------
549+
--------
550550
strides : tuple
551551
The strides for each dimension
552552
"""
@@ -1082,7 +1082,7 @@ def to_ctype(self, row_major=False, return_shape=False):
10821082
Return the data as a ctype C array after copying to host memory
10831083
10841084
Parameters
1085-
---------
1085+
-----------
10861086
10871087
row_major: optional: bool. default: False.
10881088
Specifies if a transpose needs to occur before copying to host memory.
@@ -1116,7 +1116,7 @@ def to_array(self, row_major=False, return_shape=False):
11161116
Return the data as array.array
11171117
11181118
Parameters
1119-
---------
1119+
-----------
11201120
11211121
row_major: optional: bool. default: False.
11221122
Specifies if a transpose needs to occur before copying to host memory.
@@ -1151,7 +1151,7 @@ def to_list(self, row_major=False):
11511151
Return the data as list
11521152
11531153
Parameters
1154-
---------
1154+
-----------
11551155
11561156
row_major: optional: bool. default: False.
11571157
Specifies if a transpose needs to occur before copying to host memory.

arrayfire/blas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
########################################################
99

1010
"""
11-
BLAS functions for arrayfire.
11+
BLAS functions (matmul, dot, etc)
1212
"""
1313

1414
from .library import *

arrayfire/data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def join(dim, first, second, third=None, fourth=None):
384384
An array containing the input arrays joined along the specified dimension.
385385
386386
Examples
387-
-------
387+
---------
388388
389389
>>> import arrayfire as af
390390
>>> a = af.randu(2, 3)
@@ -460,7 +460,7 @@ def tile(a, d0, d1=1, d2=1, d3=1):
460460
An array containing the input after tiling the the specified number of times.
461461
462462
Examples
463-
-------
463+
---------
464464
465465
>>> import arrayfire as af
466466
>>> a = af.randu(2, 3)
@@ -710,7 +710,7 @@ def flip(a, dim=0):
710710
The output after flipping `a` along `dim`.
711711
712712
Examples
713-
-------
713+
---------
714714
715715
>>> import arrayfire as af
716716
>>> a = af.randu(3, 3)

arrayfire/device.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def set_device(num):
7676
Change the active device to the specified id.
7777
7878
Parameters
79-
---------
79+
-----------
8080
num: int.
8181
id of the desired device.
8282
"""
@@ -136,7 +136,7 @@ def is_dbl_supported(device=None):
136136
Check if double precision is supported on specified device.
137137
138138
Parameters
139-
---------
139+
-----------
140140
device: optional: int. default: None.
141141
id of the desired device.
142142
@@ -155,7 +155,7 @@ def sync(device=None):
155155
Block until all the functions on the device have completed execution.
156156
157157
Parameters
158-
---------
158+
-----------
159159
device: optional: int. default: None.
160160
id of the desired device.
161161
"""

arrayfire/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# http://arrayfire.com/licenses/BSD-3-Clause
88
########################################################
99
"""
10-
arrayfire.Features class
10+
Features class used for Computer Vision algorithms.
1111
"""
1212
from .library import *
1313
from .array import *

arrayfire/graphics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
########################################################
99

1010
"""
11-
graphics functions for arrayfire
11+
Graphics functions (plot, image, etc).
1212
"""
1313

1414
from .library import *

0 commit comments

Comments
 (0)