From 4b5d2f527a14360567bb5b81f683e6089e0b64b2 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 08:43:14 +0200 Subject: [PATCH 1/8] ci: try to do automatic formatting --- .github/workflows/code-format.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/code-format.yaml diff --git a/.github/workflows/code-format.yaml b/.github/workflows/code-format.yaml new file mode 100644 index 00000000..359756df --- /dev/null +++ b/.github/workflows/code-format.yaml @@ -0,0 +1,27 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + +name: format-code + +jobs: + format-code: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Format R code + uses: rstudio/shiny-workflows/format-r-code@v1 + with: + check: false + + - name: Format C++ code + uses: DoozyX/clang-format-lint-action@v0.15 + with: + clangFormatVersion: 15 + source: './' + exclude: './build' + inplace: true From 88dd8b597fced23df76986bd2c27da7a65e9d808 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 08:48:01 +0200 Subject: [PATCH 2/8] version 18? --- _pkgdown.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 _pkgdown.yml diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 00000000..d71acfb9 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: ~ +template: + bootstrap: 5 + From 29c2475a8206fc1d129a3a14faaabfd0d4303c2c Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 08:54:02 +0200 Subject: [PATCH 3/8] now? --- .github/workflows/code-format.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code-format.yaml b/.github/workflows/code-format.yaml index 359756df..2c2458a8 100644 --- a/.github/workflows/code-format.yaml +++ b/.github/workflows/code-format.yaml @@ -15,13 +15,9 @@ jobs: - name: Format R code uses: rstudio/shiny-workflows/format-r-code@v1 - with: - check: false - name: Format C++ code - uses: DoozyX/clang-format-lint-action@v0.15 + uses: jidicula/clang-format-action@v4.13.0 with: - clangFormatVersion: 15 - source: './' - exclude: './build' - inplace: true + clang-format-version: '18' + fallback-style: none From ace3c07876606fda1b99846773e1ce37840a78ae Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 10:46:23 +0200 Subject: [PATCH 4/8] only check --- .github/workflows/code-format.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-format.yaml b/.github/workflows/code-format.yaml index 2c2458a8..a453eb58 100644 --- a/.github/workflows/code-format.yaml +++ b/.github/workflows/code-format.yaml @@ -15,9 +15,9 @@ jobs: - name: Format R code uses: rstudio/shiny-workflows/format-r-code@v1 - + with: + check: true - name: Format C++ code uses: jidicula/clang-format-action@v4.13.0 with: - clang-format-version: '18' - fallback-style: none + clang-format-version: '20' From 0aa086bb06d7a671a4201e3dc1ebc674008e3b36 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 10:48:11 +0200 Subject: [PATCH 5/8] format src --- src/RcppExports.cpp | 413 ++++++++++++++++++++++++++------------------ src/pjrt.cpp | 104 ++++++----- src/pjrt_types.h | 130 +++++++------- src/program.cpp | 61 ++++--- src/program.h | 6 +- 5 files changed, 390 insertions(+), 324 deletions(-) diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 445f7006..1eecd5aa 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,231 +1,300 @@ // Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 -#include "pjrt_types.h" #include +#include "pjrt_types.h" + using namespace Rcpp; #ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); #endif // impl_plugin_load Rcpp::XPtr impl_plugin_load(const std::string& path); RcppExport SEXP _pjrt_impl_plugin_load(SEXP pathSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type path(pathSEXP); - rcpp_result_gen = Rcpp::wrap(impl_plugin_load(path)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter::type path(pathSEXP); + rcpp_result_gen = Rcpp::wrap(impl_plugin_load(path)); + return rcpp_result_gen; + END_RCPP } // impl_plugin_client_create -Rcpp::XPtr impl_plugin_client_create(Rcpp::XPtr plugin); +Rcpp::XPtr impl_plugin_client_create( + Rcpp::XPtr plugin); RcppExport SEXP _pjrt_impl_plugin_client_create(SEXP pluginSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type plugin(pluginSEXP); - rcpp_result_gen = Rcpp::wrap(impl_plugin_client_create(plugin)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type plugin( + pluginSEXP); + rcpp_result_gen = Rcpp::wrap(impl_plugin_client_create(plugin)); + return rcpp_result_gen; + END_RCPP } // impl_program_load -Rcpp::XPtr impl_program_load(const std::string& fname, const std::string& format); +Rcpp::XPtr impl_program_load(const std::string& fname, + const std::string& format); RcppExport SEXP _pjrt_impl_program_load(SEXP fnameSEXP, SEXP formatSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const std::string& >::type fname(fnameSEXP); - Rcpp::traits::input_parameter< const std::string& >::type format(formatSEXP); - rcpp_result_gen = Rcpp::wrap(impl_program_load(fname, format)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter::type fname(fnameSEXP); + Rcpp::traits::input_parameter::type format(formatSEXP); + rcpp_result_gen = Rcpp::wrap(impl_program_load(fname, format)); + return rcpp_result_gen; + END_RCPP } // impl_program_repr std::string impl_program_repr(Rcpp::XPtr program, int n); RcppExport SEXP _pjrt_impl_program_repr(SEXP programSEXP, SEXP nSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type program(programSEXP); - Rcpp::traits::input_parameter< int >::type n(nSEXP); - rcpp_result_gen = Rcpp::wrap(impl_program_repr(program, n)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type program( + programSEXP); + Rcpp::traits::input_parameter::type n(nSEXP); + rcpp_result_gen = Rcpp::wrap(impl_program_repr(program, n)); + return rcpp_result_gen; + END_RCPP } // impl_build_options_create -Rcpp::XPtr impl_build_options_create(const int num_replicas, const int num_partitions, const int device_ordinal); -RcppExport SEXP _pjrt_impl_build_options_create(SEXP num_replicasSEXP, SEXP num_partitionsSEXP, SEXP device_ordinalSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< const int >::type num_replicas(num_replicasSEXP); - Rcpp::traits::input_parameter< const int >::type num_partitions(num_partitionsSEXP); - Rcpp::traits::input_parameter< const int >::type device_ordinal(device_ordinalSEXP); - rcpp_result_gen = Rcpp::wrap(impl_build_options_create(num_replicas, num_partitions, device_ordinal)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_build_options_create( + const int num_replicas, const int num_partitions, const int device_ordinal); +RcppExport SEXP _pjrt_impl_build_options_create(SEXP num_replicasSEXP, + SEXP num_partitionsSEXP, + SEXP device_ordinalSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter::type num_replicas(num_replicasSEXP); + Rcpp::traits::input_parameter::type num_partitions( + num_partitionsSEXP); + Rcpp::traits::input_parameter::type device_ordinal( + device_ordinalSEXP); + rcpp_result_gen = Rcpp::wrap( + impl_build_options_create(num_replicas, num_partitions, device_ordinal)); + return rcpp_result_gen; + END_RCPP } // impl_compile_options_create -Rcpp::XPtr impl_compile_options_create(Rcpp::XPtr build_options); +Rcpp::XPtr impl_compile_options_create( + Rcpp::XPtr build_options); RcppExport SEXP _pjrt_impl_compile_options_create(SEXP build_optionsSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type build_options(build_optionsSEXP); - rcpp_result_gen = Rcpp::wrap(impl_compile_options_create(build_options)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type + build_options(build_optionsSEXP); + rcpp_result_gen = Rcpp::wrap(impl_compile_options_create(build_options)); + return rcpp_result_gen; + END_RCPP } // impl_client_program_compile -Rcpp::XPtr impl_client_program_compile(Rcpp::XPtr client, Rcpp::XPtr program, Rcpp::XPtr compile_options); -RcppExport SEXP _pjrt_impl_client_program_compile(SEXP clientSEXP, SEXP programSEXP, SEXP compile_optionsSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type program(programSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type compile_options(compile_optionsSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_program_compile(client, program, compile_options)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_client_program_compile( + Rcpp::XPtr client, + Rcpp::XPtr program, + Rcpp::XPtr compile_options); +RcppExport SEXP _pjrt_impl_client_program_compile(SEXP clientSEXP, + SEXP programSEXP, + SEXP compile_optionsSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + Rcpp::traits::input_parameter >::type program( + programSEXP); + Rcpp::traits::input_parameter >::type + compile_options(compile_optionsSEXP); + rcpp_result_gen = + Rcpp::wrap(impl_client_program_compile(client, program, compile_options)); + return rcpp_result_gen; + END_RCPP } // impl_client_buffer_from_double -Rcpp::XPtr impl_client_buffer_from_double(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_double(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); - Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); - Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_double(client, data, dims, type)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_client_buffer_from_double( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_double(SEXP clientSEXP, + SEXP dataSEXP, + SEXP dimsSEXP, + SEXP typeSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + Rcpp::traits::input_parameter::type data(dataSEXP); + Rcpp::traits::input_parameter >::type dims(dimsSEXP); + Rcpp::traits::input_parameter::type type(typeSEXP); + rcpp_result_gen = + Rcpp::wrap(impl_client_buffer_from_double(client, data, dims, type)); + return rcpp_result_gen; + END_RCPP } // impl_client_buffer_from_integer -Rcpp::XPtr impl_client_buffer_from_integer(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_integer(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); - Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); - Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_integer(client, data, dims, type)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_client_buffer_from_integer( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_integer(SEXP clientSEXP, + SEXP dataSEXP, + SEXP dimsSEXP, + SEXP typeSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + Rcpp::traits::input_parameter::type data(dataSEXP); + Rcpp::traits::input_parameter >::type dims(dimsSEXP); + Rcpp::traits::input_parameter::type type(typeSEXP); + rcpp_result_gen = + Rcpp::wrap(impl_client_buffer_from_integer(client, data, dims, type)); + return rcpp_result_gen; + END_RCPP } // impl_client_buffer_from_logical -Rcpp::XPtr impl_client_buffer_from_logical(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_logical(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); - Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); - Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_logical(client, data, dims, type)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_client_buffer_from_logical( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_logical(SEXP clientSEXP, + SEXP dataSEXP, + SEXP dimsSEXP, + SEXP typeSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + Rcpp::traits::input_parameter::type data(dataSEXP); + Rcpp::traits::input_parameter >::type dims(dimsSEXP); + Rcpp::traits::input_parameter::type type(typeSEXP); + rcpp_result_gen = + Rcpp::wrap(impl_client_buffer_from_logical(client, data, dims, type)); + return rcpp_result_gen; + END_RCPP } // impl_client_buffer_to_host -SEXP impl_client_buffer_to_host(Rcpp::XPtr client, Rcpp::XPtr buffer); -RcppExport SEXP _pjrt_impl_client_buffer_to_host(SEXP clientSEXP, SEXP bufferSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_buffer_to_host(client, buffer)); - return rcpp_result_gen; -END_RCPP +SEXP impl_client_buffer_to_host(Rcpp::XPtr client, + Rcpp::XPtr buffer); +RcppExport SEXP _pjrt_impl_client_buffer_to_host(SEXP clientSEXP, + SEXP bufferSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + Rcpp::traits::input_parameter >::type buffer( + bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_buffer_to_host(client, buffer)); + return rcpp_result_gen; + END_RCPP } // impl_client_platform_name std::string impl_client_platform_name(Rcpp::XPtr client); RcppExport SEXP _pjrt_impl_client_platform_name(SEXP clientSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_platform_name(client)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type client( + clientSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_platform_name(client)); + return rcpp_result_gen; + END_RCPP } // impl_loaded_executable_execute -Rcpp::XPtr impl_loaded_executable_execute(Rcpp::XPtr executable, Rcpp::List input); -RcppExport SEXP _pjrt_impl_loaded_executable_execute(SEXP executableSEXP, SEXP inputSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type executable(executableSEXP); - Rcpp::traits::input_parameter< Rcpp::List >::type input(inputSEXP); - rcpp_result_gen = Rcpp::wrap(impl_loaded_executable_execute(executable, input)); - return rcpp_result_gen; -END_RCPP +Rcpp::XPtr impl_loaded_executable_execute( + Rcpp::XPtr executable, Rcpp::List input); +RcppExport SEXP _pjrt_impl_loaded_executable_execute(SEXP executableSEXP, + SEXP inputSEXP) { + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type + executable(executableSEXP); + Rcpp::traits::input_parameter::type input(inputSEXP); + rcpp_result_gen = + Rcpp::wrap(impl_loaded_executable_execute(executable, input)); + return rcpp_result_gen; + END_RCPP } // impl_buffer_element_type -Rcpp::XPtr impl_buffer_element_type(Rcpp::XPtr buffer); +Rcpp::XPtr impl_buffer_element_type( + Rcpp::XPtr buffer); RcppExport SEXP _pjrt_impl_buffer_element_type(SEXP bufferSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_buffer_element_type(buffer)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type buffer( + bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_buffer_element_type(buffer)); + return rcpp_result_gen; + END_RCPP } // impl_element_type_as_string -std::string impl_element_type_as_string(Rcpp::XPtr element_type); +std::string impl_element_type_as_string( + Rcpp::XPtr element_type); RcppExport SEXP _pjrt_impl_element_type_as_string(SEXP element_typeSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type element_type(element_typeSEXP); - rcpp_result_gen = Rcpp::wrap(impl_element_type_as_string(element_type)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type + element_type(element_typeSEXP); + rcpp_result_gen = Rcpp::wrap(impl_element_type_as_string(element_type)); + return rcpp_result_gen; + END_RCPP } // impl_buffer_dimensions -std::vector impl_buffer_dimensions(Rcpp::XPtr buffer); +std::vector impl_buffer_dimensions( + Rcpp::XPtr buffer); RcppExport SEXP _pjrt_impl_buffer_dimensions(SEXP bufferSEXP) { -BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_buffer_dimensions(buffer)); - return rcpp_result_gen; -END_RCPP + BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter >::type buffer( + bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_buffer_dimensions(buffer)); + return rcpp_result_gen; + END_RCPP } static const R_CallMethodDef CallEntries[] = { - {"_pjrt_impl_plugin_load", (DL_FUNC) &_pjrt_impl_plugin_load, 1}, - {"_pjrt_impl_plugin_client_create", (DL_FUNC) &_pjrt_impl_plugin_client_create, 1}, - {"_pjrt_impl_program_load", (DL_FUNC) &_pjrt_impl_program_load, 2}, - {"_pjrt_impl_program_repr", (DL_FUNC) &_pjrt_impl_program_repr, 2}, - {"_pjrt_impl_build_options_create", (DL_FUNC) &_pjrt_impl_build_options_create, 3}, - {"_pjrt_impl_compile_options_create", (DL_FUNC) &_pjrt_impl_compile_options_create, 1}, - {"_pjrt_impl_client_program_compile", (DL_FUNC) &_pjrt_impl_client_program_compile, 3}, - {"_pjrt_impl_client_buffer_from_double", (DL_FUNC) &_pjrt_impl_client_buffer_from_double, 4}, - {"_pjrt_impl_client_buffer_from_integer", (DL_FUNC) &_pjrt_impl_client_buffer_from_integer, 4}, - {"_pjrt_impl_client_buffer_from_logical", (DL_FUNC) &_pjrt_impl_client_buffer_from_logical, 4}, - {"_pjrt_impl_client_buffer_to_host", (DL_FUNC) &_pjrt_impl_client_buffer_to_host, 2}, - {"_pjrt_impl_client_platform_name", (DL_FUNC) &_pjrt_impl_client_platform_name, 1}, - {"_pjrt_impl_loaded_executable_execute", (DL_FUNC) &_pjrt_impl_loaded_executable_execute, 2}, - {"_pjrt_impl_buffer_element_type", (DL_FUNC) &_pjrt_impl_buffer_element_type, 1}, - {"_pjrt_impl_element_type_as_string", (DL_FUNC) &_pjrt_impl_element_type_as_string, 1}, - {"_pjrt_impl_buffer_dimensions", (DL_FUNC) &_pjrt_impl_buffer_dimensions, 1}, - {NULL, NULL, 0} -}; + {"_pjrt_impl_plugin_load", (DL_FUNC)&_pjrt_impl_plugin_load, 1}, + {"_pjrt_impl_plugin_client_create", + (DL_FUNC)&_pjrt_impl_plugin_client_create, 1}, + {"_pjrt_impl_program_load", (DL_FUNC)&_pjrt_impl_program_load, 2}, + {"_pjrt_impl_program_repr", (DL_FUNC)&_pjrt_impl_program_repr, 2}, + {"_pjrt_impl_build_options_create", + (DL_FUNC)&_pjrt_impl_build_options_create, 3}, + {"_pjrt_impl_compile_options_create", + (DL_FUNC)&_pjrt_impl_compile_options_create, 1}, + {"_pjrt_impl_client_program_compile", + (DL_FUNC)&_pjrt_impl_client_program_compile, 3}, + {"_pjrt_impl_client_buffer_from_double", + (DL_FUNC)&_pjrt_impl_client_buffer_from_double, 4}, + {"_pjrt_impl_client_buffer_from_integer", + (DL_FUNC)&_pjrt_impl_client_buffer_from_integer, 4}, + {"_pjrt_impl_client_buffer_from_logical", + (DL_FUNC)&_pjrt_impl_client_buffer_from_logical, 4}, + {"_pjrt_impl_client_buffer_to_host", + (DL_FUNC)&_pjrt_impl_client_buffer_to_host, 2}, + {"_pjrt_impl_client_platform_name", + (DL_FUNC)&_pjrt_impl_client_platform_name, 1}, + {"_pjrt_impl_loaded_executable_execute", + (DL_FUNC)&_pjrt_impl_loaded_executable_execute, 2}, + {"_pjrt_impl_buffer_element_type", (DL_FUNC)&_pjrt_impl_buffer_element_type, + 1}, + {"_pjrt_impl_element_type_as_string", + (DL_FUNC)&_pjrt_impl_element_type_as_string, 1}, + {"_pjrt_impl_buffer_dimensions", (DL_FUNC)&_pjrt_impl_buffer_dimensions, 1}, + {NULL, NULL, 0}}; -RcppExport void R_init_pjrt(DllInfo *dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); +RcppExport void R_init_pjrt(DllInfo* dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); } diff --git a/src/pjrt.cpp b/src/pjrt.cpp index c9dbc9b1..67f6df92 100644 --- a/src/pjrt.cpp +++ b/src/pjrt.cpp @@ -16,8 +16,8 @@ Rcpp::XPtr impl_plugin_load(const std::string &path) { } // [[Rcpp::export()]] -Rcpp::XPtr -impl_plugin_client_create(Rcpp::XPtr plugin) { +Rcpp::XPtr impl_plugin_client_create( + Rcpp::XPtr plugin) { auto client = plugin->client_create(); Rcpp::XPtr xptr(client.release(), true); xptr.attr("class") = "PJRTClient"; @@ -49,10 +49,9 @@ std::string impl_program_repr(Rcpp::XPtr program, } // [[Rcpp::export()]] -Rcpp::XPtr -impl_build_options_create(const int num_replicas = 1, - const int num_partitions = 1, - const int device_ordinal = -1) { +Rcpp::XPtr impl_build_options_create( + const int num_replicas = 1, const int num_partitions = 1, + const int device_ordinal = -1) { auto build_options = std::make_unique( num_replicas, num_partitions, device_ordinal); Rcpp::XPtr xptr(build_options.release(), true); @@ -61,8 +60,8 @@ impl_build_options_create(const int num_replicas = 1, } // [[Rcpp::export()]] -Rcpp::XPtr -impl_compile_options_create(Rcpp::XPtr build_options) { +Rcpp::XPtr impl_compile_options_create( + Rcpp::XPtr build_options) { auto compile_options = std::make_unique(build_options->clone()); Rcpp::XPtr xptr(compile_options.release(), true); @@ -84,10 +83,9 @@ Rcpp::XPtr impl_client_program_compile( // Helper template function for buffer creation from R data template -Rcpp::XPtr -create_buffer_from_r_data(Rcpp::XPtr client, SEXP data, - const std::vector &dims, - PJRT_Buffer_Type dtype) { +Rcpp::XPtr create_buffer_from_r_data( + Rcpp::XPtr client, SEXP data, + const std::vector &dims, PJRT_Buffer_Type dtype) { int len = Rf_length(data); if (len == 0) { Rcpp::stop("Data must be a non-empty vector."); @@ -130,9 +128,9 @@ create_buffer_from_r_data(Rcpp::XPtr client, SEXP data, } // [[Rcpp::export()]] -Rcpp::XPtr -impl_client_buffer_from_double(Rcpp::XPtr client, SEXP data, - std::vector dims, std::string type) { +Rcpp::XPtr impl_client_buffer_from_double( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type) { if (type == "f32") { return create_buffer_from_r_data(client, data, dims, PJRT_Buffer_Type_F32); @@ -145,9 +143,9 @@ impl_client_buffer_from_double(Rcpp::XPtr client, SEXP data, } // [[Rcpp::export()]] -Rcpp::XPtr -impl_client_buffer_from_integer(Rcpp::XPtr client, SEXP data, - std::vector dims, std::string type) { +Rcpp::XPtr impl_client_buffer_from_integer( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type) { if (type == "s8") { return create_buffer_from_r_data(client, data, dims, PJRT_Buffer_Type_S8); @@ -178,9 +176,9 @@ impl_client_buffer_from_integer(Rcpp::XPtr client, SEXP data, } // [[Rcpp::export()]] -Rcpp::XPtr -impl_client_buffer_from_logical(Rcpp::XPtr client, SEXP data, - std::vector dims, std::string type) { +Rcpp::XPtr impl_client_buffer_from_logical( + Rcpp::XPtr client, SEXP data, std::vector dims, + std::string type) { if (type == "pred") { return create_buffer_from_r_data(client, data, dims, PJRT_Buffer_Type_PRED); @@ -230,10 +228,10 @@ SEXP convert_buffer_to_r(Rcpp::XPtr client, int *dim_data = INTEGER(dim_attr); std::copy(dimensions.begin(), dimensions.end(), dim_data); Rf_setAttrib(out, R_DimSymbol, dim_attr); - UNPROTECT(1); // Unprotect dim_attr + UNPROTECT(1); // Unprotect dim_attr } - UNPROTECT(1); // Unprotect out + UNPROTECT(1); // Unprotect out return out; } @@ -244,30 +242,30 @@ SEXP impl_client_buffer_to_host(Rcpp::XPtr client, const auto element_type = buffer->element_type(); switch (element_type) { - case PJRT_Buffer_Type_F32: - return convert_buffer_to_r(client, buffer, dimensions, REALSXP); - case PJRT_Buffer_Type_F64: - return convert_buffer_to_r(client, buffer, dimensions, REALSXP); - case PJRT_Buffer_Type_S8: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_S16: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_S32: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_S64: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_U8: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_U16: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_U32: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_U64: - return convert_buffer_to_r(client, buffer, dimensions, INTSXP); - case PJRT_Buffer_Type_PRED: - return convert_buffer_to_r(client, buffer, dimensions, LGLSXP); - default: - Rcpp::stop("Unsupported buffer element type for conversion to host."); + case PJRT_Buffer_Type_F32: + return convert_buffer_to_r(client, buffer, dimensions, REALSXP); + case PJRT_Buffer_Type_F64: + return convert_buffer_to_r(client, buffer, dimensions, REALSXP); + case PJRT_Buffer_Type_S8: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_S16: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_S32: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_S64: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_U8: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_U16: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_U32: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_U64: + return convert_buffer_to_r(client, buffer, dimensions, INTSXP); + case PJRT_Buffer_Type_PRED: + return convert_buffer_to_r(client, buffer, dimensions, LGLSXP); + default: + Rcpp::stop("Unsupported buffer element type for conversion to host."); } } @@ -293,8 +291,8 @@ Rcpp::XPtr impl_loaded_executable_execute( } // [[Rcpp::export()]] -Rcpp::XPtr -impl_buffer_element_type(Rcpp::XPtr buffer) { +Rcpp::XPtr impl_buffer_element_type( + Rcpp::XPtr buffer) { auto element_type = std::make_unique(buffer->element_type()); Rcpp::XPtr xptr(element_type.release(), true); @@ -303,13 +301,13 @@ impl_buffer_element_type(Rcpp::XPtr buffer) { } // [[Rcpp::export()]] -std::string -impl_element_type_as_string(Rcpp::XPtr element_type) { +std::string impl_element_type_as_string( + Rcpp::XPtr element_type) { return element_type->as_string(); } // [[Rcpp::export()]] -std::vector -impl_buffer_dimensions(Rcpp::XPtr buffer) { +std::vector impl_buffer_dimensions( + Rcpp::XPtr buffer) { return buffer->dimensions(); } diff --git a/src/pjrt_types.h b/src/pjrt_types.h index 7f26df09..bdc49e64 100644 --- a/src/pjrt_types.h +++ b/src/pjrt_types.h @@ -9,7 +9,7 @@ namespace rpjrt { class PJRTElementType { -public: + public: explicit PJRTElementType(PJRT_Buffer_Type type) : element_type_(type) {} PJRT_Buffer_Type get_type() const { return element_type_; } @@ -18,73 +18,73 @@ class PJRTElementType { std::string as_string() const { switch (element_type_) { - case PJRT_Buffer_Type_INVALID: - return "INVALID"; - case PJRT_Buffer_Type_PRED: - return "PRED"; - case PJRT_Buffer_Type_S8: - return "S8"; - case PJRT_Buffer_Type_S16: - return "S16"; - case PJRT_Buffer_Type_S32: - return "S32"; - case PJRT_Buffer_Type_S64: - return "S64"; - case PJRT_Buffer_Type_U8: - return "U8"; - case PJRT_Buffer_Type_U16: - return "U16"; - case PJRT_Buffer_Type_U32: - return "U32"; - case PJRT_Buffer_Type_U64: - return "U64"; - case PJRT_Buffer_Type_F16: - return "F16"; - case PJRT_Buffer_Type_F32: - return "F32"; - case PJRT_Buffer_Type_F64: - return "F64"; - case PJRT_Buffer_Type_BF16: - return "BF16"; - case PJRT_Buffer_Type_C64: - return "C64"; - case PJRT_Buffer_Type_C128: - return "C128"; - case PJRT_Buffer_Type_F8E5M2: - return "F8E5M2"; - case PJRT_Buffer_Type_F8E4M3FN: - return "F8E4M3FN"; - case PJRT_Buffer_Type_F8E4M3B11FNUZ: - return "F8E4M3B11FNUZ"; - case PJRT_Buffer_Type_F8E5M2FNUZ: - return "F8E5M2FNUZ"; - case PJRT_Buffer_Type_F8E4M3FNUZ: - return "F8E4M3FNUZ"; - case PJRT_Buffer_Type_S4: - return "S4"; - case PJRT_Buffer_Type_U4: - return "U4"; - case PJRT_Buffer_Type_TOKEN: - return "TOKEN"; - case PJRT_Buffer_Type_S2: - return "S2"; - case PJRT_Buffer_Type_U2: - return "U2"; - case PJRT_Buffer_Type_F8E4M3: - return "F8E4M3"; - case PJRT_Buffer_Type_F8E3M4: - return "F8E3M4"; - case PJRT_Buffer_Type_F8E8M0FNU: - return "F8E8M0FNU"; - case PJRT_Buffer_Type_F4E2M1FN: - return "F4E2M1FN"; - default: - return "UNKNOWN(" + std::to_string(as_integer()) + ")"; + case PJRT_Buffer_Type_INVALID: + return "INVALID"; + case PJRT_Buffer_Type_PRED: + return "PRED"; + case PJRT_Buffer_Type_S8: + return "S8"; + case PJRT_Buffer_Type_S16: + return "S16"; + case PJRT_Buffer_Type_S32: + return "S32"; + case PJRT_Buffer_Type_S64: + return "S64"; + case PJRT_Buffer_Type_U8: + return "U8"; + case PJRT_Buffer_Type_U16: + return "U16"; + case PJRT_Buffer_Type_U32: + return "U32"; + case PJRT_Buffer_Type_U64: + return "U64"; + case PJRT_Buffer_Type_F16: + return "F16"; + case PJRT_Buffer_Type_F32: + return "F32"; + case PJRT_Buffer_Type_F64: + return "F64"; + case PJRT_Buffer_Type_BF16: + return "BF16"; + case PJRT_Buffer_Type_C64: + return "C64"; + case PJRT_Buffer_Type_C128: + return "C128"; + case PJRT_Buffer_Type_F8E5M2: + return "F8E5M2"; + case PJRT_Buffer_Type_F8E4M3FN: + return "F8E4M3FN"; + case PJRT_Buffer_Type_F8E4M3B11FNUZ: + return "F8E4M3B11FNUZ"; + case PJRT_Buffer_Type_F8E5M2FNUZ: + return "F8E5M2FNUZ"; + case PJRT_Buffer_Type_F8E4M3FNUZ: + return "F8E4M3FNUZ"; + case PJRT_Buffer_Type_S4: + return "S4"; + case PJRT_Buffer_Type_U4: + return "U4"; + case PJRT_Buffer_Type_TOKEN: + return "TOKEN"; + case PJRT_Buffer_Type_S2: + return "S2"; + case PJRT_Buffer_Type_U2: + return "U2"; + case PJRT_Buffer_Type_F8E4M3: + return "F8E4M3"; + case PJRT_Buffer_Type_F8E3M4: + return "F8E3M4"; + case PJRT_Buffer_Type_F8E8M0FNU: + return "F8E8M0FNU"; + case PJRT_Buffer_Type_F4E2M1FN: + return "F4E2M1FN"; + default: + return "UNKNOWN(" + std::to_string(as_integer()) + ")"; } } -private: + private: PJRT_Buffer_Type element_type_; }; -} // namespace rpjrt +} // namespace rpjrt diff --git a/src/program.cpp b/src/program.cpp index 919b057d..e3901ee6 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -22,22 +22,21 @@ PJRTProgramFormat PJRTProgram::format() const { } } -std::string -PJRTProgram::load_program_from_file(const std::string &fname, - const PJRTProgramFormat &format) { +std::string PJRTProgram::load_program_from_file( + const std::string &fname, const PJRTProgramFormat &format) { std::ifstream input(fname, std::ios::binary | std::ios::ate); std::streamsize size = input.tellg(); - input.seekg(0, std::ios::beg); // rewind + input.seekg(0, std::ios::beg); // rewind std::vector buffer(size); input.read(buffer.data(), size); switch (format) { - case HLO: - return parse_hlo_program(buffer); - break; - case MLIR: - return std::string(buffer.data(), buffer.size()); - break; + case HLO: + return parse_hlo_program(buffer); + break; + case MLIR: + return std::string(buffer.data(), buffer.size()); + break; }; throw std::runtime_error("Unknown program format"); @@ -52,16 +51,16 @@ PJRT_Program PJRTProgram::create_program(std::string &code, program.code_size = code.size(); switch (format) { - case HLO: - program.format = "hlo"; - program.format_size = strlen("hlo"); - break; - case MLIR: - program.format = "mlir"; - program.format_size = strlen("mlir"); - break; - default: - throw std::runtime_error("Unknown program format"); + case HLO: + program.format = "hlo"; + program.format_size = strlen("hlo"); + break; + case MLIR: + program.format = "mlir"; + program.format_size = strlen("mlir"); + break; + default: + throw std::runtime_error("Unknown program format"); } return program; @@ -80,14 +79,14 @@ std::string PJRTProgram::repr(int n) const { auto format = this->format(); std::string debug(""); switch (format) { - case HLO: { - xla::HloModuleProto hlo_proto{}; - hlo_proto.ParseFromArray(this->code.data(), this->code.size()); - debug = hlo_proto.DebugString(); - } break; - case MLIR: - debug = this->code; - break; + case HLO: { + xla::HloModuleProto hlo_proto{}; + hlo_proto.ParseFromArray(this->code.data(), this->code.size()); + debug = hlo_proto.DebugString(); + } break; + case MLIR: + debug = this->code; + break; } // debug must not be larger than n lines @@ -99,7 +98,7 @@ std::string PJRTProgram::repr(int n) const { pos = debug.find('\n', pos); if (pos != std::string::npos) { lines_found++; - pos++; // Move past the newline + pos++; // Move past the newline } } @@ -108,11 +107,11 @@ std::string PJRTProgram::repr(int n) const { // Check if there's more content after the nth line if (pos < debug.length()) { debug = debug.substr(0, pos - 1) + - "\n..."; // pos-1 to include the nth newline + "\n..."; // pos-1 to include the nth newline } } return repr + "\n" + debug; } -} // namespace rpjrt +} // namespace rpjrt diff --git a/src/program.h b/src/program.h index 295753cb..77f1e6dd 100644 --- a/src/program.h +++ b/src/program.h @@ -9,18 +9,18 @@ namespace rpjrt { enum PJRTProgramFormat { HLO, MLIR }; class PJRTProgram { -public: + public: PJRTProgram(const std::string &fname, const PJRTProgramFormat &format); PJRTProgramFormat format() const; std::string repr(int n) const; std::string code; PJRT_Program program; -private: + private: static std::string load_program_from_file(const std::string &fname, const PJRTProgramFormat &format); static std::string parse_hlo_program(const std::vector &buffer); static PJRT_Program create_program(std::string &code, const PJRTProgramFormat &format); }; -} // namespace rpjrt +} // namespace rpjrt From df6a0ef434937bcef7a93def2b85d0dc328d1cf9 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 10:49:09 +0200 Subject: [PATCH 6/8] naming --- .../workflows/{code-format.yaml => check-code-style.yaml} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .github/workflows/{code-format.yaml => check-code-style.yaml} (84%) diff --git a/.github/workflows/code-format.yaml b/.github/workflows/check-code-style.yaml similarity index 84% rename from .github/workflows/code-format.yaml rename to .github/workflows/check-code-style.yaml index a453eb58..6d8053a2 100644 --- a/.github/workflows/code-format.yaml +++ b/.github/workflows/check-code-style.yaml @@ -5,19 +5,19 @@ on: branches: [main, master] pull_request: -name: format-code +name: Check Code Style jobs: - format-code: + check-code-style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Format R code + - name: R code uses: rstudio/shiny-workflows/format-r-code@v1 with: check: true - - name: Format C++ code + - name: C++ code uses: jidicula/clang-format-action@v4.13.0 with: clang-format-version: '20' From 8e5211952edd2d43029cee6fd3aa127d778d10d1 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 10:50:18 +0200 Subject: [PATCH 7/8] only src folder --- .github/workflows/check-code-style.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-code-style.yaml b/.github/workflows/check-code-style.yaml index 6d8053a2..cc052093 100644 --- a/.github/workflows/check-code-style.yaml +++ b/.github/workflows/check-code-style.yaml @@ -21,3 +21,4 @@ jobs: uses: jidicula/clang-format-action@v4.13.0 with: clang-format-version: '20' + check-path: ./src From a61a21a32daeb0b7440ba157fe9ab1eaa1cbe976 Mon Sep 17 00:00:00 2001 From: Sebastian Fischer Date: Sat, 12 Jul 2025 11:00:42 +0200 Subject: [PATCH 8/8] ... --- .github/workflows/check-code-style.yaml | 1 + src/RcppExports.cpp | 413 ++++++++++-------------- 2 files changed, 173 insertions(+), 241 deletions(-) diff --git a/.github/workflows/check-code-style.yaml b/.github/workflows/check-code-style.yaml index cc052093..ae99dfb4 100644 --- a/.github/workflows/check-code-style.yaml +++ b/.github/workflows/check-code-style.yaml @@ -22,3 +22,4 @@ jobs: with: clang-format-version: '20' check-path: ./src + exclude-regex: RcppExports diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp index 1eecd5aa..445f7006 100644 --- a/src/RcppExports.cpp +++ b/src/RcppExports.cpp @@ -1,300 +1,231 @@ // Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 -#include - #include "pjrt_types.h" +#include using namespace Rcpp; #ifdef RCPP_USE_GLOBAL_ROSTREAM -Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); #endif // impl_plugin_load Rcpp::XPtr impl_plugin_load(const std::string& path); RcppExport SEXP _pjrt_impl_plugin_load(SEXP pathSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter::type path(pathSEXP); - rcpp_result_gen = Rcpp::wrap(impl_plugin_load(path)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::string& >::type path(pathSEXP); + rcpp_result_gen = Rcpp::wrap(impl_plugin_load(path)); + return rcpp_result_gen; +END_RCPP } // impl_plugin_client_create -Rcpp::XPtr impl_plugin_client_create( - Rcpp::XPtr plugin); +Rcpp::XPtr impl_plugin_client_create(Rcpp::XPtr plugin); RcppExport SEXP _pjrt_impl_plugin_client_create(SEXP pluginSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type plugin( - pluginSEXP); - rcpp_result_gen = Rcpp::wrap(impl_plugin_client_create(plugin)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type plugin(pluginSEXP); + rcpp_result_gen = Rcpp::wrap(impl_plugin_client_create(plugin)); + return rcpp_result_gen; +END_RCPP } // impl_program_load -Rcpp::XPtr impl_program_load(const std::string& fname, - const std::string& format); +Rcpp::XPtr impl_program_load(const std::string& fname, const std::string& format); RcppExport SEXP _pjrt_impl_program_load(SEXP fnameSEXP, SEXP formatSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter::type fname(fnameSEXP); - Rcpp::traits::input_parameter::type format(formatSEXP); - rcpp_result_gen = Rcpp::wrap(impl_program_load(fname, format)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const std::string& >::type fname(fnameSEXP); + Rcpp::traits::input_parameter< const std::string& >::type format(formatSEXP); + rcpp_result_gen = Rcpp::wrap(impl_program_load(fname, format)); + return rcpp_result_gen; +END_RCPP } // impl_program_repr std::string impl_program_repr(Rcpp::XPtr program, int n); RcppExport SEXP _pjrt_impl_program_repr(SEXP programSEXP, SEXP nSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type program( - programSEXP); - Rcpp::traits::input_parameter::type n(nSEXP); - rcpp_result_gen = Rcpp::wrap(impl_program_repr(program, n)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type program(programSEXP); + Rcpp::traits::input_parameter< int >::type n(nSEXP); + rcpp_result_gen = Rcpp::wrap(impl_program_repr(program, n)); + return rcpp_result_gen; +END_RCPP } // impl_build_options_create -Rcpp::XPtr impl_build_options_create( - const int num_replicas, const int num_partitions, const int device_ordinal); -RcppExport SEXP _pjrt_impl_build_options_create(SEXP num_replicasSEXP, - SEXP num_partitionsSEXP, - SEXP device_ordinalSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter::type num_replicas(num_replicasSEXP); - Rcpp::traits::input_parameter::type num_partitions( - num_partitionsSEXP); - Rcpp::traits::input_parameter::type device_ordinal( - device_ordinalSEXP); - rcpp_result_gen = Rcpp::wrap( - impl_build_options_create(num_replicas, num_partitions, device_ordinal)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_build_options_create(const int num_replicas, const int num_partitions, const int device_ordinal); +RcppExport SEXP _pjrt_impl_build_options_create(SEXP num_replicasSEXP, SEXP num_partitionsSEXP, SEXP device_ordinalSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< const int >::type num_replicas(num_replicasSEXP); + Rcpp::traits::input_parameter< const int >::type num_partitions(num_partitionsSEXP); + Rcpp::traits::input_parameter< const int >::type device_ordinal(device_ordinalSEXP); + rcpp_result_gen = Rcpp::wrap(impl_build_options_create(num_replicas, num_partitions, device_ordinal)); + return rcpp_result_gen; +END_RCPP } // impl_compile_options_create -Rcpp::XPtr impl_compile_options_create( - Rcpp::XPtr build_options); +Rcpp::XPtr impl_compile_options_create(Rcpp::XPtr build_options); RcppExport SEXP _pjrt_impl_compile_options_create(SEXP build_optionsSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type - build_options(build_optionsSEXP); - rcpp_result_gen = Rcpp::wrap(impl_compile_options_create(build_options)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type build_options(build_optionsSEXP); + rcpp_result_gen = Rcpp::wrap(impl_compile_options_create(build_options)); + return rcpp_result_gen; +END_RCPP } // impl_client_program_compile -Rcpp::XPtr impl_client_program_compile( - Rcpp::XPtr client, - Rcpp::XPtr program, - Rcpp::XPtr compile_options); -RcppExport SEXP _pjrt_impl_client_program_compile(SEXP clientSEXP, - SEXP programSEXP, - SEXP compile_optionsSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - Rcpp::traits::input_parameter >::type program( - programSEXP); - Rcpp::traits::input_parameter >::type - compile_options(compile_optionsSEXP); - rcpp_result_gen = - Rcpp::wrap(impl_client_program_compile(client, program, compile_options)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_client_program_compile(Rcpp::XPtr client, Rcpp::XPtr program, Rcpp::XPtr compile_options); +RcppExport SEXP _pjrt_impl_client_program_compile(SEXP clientSEXP, SEXP programSEXP, SEXP compile_optionsSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type program(programSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type compile_options(compile_optionsSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_program_compile(client, program, compile_options)); + return rcpp_result_gen; +END_RCPP } // impl_client_buffer_from_double -Rcpp::XPtr impl_client_buffer_from_double( - Rcpp::XPtr client, SEXP data, std::vector dims, - std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_double(SEXP clientSEXP, - SEXP dataSEXP, - SEXP dimsSEXP, - SEXP typeSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - Rcpp::traits::input_parameter::type data(dataSEXP); - Rcpp::traits::input_parameter >::type dims(dimsSEXP); - Rcpp::traits::input_parameter::type type(typeSEXP); - rcpp_result_gen = - Rcpp::wrap(impl_client_buffer_from_double(client, data, dims, type)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_client_buffer_from_double(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_double(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); + Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); + Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_double(client, data, dims, type)); + return rcpp_result_gen; +END_RCPP } // impl_client_buffer_from_integer -Rcpp::XPtr impl_client_buffer_from_integer( - Rcpp::XPtr client, SEXP data, std::vector dims, - std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_integer(SEXP clientSEXP, - SEXP dataSEXP, - SEXP dimsSEXP, - SEXP typeSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - Rcpp::traits::input_parameter::type data(dataSEXP); - Rcpp::traits::input_parameter >::type dims(dimsSEXP); - Rcpp::traits::input_parameter::type type(typeSEXP); - rcpp_result_gen = - Rcpp::wrap(impl_client_buffer_from_integer(client, data, dims, type)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_client_buffer_from_integer(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_integer(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); + Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); + Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_integer(client, data, dims, type)); + return rcpp_result_gen; +END_RCPP } // impl_client_buffer_from_logical -Rcpp::XPtr impl_client_buffer_from_logical( - Rcpp::XPtr client, SEXP data, std::vector dims, - std::string type); -RcppExport SEXP _pjrt_impl_client_buffer_from_logical(SEXP clientSEXP, - SEXP dataSEXP, - SEXP dimsSEXP, - SEXP typeSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - Rcpp::traits::input_parameter::type data(dataSEXP); - Rcpp::traits::input_parameter >::type dims(dimsSEXP); - Rcpp::traits::input_parameter::type type(typeSEXP); - rcpp_result_gen = - Rcpp::wrap(impl_client_buffer_from_logical(client, data, dims, type)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_client_buffer_from_logical(Rcpp::XPtr client, SEXP data, std::vector dims, std::string type); +RcppExport SEXP _pjrt_impl_client_buffer_from_logical(SEXP clientSEXP, SEXP dataSEXP, SEXP dimsSEXP, SEXP typeSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + Rcpp::traits::input_parameter< SEXP >::type data(dataSEXP); + Rcpp::traits::input_parameter< std::vector >::type dims(dimsSEXP); + Rcpp::traits::input_parameter< std::string >::type type(typeSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_buffer_from_logical(client, data, dims, type)); + return rcpp_result_gen; +END_RCPP } // impl_client_buffer_to_host -SEXP impl_client_buffer_to_host(Rcpp::XPtr client, - Rcpp::XPtr buffer); -RcppExport SEXP _pjrt_impl_client_buffer_to_host(SEXP clientSEXP, - SEXP bufferSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - Rcpp::traits::input_parameter >::type buffer( - bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_buffer_to_host(client, buffer)); - return rcpp_result_gen; - END_RCPP +SEXP impl_client_buffer_to_host(Rcpp::XPtr client, Rcpp::XPtr buffer); +RcppExport SEXP _pjrt_impl_client_buffer_to_host(SEXP clientSEXP, SEXP bufferSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_buffer_to_host(client, buffer)); + return rcpp_result_gen; +END_RCPP } // impl_client_platform_name std::string impl_client_platform_name(Rcpp::XPtr client); RcppExport SEXP _pjrt_impl_client_platform_name(SEXP clientSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type client( - clientSEXP); - rcpp_result_gen = Rcpp::wrap(impl_client_platform_name(client)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type client(clientSEXP); + rcpp_result_gen = Rcpp::wrap(impl_client_platform_name(client)); + return rcpp_result_gen; +END_RCPP } // impl_loaded_executable_execute -Rcpp::XPtr impl_loaded_executable_execute( - Rcpp::XPtr executable, Rcpp::List input); -RcppExport SEXP _pjrt_impl_loaded_executable_execute(SEXP executableSEXP, - SEXP inputSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type - executable(executableSEXP); - Rcpp::traits::input_parameter::type input(inputSEXP); - rcpp_result_gen = - Rcpp::wrap(impl_loaded_executable_execute(executable, input)); - return rcpp_result_gen; - END_RCPP +Rcpp::XPtr impl_loaded_executable_execute(Rcpp::XPtr executable, Rcpp::List input); +RcppExport SEXP _pjrt_impl_loaded_executable_execute(SEXP executableSEXP, SEXP inputSEXP) { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type executable(executableSEXP); + Rcpp::traits::input_parameter< Rcpp::List >::type input(inputSEXP); + rcpp_result_gen = Rcpp::wrap(impl_loaded_executable_execute(executable, input)); + return rcpp_result_gen; +END_RCPP } // impl_buffer_element_type -Rcpp::XPtr impl_buffer_element_type( - Rcpp::XPtr buffer); +Rcpp::XPtr impl_buffer_element_type(Rcpp::XPtr buffer); RcppExport SEXP _pjrt_impl_buffer_element_type(SEXP bufferSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type buffer( - bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_buffer_element_type(buffer)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_buffer_element_type(buffer)); + return rcpp_result_gen; +END_RCPP } // impl_element_type_as_string -std::string impl_element_type_as_string( - Rcpp::XPtr element_type); +std::string impl_element_type_as_string(Rcpp::XPtr element_type); RcppExport SEXP _pjrt_impl_element_type_as_string(SEXP element_typeSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type - element_type(element_typeSEXP); - rcpp_result_gen = Rcpp::wrap(impl_element_type_as_string(element_type)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type element_type(element_typeSEXP); + rcpp_result_gen = Rcpp::wrap(impl_element_type_as_string(element_type)); + return rcpp_result_gen; +END_RCPP } // impl_buffer_dimensions -std::vector impl_buffer_dimensions( - Rcpp::XPtr buffer); +std::vector impl_buffer_dimensions(Rcpp::XPtr buffer); RcppExport SEXP _pjrt_impl_buffer_dimensions(SEXP bufferSEXP) { - BEGIN_RCPP - Rcpp::RObject rcpp_result_gen; - Rcpp::RNGScope rcpp_rngScope_gen; - Rcpp::traits::input_parameter >::type buffer( - bufferSEXP); - rcpp_result_gen = Rcpp::wrap(impl_buffer_dimensions(buffer)); - return rcpp_result_gen; - END_RCPP +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + Rcpp::traits::input_parameter< Rcpp::XPtr >::type buffer(bufferSEXP); + rcpp_result_gen = Rcpp::wrap(impl_buffer_dimensions(buffer)); + return rcpp_result_gen; +END_RCPP } static const R_CallMethodDef CallEntries[] = { - {"_pjrt_impl_plugin_load", (DL_FUNC)&_pjrt_impl_plugin_load, 1}, - {"_pjrt_impl_plugin_client_create", - (DL_FUNC)&_pjrt_impl_plugin_client_create, 1}, - {"_pjrt_impl_program_load", (DL_FUNC)&_pjrt_impl_program_load, 2}, - {"_pjrt_impl_program_repr", (DL_FUNC)&_pjrt_impl_program_repr, 2}, - {"_pjrt_impl_build_options_create", - (DL_FUNC)&_pjrt_impl_build_options_create, 3}, - {"_pjrt_impl_compile_options_create", - (DL_FUNC)&_pjrt_impl_compile_options_create, 1}, - {"_pjrt_impl_client_program_compile", - (DL_FUNC)&_pjrt_impl_client_program_compile, 3}, - {"_pjrt_impl_client_buffer_from_double", - (DL_FUNC)&_pjrt_impl_client_buffer_from_double, 4}, - {"_pjrt_impl_client_buffer_from_integer", - (DL_FUNC)&_pjrt_impl_client_buffer_from_integer, 4}, - {"_pjrt_impl_client_buffer_from_logical", - (DL_FUNC)&_pjrt_impl_client_buffer_from_logical, 4}, - {"_pjrt_impl_client_buffer_to_host", - (DL_FUNC)&_pjrt_impl_client_buffer_to_host, 2}, - {"_pjrt_impl_client_platform_name", - (DL_FUNC)&_pjrt_impl_client_platform_name, 1}, - {"_pjrt_impl_loaded_executable_execute", - (DL_FUNC)&_pjrt_impl_loaded_executable_execute, 2}, - {"_pjrt_impl_buffer_element_type", (DL_FUNC)&_pjrt_impl_buffer_element_type, - 1}, - {"_pjrt_impl_element_type_as_string", - (DL_FUNC)&_pjrt_impl_element_type_as_string, 1}, - {"_pjrt_impl_buffer_dimensions", (DL_FUNC)&_pjrt_impl_buffer_dimensions, 1}, - {NULL, NULL, 0}}; + {"_pjrt_impl_plugin_load", (DL_FUNC) &_pjrt_impl_plugin_load, 1}, + {"_pjrt_impl_plugin_client_create", (DL_FUNC) &_pjrt_impl_plugin_client_create, 1}, + {"_pjrt_impl_program_load", (DL_FUNC) &_pjrt_impl_program_load, 2}, + {"_pjrt_impl_program_repr", (DL_FUNC) &_pjrt_impl_program_repr, 2}, + {"_pjrt_impl_build_options_create", (DL_FUNC) &_pjrt_impl_build_options_create, 3}, + {"_pjrt_impl_compile_options_create", (DL_FUNC) &_pjrt_impl_compile_options_create, 1}, + {"_pjrt_impl_client_program_compile", (DL_FUNC) &_pjrt_impl_client_program_compile, 3}, + {"_pjrt_impl_client_buffer_from_double", (DL_FUNC) &_pjrt_impl_client_buffer_from_double, 4}, + {"_pjrt_impl_client_buffer_from_integer", (DL_FUNC) &_pjrt_impl_client_buffer_from_integer, 4}, + {"_pjrt_impl_client_buffer_from_logical", (DL_FUNC) &_pjrt_impl_client_buffer_from_logical, 4}, + {"_pjrt_impl_client_buffer_to_host", (DL_FUNC) &_pjrt_impl_client_buffer_to_host, 2}, + {"_pjrt_impl_client_platform_name", (DL_FUNC) &_pjrt_impl_client_platform_name, 1}, + {"_pjrt_impl_loaded_executable_execute", (DL_FUNC) &_pjrt_impl_loaded_executable_execute, 2}, + {"_pjrt_impl_buffer_element_type", (DL_FUNC) &_pjrt_impl_buffer_element_type, 1}, + {"_pjrt_impl_element_type_as_string", (DL_FUNC) &_pjrt_impl_element_type_as_string, 1}, + {"_pjrt_impl_buffer_dimensions", (DL_FUNC) &_pjrt_impl_buffer_dimensions, 1}, + {NULL, NULL, 0} +}; -RcppExport void R_init_pjrt(DllInfo* dll) { - R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); - R_useDynamicSymbols(dll, FALSE); +RcppExport void R_init_pjrt(DllInfo *dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); }