Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Typedef cleanup in C API #15899

Merged
merged 5 commits into from
Sep 3, 2019
Merged

Conversation

access2rohit
Copy link
Contributor

Description

changes

  • mx_uint -> uint32_t
  • mx_float -> float

removes

  • mx_int64 (Since introduced only by large tensor support so not present in other language bindings)

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@access2rohit
Copy link
Contributor Author

@mxnet-label-bot add [pr-work-in-progress]

@marcoabreu marcoabreu added the pr-work-in-progress PR is still work in progress label Aug 15, 2019
@access2rohit access2rohit force-pushed the typedef_cleanup branch 2 times, most recently from 99cb9d8 to 957cda4 Compare August 19, 2019 07:42
@access2rohit access2rohit changed the title [WIP]Typedef cleanup Typedef cleanup Aug 19, 2019
@access2rohit
Copy link
Contributor Author

@mxnet-label-bot add [pr-awaiting-review]

@marcoabreu marcoabreu added the pr-awaiting-review PR is waiting for code review label Aug 19, 2019
@access2rohit
Copy link
Contributor Author

@apeforest @ChaiBapchya pr is ready to review

Copy link
Contributor

@ChaiBapchya ChaiBapchya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -43,8 +43,6 @@ extern "C" {

/*! \brief manually define unsigned int */
typedef uint32_t mx_uint;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we still need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we do other language bindings use this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which language bindings use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java, C++, R, Scala

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you point me to the line in this bindings? It looks weird if this typedef is not used in this file while still keeping it.

Copy link
Contributor Author

@access2rohit access2rohit Aug 31, 2019

@@ -43,8 +43,6 @@ extern "C" {

/*! \brief manually define unsigned int */
typedef uint32_t mx_uint;
/*! \brief manually define 64-bit int */
typedef int64_t mx_int64;
/*! \brief manually define float */
typedef float mx_float;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we still need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes we do other language bindings use this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which language bindings use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

java, C++, R, Scala

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a search in MXNet codebase and could not find any. Could you point me to the line?

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactoring. This will increase readability and make C API users less dependency as well. I guess you also need to update the python interface that invokes the C API?

@access2rohit
Copy link
Contributor Author

Thanks for the refactoring. This will increase readability and make C API users less dependency as well. I guess you also need to update the python interface that invokes the C API?

@apeforest This PR only contains code cleanup from C API end. Python cleanup needs to be done in a separate PR. typedefs should remain as is because other language bindings use them.

@apeforest
Copy link
Contributor

Thanks for the refactoring. This will increase readability and make C API users less dependency as well. I guess you also need to update the python interface that invokes the C API?

@apeforest This PR only contains code cleanup from C API end. Python cleanup needs to be done in a separate PR. typedefs should remain as is because other language bindings use them.

Why can't it be done in one PR? Isn't that what the purpose of this PR is?

@access2rohit
Copy link
Contributor Author

Thanks for the refactoring. This will increase readability and make C API users less dependency as well. I guess you also need to update the python interface that invokes the C API?

@apeforest This PR only contains code cleanup from C API end. Python cleanup needs to be done in a separate PR. typedefs should remain as is because other language bindings use them.

Why can't it be done in one PR? Isn't that what the purpose of this PR is?

These are independent changes. I think these can be done in separate PRs. This is also keep C changes and individual language binding related changes separate, keeping each PR small

@apeforest apeforest merged commit 5b301c6 into apache:master Sep 3, 2019
@access2rohit access2rohit changed the title Typedef cleanup Typedef cleanup in C API Sep 3, 2019
gyshi pushed a commit to gyshi/incubator-mxnet that referenced this pull request Sep 7, 2019
* change mx_uint->int32_t

* changing mx_int64 -> int64_t

* change mx_float -> float

* maintining typedefs for other language bindings

* Re-Trigger build
gyshi pushed a commit to gyshi/incubator-mxnet that referenced this pull request Sep 7, 2019
* change mx_uint->int32_t

* changing mx_int64 -> int64_t

* change mx_float -> float

* maintining typedefs for other language bindings

* Re-Trigger build
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr-awaiting-review PR is waiting for code review pr-work-in-progress PR is still work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants