[arrayfire] 19/75: DOCS: Adding documentation for internal functions
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Mon Feb 29 08:01:10 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.
commit 6e9eacb152b119d2fd1e037bed4514b50abccb0a
Author: Pavan Yalamanchili <pavan at arrayfire.com>
Date: Thu Feb 11 15:57:28 2016 -0500
DOCS: Adding documentation for internal functions
---
docs/details/internal.dox | 29 +++++++++++
include/af/internal.h | 119 ++++++++++++++++++++++++++++++++++++++++++++++
include/arrayfire.h | 9 ++++
3 files changed, 157 insertions(+)
diff --git a/docs/details/internal.dox b/docs/details/internal.dox
new file mode 100644
index 0000000..879f819
--- /dev/null
+++ b/docs/details/internal.dox
@@ -0,0 +1,29 @@
+/**
+\addtogroup internal_func
+@{
+
+\defgroup internal_func_create createArray
+
+Create an array with specified strides and offset.
+
+
+\defgroup internal_func_strides getStrides
+
+Get strides of underlying data.
+
+
+\defgroup internal_func_offset getOffset
+
+Get Offset of the underlying data.
+
+
+\defgroup internal_func_linear isLinear
+
+Check if all elements in array are contiguous.
+
+\defgroup internal_func_owner isOwner
+
+Check if underlying data is owned by the current array.
+
+@}
+*/
diff --git a/include/af/internal.h b/include/af/internal.h
index fdd0158..6ba42b3 100644
--- a/include/af/internal.h
+++ b/include/af/internal.h
@@ -16,20 +16,78 @@ namespace af
{
class array;
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] data is the raw data pointer.
+ \param[in] offset specifies the number of elements to skip.
+ \param[in] dims specifies the dimensions for the region of interest.
+ \param[in] strides specifies the distance between each element of a given dimension.
+ \param[in] ty specifies the data type of \p data.
+ \param[in] location specifies if the data is on host or the device.
+
+ \note: If \p location is `afHost`, a memory copy is performed.
+
+ \returns an af::array() with specified offset, dimensions and strides.
+
+ \ingroup internal_func_create
+ */
AFAPI array createArray(const void *data, const dim_t offset,
const dim4 dims, const dim4 strides,
const af::dtype ty,
const af::source location);
+#endif
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] in An multi dimensional array.
+ \returns af::dim4() containing distance between consecutive elements in each dimension.
+
+ \ingroup internal_func_strides
+ */
AFAPI dim4 getStrides(const array &in);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] in An multi dimensional array.
+ \returns offset from the starting location of data pointer specified in number of elements.
+ \ingroup internal_func_offset
+ */
AFAPI dim_t getOffset(const array &in);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] in An multi dimensional array.
+ \returns Returns the raw pointer location to the array.
+ \note This pointer may be shared with other arrays. Use this function with caution.
+
+ \ingroup internal_func_rawptr
+ */
AFAPI void *getRawPtr(const array &in);
+#endif
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] in An multi dimensional array.
+ \returns a boolean specifying if all elements in the array are contiguous.
+
+ \ingroup internal_func_linear
+ */
AFAPI bool isLinear(const array &in);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] in An multi dimensional array.
+ \returns a boolean specifying if the array owns the raw pointer. It is false if it is a sub array.
+ \ingroup internal_func_owner
+ */
AFAPI bool isOwner(const array &in);
+#endif
}
#endif
@@ -38,6 +96,21 @@ extern "C"
{
#endif
+#if AF_API_VERSION >= 33
+ /**
+ \param[out] arr an af_array with specified offset, dimensions and strides.
+ \param[in] data is the raw data pointer.
+ \param[in] offset specifies the number of elements to skip.
+ \param[in] ndims specifies the number of array dimensions.
+ \param[in] dims specifies the dimensions for the region of interest.
+ \param[in] strides specifies the distance between each element of a given dimension.
+ \param[in] ty specifies the data type of \p data.
+ \param[in] location specifies if the data is on host or the device.
+
+ \note If \p location is `afHost`, a memory copy is performed.
+
+ \ingroup internal_func_create
+ */
AFAPI af_err af_create_array_with_strides(af_array *arr,
const void *data,
const dim_t offset,
@@ -46,16 +119,62 @@ extern "C"
const dim_t *const strides,
const af_dtype ty,
const af_source location);
+#endif
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] arr An multi dimensional array.
+ \param[out] s0 distance between each consecutive element along first dimension.
+ \param[out] s1 distance between each consecutive element along second dimension.
+ \param[out] s2 distance between each consecutive element along third dimension.
+ \param[out] s3 distance between each consecutive element along fourth dimension.
+
+ \ingroup internal_func_strides
+ */
AFAPI af_err af_get_strides(dim_t *s0, dim_t *s1, dim_t *s2, dim_t *s3, const af_array arr);
+#endif
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] arr An multi dimensional array.
+ \param[out] offset: Offset from the starting location of data pointer specified in number of elements. distance between each consecutive element along first dimension.
+
+ \ingroup internal_func_offset
+ */
AFAPI af_err af_get_offset(dim_t *offset, const af_array arr);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] arr An multi dimensional array.
+ \param[out] ptr the raw pointer location to the array.
+ \note This pointer may be shared with other arrays. Use this function with caution.
+
+ \ingroup internal_func_rawptr
+ */
AFAPI af_err af_get_raw_ptr(void **ptr, const af_array arr);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] arr An multi dimensional array.
+ \param[out] result: a boolean specifying if all elements in the array are contiguous.
+ \ingroup internal_func_linear
+ */
AFAPI af_err af_is_linear(bool *result, const af_array arr);
+#endif
+
+#if AF_API_VERSION >= 33
+ /**
+ \param[in] arr An multi dimensional array.
+ \param[out] result: a boolean specifying if the array owns the raw pointer. It is false if it is a sub array.
+ \ingroup internal_func_owner
+ */
AFAPI af_err af_is_owner(bool *result, const af_array arr);
+#endif
#ifdef __cplusplus
}
diff --git a/include/arrayfire.h b/include/arrayfire.h
index 73b417b..60df317 100644
--- a/include/arrayfire.h
+++ b/include/arrayfire.h
@@ -209,6 +209,15 @@
@}
+ @defgroup internal_func Functions to work with internal array layout
+ @{
+
+ Functions to work with arrayfire's internal data structure.
+
+ Note: The behavior of these functions is not promised to be consistent across versions.
+
+ @}
+
@defgroup external Interface Functions
@{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git
More information about the debian-science-commits
mailing list