Skip to content

Commit 17c30f9

Browse files
CaptainDukeyongtang
authored andcommitted
Update with compiling optimization and DT_UINT32 support for HDF5 (#379)
* Update README.md * Update with compiling optimization For compilation optimization flags, the default (-march=native) optimizes the generated code for your machine's CPU type. [see here](https://www.tensorflow.org/install/source#configuration_options) * add DT_UINT32 support
1 parent 38a1394 commit 17c30f9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ $ docker build -f dev/Dockerfile -t tfio-dev .
134134
$ docker run -it --rm --net=host -v ${PWD}:/v -w /v tfio-dev
135135
$ # In Docker, configure will install TensorFlow or use existing install
136136
$ ./configure.sh
137-
$ # Build TensorFlow I/O C++
138-
$ bazel build -s --verbose_failures //tensorflow_io/...
137+
$ # Build TensorFlow I/O C++. For compilation optimization flags, the default (-march=native) optimizes the generated code for your machine's CPU type. [see here](https://www.tensorflow.org/install/source#configuration_options)
138+
$ bazel build -c opt --copt=-match=native -s --verbose_failures //tensorflow_io/...
139139
$ # Run tests with PyTest, note: some tests require launching additional containers to run (see below)
140140
$ pytest tests/
141141
$ # Build the TensorFlow I/O package

tensorflow_io/hdf5/kernels/hdf5_input.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ class HDF5InputStream{
105105
Tensor tensor(ctx->allocator({}), DT_INT32, shape);
106106
dataset_[i].read(tensor.flat<int32>().data(), H5::PredType::NATIVE_INT, memoryspace, dataspace_[i]);
107107
out_tensors->emplace_back(std::move(tensor));
108-
} else if (H5Tequal(native_type, H5T_NATIVE_LONG)) {
108+
} else if (H5Tequal(native_type, H5T_NATIVE_UINT32)) {
109+
Tensor tensor(ctx->allocator({}), DT_UINT32, shape);
110+
dataset_[i].read(tensor.flat<uint32>().data(), H5::PredType::NATIVE_UINT32, memoryspace, dataspace_[i]);
111+
out_tensors->emplace_back(std::move(tensor));
112+
}else if (H5Tequal(native_type, H5T_NATIVE_LONG)) {
109113
Tensor tensor(ctx->allocator({}), DT_INT64, shape);
110114
dataset_[i].read(tensor.flat<int64>().data(), H5::PredType::NATIVE_LONG, memoryspace, dataspace_[i]);
111115
out_tensors->emplace_back(std::move(tensor));

0 commit comments

Comments
 (0)