Copy link
Copy Markdown
Member
Fixes #1597
[skip arrayfire ci]
| } | ||
|
|
||
| template<typename T> | ||
| static inline void sparseEval(af_array arr) |
Copy link
Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better(simpler) approach would be to specialize eval to accept sparse arrays
Copy link
Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template<typename T, bool sparse = false>
static inline void eval(af_array arr)
{
if(sparse) {
getSparse<T>(arr).eval();
} else {
getArray<T>(arr).eval();
}
return;
}
Copy link
Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A minor revision. Looks good otherwise