Skip to content

Commit

Permalink
Adding requested changes
Browse files Browse the repository at this point in the history
- RELEASING.md now has info about the new tensorflow-sys-runtime crate.
- Additional info in the tensorflow-sys-runtime README.md showing how to use it.
- Adding the version to tensorflow-sys-runtime in the main Cargo.toml
- Removing runtime linking bindgen calls from tensorflow-sys/generate_bindgen_rs.sh
  • Loading branch information
brianjjones committed Oct 28, 2022
1 parent 7613d97 commit cf5ab4f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -24,7 +24,7 @@ libc = "0.2.132"
num-complex = { version = "0.4.2", default-features = false }
tensorflow-internal-macros = { version = "=0.0.3", path = "tensorflow-internal-macros" }
tensorflow-sys = { version = "0.22.1", path = "tensorflow-sys", optional = true }
tensorflow-sys-runtime = { path = "tensorflow-sys-runtime", optional = true }
tensorflow-sys-runtime = { version = "0.1.0", path = "tensorflow-sys-runtime", optional = true }
byteorder = "1.4.3"
crc = "3.0.0"
half = "2.1.0"
Expand Down
6 changes: 6 additions & 0 deletions RELEASING.md
Expand Up @@ -25,6 +25,11 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
1. Bump the version in `tensorflow-sys/Cargo.toml`
1. Bump the version in `tensorflow-sys/README.md`
1. Bump the version for `tensorflow-sys` in the root `Cargo.toml`
1. Bump version number of `tensorflow-sys-runtime` if necessary
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-sys-runtime` and see if there were any changes. If not, skip.
1. Bump the version in `tensorflow-sys-runtime/Cargo.toml`
1. Bump the version in `tensorflow-sys-runtime/README.md`
1. Bump the version for `tensorflow-sys-runtime` in the root `Cargo.toml`
1. Bump version number of `tensorflow-internal-macros` if necessary
1. Run `git log v${PREVIOUS_VERSION?}..HEAD tensorflow-internal-macros` and see if there were any changes. If not, skip.
1. Bump the version in `tensorflow-internal-macros/Cargo.toml`
Expand All @@ -36,6 +41,7 @@ Note that any crate not mentioned here (e.g. tensorflow-proto-codegen, tensorflo
1. Run `./run-valgrind`
1. Commit and push the changes. (Push before publishing to ensure that the changes being published are up to date.)
1. If the version of tensorflow-sys was bumped, run `cargo publish` for tensorflow-sys. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
1. If the version of tensorflow-sys-runtime was bumped, run `cargo publish` for tensorflow-sys-runtime. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
1. If the version of tensorflow-internal-macros was bumped, run `cargo publish` for tensorflow-internal-macros. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
1. Run `cargo publish`. (Publish before tagging in case there are problems publishing and we need to add commits to fix them.)
1. Add a `v${VERSION?}` tag and push it
Expand Down
6 changes: 6 additions & 0 deletions tensorflow-sys-runtime/README.md
Expand Up @@ -6,6 +6,12 @@ before any other calls so that the linking is completed before use.

## NOTE
This crate is meant to be used by [Rust language bindings for Tensorflow][crates-tf]. It is not meant to be used on it's own.
To use it you will need to disable the default features so you don't also include the tensorflow-sys crate.

```
[dependencies]
tensorflow = { version = "0.19.1", default-features = false, features = ["tensorflow_runtime_linking"]}
```

## Requirements

Expand Down
13 changes: 0 additions & 13 deletions tensorflow-sys/generate_bindgen_rs.sh
Expand Up @@ -18,16 +18,3 @@ bindgen_options_eager="--allowlist-function TFE_.+ --allowlist-type TFE_.+ --all
cmd="bindgen ${bindgen_options_eager} ${include_dir}/tensorflow/c/eager/c_api.h --output src/eager/c_api.rs -- -I ${include_dir}"
echo ${cmd}
${cmd}

bindgen_options_runtime_functions="--allowlist-function TF_.+ --blocklist-type .+ --size_t-is-usize --default-enum-style=rust --generate-inline-functions"
cmd="bindgen ${bindgen_options_runtime_functions} ${include_dir}/tensorflow/c/c_api.h --output src/runtime_linking/c_api.rs -- -I ${include_dir}"
echo ${cmd}
${cmd}

bindgen_options_runtime_types="--allowlist-type TF_.+ --blocklist-function .+ --size_t-is-usize --default-enum-style=rust --generate-inline-functions"
cmd="bindgen ${bindgen_options_runtime_types} ${include_dir}/tensorflow/c/c_api.h --output src/runtime_linking/types.rs -- -I ${include_dir}"
echo ${cmd}
${cmd}

echo "link! {\n$(cat src/runtime_linking/c_api.rs)" > src/runtime_linking/c_api.rs
echo } >> src/runtime_linking/c_api.rs

0 comments on commit cf5ab4f

Please sign in to comment.