Copilot commented on code in PR #50827:
URL: https://github.com/apache/arrow/pull/50827#discussion_r3730117215
##########
cpp/src/arrow/c/dlpack.cc:
##########
@@ -59,31 +63,35 @@ Result<DLDataType> GetDLDataType(const DataType& type) {
}
}
+template <typename DT>
struct ManagerCtx {
std::shared_ptr<ArrayData> array;
- DLManagedTensor tensor;
+ DT tensor;
+ int64_t strides = 1;
};
-} // namespace
-
-Result<DLManagedTensor*> ExportArray(const std::shared_ptr<Array>& arr) {
+template <typename DT>
+Result<DT*> ExportArrayImpl(const std::shared_ptr<Array>& arr) {
// Define DLDevice struct and check if array type is supported
// by the DLPack protocol at the same time. Raise TypeError if not.
// Supported data types: int, uint, float with no validity buffer.
ARROW_ASSIGN_OR_RAISE(auto device, ExportDevice(arr))
Review Comment:
Missing semicolon after the preceding ARROW_ASSIGN_OR_RAISE call; without
it, this function won’t compile.
This issue also appears on line 175 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]