-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-33854: [MATLAB] Add basic libmexclass integration code to MATLAB interface #34563
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
Merged
Merged
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
c90fbd7
Add basic libmexclass integration code to MATLAB interface
kevingurney 5e0a794
Set SOURCE_SUBDIR in the call to ExternalProject_Add to point to the …
kevingurney 8cf062f
Implement basic DoubleArrayProxy using libmexclass.
kevingurney 00568c0
Fix Windows build error for the libmexclass integration.
sreeharihegden e5c40f2
Use dynamic values in DoubleArray.m, currently making a copy of all v…
lafiona 32c2819
Add UInt64 array type, currently attempting no copy, but there is a bug.
lafiona 826b386
Edit arrays to perform no-copy
lafiona 44dd06c
Remove printing in C++ layer
lafiona 77cb963
Install libmexclass binaries in +libmexclass packaged folder to arrow…
sreeharihegden 61ae888
Specify CUSTOM_PROXY_FACTORY_HEADER_FILENAME and CUSTOM_PROXY_FACTORY…
kevingurney 80805b9
Remove Proxy subclasses.
kevingurney 1e4db94
Add basic custom display to arrow.array.DoubleArray which calls Print…
kevingurney e000ee1
Remove unused CustomDisplay subclass.
kevingurney 6ed4274
Remove UInt64Array and UInt8Array.
kevingurney 25fec16
Remove uint64 and uint8 C++ Proxy source code.
kevingurney d9afe91
Remove comment about 'No copy version'.
kevingurney cd7b7dc
Rearrange header order.
kevingurney 718ee4b
Rename CustomProxyFactory to ArrowProxyFactory.
kevingurney 64b2d04
Change namespace from proxy::array to arrow::matlab::proxy::array.
kevingurney 84acd9d
Remove calls to REGISTER_PROXY for UInt64Array and UInt8Array.
kevingurney 03b8132
Update #include for arrow_proxy_factory.h.
kevingurney cc3abaa
Remove references to UInt64 and UInt8 source files in CMakeLists.txt.
kevingurney 433cf35
Use scope resolution operator to resolve MDA symbol look-up issues.
kevingurney 5f3e5b4
Fix STRING typo in CMakeLists.txt.
kevingurney ac591ad
Change registered Proxy name from arrow.proxy.array.DoubleArrayProxy …
kevingurney e294427
Move double_array_proxy source code to array/proxy folder structure.
kevingurney 6dfba28
Rename DoubleArrayProxy to DoubleArray.
kevingurney 8b86eaa
Update CMakeLists.txt.
kevingurney 64f054f
Update MATLAB Proxy constructor call for arrow.array.DoubleArray to u…
kevingurney b69b598
Rename ArrowProxyFactory to Factory.
kevingurney cff7364
Update value of CUSTOM_PROXY_SOURCES to reflect new directory structure.
kevingurney c89d0fb
Fix CMAKE_SOURCE_DIR typo.
kevingurney f704e19
Add using namespace declaration for libmexclass::proxy to arrow::matl…
kevingurney 2ff931c
Disable warning output from find_package(Arrow) call by adding the QU…
kevingurney 0d800a2
Add tools/cmake to CMAKE_MODULE_PATH.
kevingurney dbc5881
Create tools/cmake directory. Add MATLAB_ARROW_INTERFACE flag.
kevingurney 8e7a3e7
Move libmexclass code into tools/cmake directory.
kevingurney 884d2b1
Fixed build error for MATLAB_ARROW_INTERFACE with include.
sreeharihegden 0ea2eb3
Inherit from matlab.mixin.CustomDisplay.
kevingurney cb85f7b
Remove comments referring to libmexclass in CMakeLists.txt.
kevingurney d845a92
Remove debug messages.
kevingurney 383afdc
Modify comments. Add success message for libmexclass build.
kevingurney 6b1bad9
Add MATLAB_ARROW_INTERFACE=ON to matlab_build.sh CI script.
kevingurney 807f743
Add arrow_ep as a dependency of libmexclass target.
kevingurney 95dbd12
Add basic MATLAB test for arrow.array.DoubleArray.
kevingurney 239ceaa
Add missing license headers.
kevingurney 4bf1153
Fix linting isssues in CMakeLists.txt.
kevingurney 5451d76
Rename arrow.array.DoubleArray to arrow.array.Float64Array.
kevingurney 6f00627
Use refactored libmexclass functionality via FetchContent.
kevingurney 0a22524
Use list(PREPEND ...) to modify CMAKE_MODULE_PATH.
kevingurney 2ddf128
Set Arrow_ROOT instead of modifying CMAKE_PREFIX_PATH to configure fi…
kevingurney 38f967a
Refactor logic for building Arrow from source in order to build Googl…
kevingurney 2e59596
Error when building in Debug mode on Windows by default.
kevingurney 37470dd
Revert changes related to erroring for Debug builds.
kevingurney 66f3548
Fix linting issues with matlab/CMakeLists.txt.
kevingurney 737950a
Add newlines for readability in ci/scripts/matlab_build.sh.
kevingurney 28721d7
Remove $ARROW_INCLUDE_DIRS from $MATLAB_ARROW_LIBMEXCLASS_CLIENT_PROX…
kevingurney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #include "float64_array.h" | ||
|
|
||
| namespace arrow::matlab::array::proxy { | ||
| void Float64Array::Print(libmexclass::proxy::method::Context& context) { | ||
| // TODO: Return an MDA string representation of the Arrow array. | ||
| std::cout << array->ToString() << std::endl; | ||
| } | ||
| } // namespace arrow::matlab::array::proxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include "arrow/array.h" | ||
| #include "arrow/builder.h" | ||
|
|
||
| #include "libmexclass/proxy/Proxy.h" | ||
|
|
||
| namespace arrow::matlab::array::proxy { | ||
| class Float64Array : public libmexclass::proxy::Proxy { | ||
| public: | ||
| Float64Array(const libmexclass::proxy::FunctionArguments& constructor_arguments) { | ||
| // Get the mxArray from constructor arguments | ||
| const ::matlab::data::TypedArray<double> double_mda = constructor_arguments[0]; | ||
|
|
||
| // Get raw pointer of mxArray | ||
| auto it(double_mda.cbegin()); | ||
| auto dt = it.operator->(); | ||
|
|
||
| // Pass pointer to Arrow array constructor that takes a buffer | ||
| // Do not make a copy when creating arrow::Buffer | ||
| std::shared_ptr<arrow::Buffer> buffer( | ||
| new arrow::Buffer(reinterpret_cast<const uint8_t*>(dt), | ||
| sizeof(double) * double_mda.getNumberOfElements())); | ||
|
|
||
| // Construct arrow::NumericArray specialization using arrow::Buffer. | ||
| // pass in nulls information...we could compute and provide the number of nulls here too | ||
| std::shared_ptr<arrow::Array> array_wrapper( | ||
| new arrow::NumericArray<arrow::DoubleType>(double_mda.getNumberOfElements(), buffer, | ||
| nullptr, // TODO: fill validity bitmap with data | ||
| -1)); | ||
|
|
||
| array = array_wrapper; | ||
|
|
||
| // Register Proxy methods. | ||
| REGISTER_METHOD(Float64Array, Print); | ||
| } | ||
| private: | ||
| void Print(libmexclass::proxy::method::Context& context); | ||
|
|
||
| // "Raw" arrow::Array | ||
| std::shared_ptr<arrow::Array> array; | ||
| }; | ||
| } // namespace arrow::matlab::array::proxy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #include "mex.hpp" | ||
| #include "mexAdapter.hpp" | ||
|
|
||
| #include "libmexclass/mex/gateway.h" | ||
|
|
||
| #include "arrow/matlab/proxy/factory.h" | ||
|
|
||
| class MexFunction : public matlab::mex::Function { | ||
| public: | ||
| void operator()(matlab::mex::ArgumentList outputs, matlab::mex::ArgumentList inputs) { | ||
| libmexclass::mex::gateway<arrow::matlab::proxy::Factory>(inputs, outputs, getEngine()); | ||
| } | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.