-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for oneAPI data management backend primitives #3008
Conversation
Would be helpful if we could merge this PR first: So that we could then check that this one isn't introducing new warnings that might be masked by previous ones in the CI logs. |
@@ -539,14 +712,26 @@ inline sycl::event fill(sycl::queue& q, | |||
} | |||
#endif | |||
|
|||
/// Multidimensional array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it differ from sycl's own class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think sycl has own multidimensional data representations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it does have a 1D marray
. Lots of the usage for views is as 1D containers, so I was curious about their usage over sycl's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think besides of multidimensionality, our data structures are interoperable in the sense one can easily view the same data block as dal::table, dal::array, dal::backend::primitives::ndview, etc.
Also here we implement convenience functions like slice, transpose, to_host, etc.
With sycl own structures the amount of code inside oneDAL algorithmic kernels would be much bigger. Anyway we would need to wrap some common operations into functions. This class groups those common operations on the data together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be helpful to add a hint to prefer these custom classes instead of sycl's.
@rakshithgb-fujitsu, @keeranroth can you please provide the feedback? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments look good for the code that is present, so I've refrained from commenting on the code. But for my own information, is there a plan to make the views constexpr, or to have the layout separate from the data, so that the offsets into arrays / pointers / multi-dimensional arrays can be calculated at compile time? And does the implementation support arbitrary shapes and strides, e.g. having a layout of the shape (a, (b, c), d), which is a 3 dimensional object, where the second dimension is a 2-dimensional object. This is useful in terms of doing things like cache-blocking. Not for this code review, but it would be great to see functionality like this, if it doesn't already exist
No, there are no such plans for now. But I understand that it might be beneficial to have ndarrays of constexpr sizes to represent some data blocks used in intermediate computations.
I think it would be more correct to answer "no" to this question. Because:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Couldn't find anything obviously out of place
ndview
,ndarray
and related primitives are documented.PR completeness and readability