X Tutup
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move C API documentation into single doxygen group
Now that we have class based documentation available, it no longer makes
sense to retain the old approach. Hence, a new c_api_mat group is added
in the place of method_mat group that contains only the C API used to
manage af_arrays.
  • Loading branch information
pradeep committed Mar 17, 2020
commit e3fdb1e566a90325aa38d688bb763fb44d7b4687
6 changes: 3 additions & 3 deletions docs/pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ or Linux or download it from source:

## Easy to use

The [array](\ref construct_mat) object is beautifully simple.
The [array](\ref af::array) object is beautifully simple.

Array-based notation effectively expresses computational algorithms in
readable math-resembling notation. You _do not_ need expertise in
Expand Down Expand Up @@ -92,9 +92,9 @@ Read more about how [ArrayFire JIT](http://arrayfire.com/performance-of-arrayfir

## Simple Example

Here's a live example to let you see ArrayFire code. You create [arrays](\ref construct_mat)
Here's a live example to let you see ArrayFire code. You create [arrays](\ref af::array)
which reside on CUDA or OpenCL devices. Then you can use
[ArrayFire functions](modules.htm) on those [arrays](\ref construct_mat).
[ArrayFire functions](modules.htm) on those [arrays](\ref af::array).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
// sample 40 million points on the GPU
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ which cannot freed until the `array` object goes out of scope. As device memory
allocation can be expensive, ArrayFire also includes a memory manager which
will re-use device memory whenever possible.

Arrays can be created using one of the [array constructors](\ref #construct_mat).
Arrays can be created using one of the [array constructors](\ref af::array).
Below we show how to create 1D, 2D, and 3D arrays with uninitialized values:

\snippet test/getting_started.cpp ex_getting_started_constructors
Expand Down
65 changes: 7 additions & 58 deletions include/af/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,6 @@ namespace af
const array::array_proxy slices(int first, int last) const;
};

//array(af_array in, const array *par, af_index_t seqs[4]);
/**
\ingroup construct_mat
@{
*/
/**
Create an uninitialized array (no data, undefined size)

Expand Down Expand Up @@ -553,15 +548,6 @@ namespace af
const dim_t dim0, const dim_t dim1 = 1,
const dim_t dim2 = 1, const dim_t dim3 = 1);

/**
@}
*/

/**
\ingroup method_mat
@{
*/

/**
get the \ref af_array handle
*/
Expand Down Expand Up @@ -720,22 +706,12 @@ namespace af
template<typename T> T scalar() const;

/**
@}
*/


/**
Get the device pointer from the array and lock the buffer in memory manager.
@{
\brief Get the device pointer from the array and lock the buffer in memory manager.

The device memory returned by this function is not freed until unlock() is called.

\ingroup device_mat
*/
template<typename T> T* device() const;
/**
@}
*/

// INDEXING
// Single arguments
Expand Down Expand Up @@ -884,7 +860,6 @@ namespace af
///
/// \param[in] type is the desired type(f32, s64, etc.)
/// \returns an array with the type specified by \p type
/// \ingroup method_mat
const array as(dtype type) const;


Expand All @@ -893,12 +868,10 @@ namespace af
/// \brief Get the transposed the array
///
/// \returns Transposed matrix
/// \ingroup method_mat
array T() const;
/// \brief Get the conjugate-transpose of the current array
///
/// \returns conjugate-transpose matrix
/// \ingroup method_mat
array H() const;

#define ASSIGN_(OP2) \
Expand Down Expand Up @@ -1366,7 +1339,7 @@ namespace af

/// Evaluate an expression (nonblocking).
/**
\ingroup method_mat
\ingroup data_mat
@{
*/
inline array &eval(array &a) { a.eval(); return a; }
Expand Down Expand Up @@ -1432,10 +1405,6 @@ namespace af
#if AF_API_VERSION >= 37

/// Evaluate an expression (nonblocking).
/**
\ingroup method_mat
@{
*/
inline const array &eval(const array &a) { a.eval(); return a; }

#if AF_COMPILER_CXX_VARIADIC_TEMPLATES
Expand Down Expand Up @@ -1506,14 +1475,14 @@ extern "C" {
#endif

/**
\ingroup construct_mat
\ingroup c_api_mat
@{
*/

/**
Create an \ref af_array handle initialized with user defined data

This function will create an \ref af_array handle from the memory provided in \p data
This function will create an \ref af_array handle from the memory provided in \p data.

\param[out] arr The pointer to the returned object.
\param[in] data The data which will be loaded into the array
Expand All @@ -1528,6 +1497,9 @@ extern "C" {
/**
Create af_array handle

To release the memory allocated by this call you would have to
call \ref af_release_array once your use of this \ref af_array is complete.

\param[out] arr The pointer to the retured object.
\param[in] ndims The number of dimensions read from the \p dims parameter
\param[in] dims A C pointer with \p ndims elements. Each value represents the size of that dimension
Expand All @@ -1538,13 +1510,6 @@ extern "C" {
AFAPI af_err af_create_handle(af_array *arr, const unsigned ndims, const dim_t * const dims, const af_dtype type);

/**
@}
*/

/**
\ingroup method_mat
@{

Deep copy an array to another
*/
AFAPI af_err af_copy_array(af_array *arr, const af_array in);
Expand Down Expand Up @@ -1575,25 +1540,16 @@ extern "C" {

#if AF_API_VERSION >= 31
/**
\ingroup method_mat
@{

Get the reference count of \ref af_array
*/
AFAPI af_err af_get_data_ref_count(int *use_count, const af_array in);
#endif


/**
Evaluate any expressions in the Array
*/
AFAPI af_err af_eval(af_array in);

/**
@}
*/


#if AF_API_VERSION >= 34
/**
Evaluate multiple arrays together
Expand All @@ -1614,14 +1570,7 @@ extern "C" {
*/
AFAPI af_err af_get_manual_eval_flag(bool *flag);
#endif
/**
@}
*/

/**
\ingroup method_mat
@{
*/
/**
\brief Get the total number of elements across all dimensions of the array

Expand Down
6 changes: 3 additions & 3 deletions include/af/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ extern "C" {

/**
Create array from device memory
\ingroup construct_mat
\ingroup c_api_mat
*/
AFAPI af_err af_device_array(af_array *arr, void *data, const unsigned ndims, const dim_t * const dims, const af_dtype type);

Expand Down Expand Up @@ -380,9 +380,9 @@ extern "C" {
\param [in] msg A message to print before the table
\param [in] device_id print the memory info of the specified device.
-1 signifies active device.

\returns AF_SUCCESS if successful

\ingroup device_func_mem
*/
AFAPI af_err af_print_mem_info(const char *msg, const int device_id);
Expand Down
9 changes: 3 additions & 6 deletions include/arrayfire.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,15 @@

Array constructors, random number generation, transpose, indexing, etc.

@defgroup construct_mat Constructors of array class
Construct an array object

@defgroup method_mat Methods of array class
Get information about the array object

@defgroup device_mat Managing devices in ArrayFire
getting device pointer, allocating and freeing memory

@defgroup data_mat Functions to create arrays.
constant, random, range, etc.

@defgroup c_api_mat C API to manage arrays
Create, release, copy, fetch-properties of \ref af_array

@defgroup index_mat Assignment & Indexing operation on arrays
Access sub regions of an array object

Expand Down
X Tutup