Skip to content

Commit 83e9aa7

Browse files
committed
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.
1 parent c145e90 commit 83e9aa7

5 files changed

Lines changed: 17 additions & 71 deletions

File tree

‎docs/pages/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ or Linux or download it from source:
1717

1818
## Easy to use
1919

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

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

9393
## Simple Example
9494

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

9999
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp}
100100
// sample 40 million points on the GPU

‎docs/pages/getting_started.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ which cannot freed until the `array` object goes out of scope. As device memory
4848
allocation can be expensive, ArrayFire also includes a memory manager which
4949
will re-use device memory whenever possible.
5050

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

5454
\snippet test/getting_started.cpp ex_getting_started_constructors

‎include/af/array.h‎

Lines changed: 7 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ namespace af
163163
const array::array_proxy slices(int first, int last) const;
164164
};
165165

166-
//array(af_array in, const array *par, af_index_t seqs[4]);
167-
/**
168-
\ingroup construct_mat
169-
@{
170-
*/
171166
/**
172167
Create an uninitialized array (no data, undefined size)
173168
@@ -553,15 +548,6 @@ namespace af
553548
const dim_t dim0, const dim_t dim1 = 1,
554549
const dim_t dim2 = 1, const dim_t dim3 = 1);
555550

556-
/**
557-
@}
558-
*/
559-
560-
/**
561-
\ingroup method_mat
562-
@{
563-
*/
564-
565551
/**
566552
get the \ref af_array handle
567553
*/
@@ -720,22 +706,12 @@ namespace af
720706
template<typename T> T scalar() const;
721707

722708
/**
723-
@}
724-
*/
725-
726-
727-
/**
728-
Get the device pointer from the array and lock the buffer in memory manager.
729-
@{
709+
\brief Get the device pointer from the array and lock the buffer in memory manager.
730710
731711
The device memory returned by this function is not freed until unlock() is called.
732712
733-
\ingroup device_mat
734713
*/
735714
template<typename T> T* device() const;
736-
/**
737-
@}
738-
*/
739715

740716
// INDEXING
741717
// Single arguments
@@ -884,7 +860,6 @@ namespace af
884860
///
885861
/// \param[in] type is the desired type(f32, s64, etc.)
886862
/// \returns an array with the type specified by \p type
887-
/// \ingroup method_mat
888863
const array as(dtype type) const;
889864

890865

@@ -893,12 +868,10 @@ namespace af
893868
/// \brief Get the transposed the array
894869
///
895870
/// \returns Transposed matrix
896-
/// \ingroup method_mat
897871
array T() const;
898872
/// \brief Get the conjugate-transpose of the current array
899873
///
900874
/// \returns conjugate-transpose matrix
901-
/// \ingroup method_mat
902875
array H() const;
903876

904877
#define ASSIGN_(OP2) \
@@ -1366,7 +1339,7 @@ namespace af
13661339

13671340
/// Evaluate an expression (nonblocking).
13681341
/**
1369-
\ingroup method_mat
1342+
\ingroup data_mat
13701343
@{
13711344
*/
13721345
inline array &eval(array &a) { a.eval(); return a; }
@@ -1432,10 +1405,6 @@ namespace af
14321405
#if AF_API_VERSION >= 37
14331406

14341407
/// Evaluate an expression (nonblocking).
1435-
/**
1436-
\ingroup method_mat
1437-
@{
1438-
*/
14391408
inline const array &eval(const array &a) { a.eval(); return a; }
14401409

14411410
#if AF_COMPILER_CXX_VARIADIC_TEMPLATES
@@ -1506,14 +1475,14 @@ extern "C" {
15061475
#endif
15071476

15081477
/**
1509-
\ingroup construct_mat
1478+
\ingroup c_api_mat
15101479
@{
15111480
*/
15121481

15131482
/**
15141483
Create an \ref af_array handle initialized with user defined data
15151484
1516-
This function will create an \ref af_array handle from the memory provided in \p data
1485+
This function will create an \ref af_array handle from the memory provided in \p data.
15171486
15181487
\param[out] arr The pointer to the returned object.
15191488
\param[in] data The data which will be loaded into the array
@@ -1528,6 +1497,9 @@ extern "C" {
15281497
/**
15291498
Create af_array handle
15301499
1500+
To release the memory allocated by this call you would have to
1501+
call \ref af_release_array once your use of this \ref af_array is complete.
1502+
15311503
\param[out] arr The pointer to the retured object.
15321504
\param[in] ndims The number of dimensions read from the \p dims parameter
15331505
\param[in] dims A C pointer with \p ndims elements. Each value represents the size of that dimension
@@ -1538,13 +1510,6 @@ extern "C" {
15381510
AFAPI af_err af_create_handle(af_array *arr, const unsigned ndims, const dim_t * const dims, const af_dtype type);
15391511

15401512
/**
1541-
@}
1542-
*/
1543-
1544-
/**
1545-
\ingroup method_mat
1546-
@{
1547-
15481513
Deep copy an array to another
15491514
*/
15501515
AFAPI af_err af_copy_array(af_array *arr, const af_array in);
@@ -1575,25 +1540,16 @@ extern "C" {
15751540

15761541
#if AF_API_VERSION >= 31
15771542
/**
1578-
\ingroup method_mat
1579-
@{
1580-
15811543
Get the reference count of \ref af_array
15821544
*/
15831545
AFAPI af_err af_get_data_ref_count(int *use_count, const af_array in);
15841546
#endif
15851547

1586-
15871548
/**
15881549
Evaluate any expressions in the Array
15891550
*/
15901551
AFAPI af_err af_eval(af_array in);
15911552

1592-
/**
1593-
@}
1594-
*/
1595-
1596-
15971553
#if AF_API_VERSION >= 34
15981554
/**
15991555
Evaluate multiple arrays together
@@ -1614,14 +1570,7 @@ extern "C" {
16141570
*/
16151571
AFAPI af_err af_get_manual_eval_flag(bool *flag);
16161572
#endif
1617-
/**
1618-
@}
1619-
*/
16201573

1621-
/**
1622-
\ingroup method_mat
1623-
@{
1624-
*/
16251574
/**
16261575
\brief Get the total number of elements across all dimensions of the array
16271576

‎include/af/device.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ extern "C" {
351351

352352
/**
353353
Create array from device memory
354-
\ingroup construct_mat
354+
\ingroup c_api_mat
355355
*/
356356
AFAPI af_err af_device_array(af_array *arr, void *data, const unsigned ndims, const dim_t * const dims, const af_dtype type);
357357

@@ -380,9 +380,9 @@ extern "C" {
380380
\param [in] msg A message to print before the table
381381
\param [in] device_id print the memory info of the specified device.
382382
-1 signifies active device.
383-
383+
384384
\returns AF_SUCCESS if successful
385-
385+
386386
\ingroup device_func_mem
387387
*/
388388
AFAPI af_err af_print_mem_info(const char *msg, const int device_id);

‎include/arrayfire.h‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,15 @@
3131
3232
Array constructors, random number generation, transpose, indexing, etc.
3333
34-
@defgroup construct_mat Constructors of array class
35-
Construct an array object
36-
37-
@defgroup method_mat Methods of array class
38-
Get information about the array object
39-
4034
@defgroup device_mat Managing devices in ArrayFire
4135
getting device pointer, allocating and freeing memory
4236
4337
@defgroup data_mat Functions to create arrays.
4438
constant, random, range, etc.
4539
40+
@defgroup c_api_mat C API to manage arrays
41+
Create, release, copy, fetch-properties of \ref af_array
42+
4643
@defgroup index_mat Assignment & Indexing operation on arrays
4744
Access sub regions of an array object
4845

0 commit comments

Comments
 (0)