Separate TF_FileStatistics into own file.

Also do some required cleanup and removal of duplicates as a drive by fix.

PiperOrigin-RevId: 272512533
This commit is contained in:
Mihai Maruseac 2019-10-02 13:56:01 -07:00 committed by TensorFlower Gardener
parent 71242dbfb6
commit 2944db012c
3 changed files with 54 additions and 19 deletions

View File

@ -25,6 +25,7 @@ filegroup(
"c_api_experimental.h",
"tf_attrtype.h",
"tf_datatype.h",
"tf_file_statistics.h",
"tf_status.h",
"tf_tensor.h",
],
@ -95,6 +96,7 @@ tf_cuda_library(
"c_api.h",
"tf_attrtype.h",
"tf_datatype.h",
"tf_file_statistics.h",
"tf_status.h",
"tf_tensor.h",
],
@ -105,6 +107,7 @@ tf_cuda_library(
":c_api_internal",
":tf_attrtype",
":tf_status_internal",
":tf_file_statistics",
] + select({
"//tensorflow:with_xla_support": [
"//tensorflow/compiler/tf2xla:xla_compiler",
@ -189,6 +192,12 @@ cc_library(
}),
)
cc_library(
name = "tf_file_statistics",
hdrs = ["tf_file_statistics.h"],
visibility = ["//visibility:public"],
)
cc_library(
name = "tf_datatype",
srcs = ["tf_datatype.cc"],
@ -329,18 +338,18 @@ tf_cuda_library(
visibility = ["//visibility:public"],
deps = select({
"//tensorflow:android": [
":c_api",
":tf_status_helper",
"//tensorflow/core:android_tensorflow_lib_lite",
"//tensorflow/core:lib",
],
"//conditions:default": [
"//tensorflow/core:framework",
],
}) + [
":c_api",
":tf_status_helper",
"//tensorflow/core:framework",
":c_api_internal",
":tf_file_statistics",
"//tensorflow/core:lib",
],
}) + [":c_api_internal"],
)
tf_cuda_library(

View File

@ -13,14 +13,15 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_C_ENV_H_
#define TENSORFLOW_C_ENV_H_
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#ifndef TENSORFLOW_C_ENV_H_
#define TENSORFLOW_C_ENV_H_
#include "tensorflow/c/c_api.h"
#include "tensorflow/c/tf_file_statistics.h"
// --------------------------------------------------------------------------
// C API for tensorflow::Env.
@ -33,15 +34,6 @@ typedef struct TF_WritableFileHandle TF_WritableFileHandle;
typedef struct TF_StringStream TF_StringStream;
typedef struct TF_Thread TF_Thread;
typedef struct TF_FileStatistics {
// The length of the file in bytes.
int64_t length;
// The last modified time in nanoseconds.
int64_t mtime_nsec;
// Whether the name refers to a directory.
bool is_directory;
} TF_FileStatistics;
typedef struct TF_ThreadOptions {
// Thread stack size to use (in bytes), zero implies that the system default
// will be used.

View File

@ -0,0 +1,34 @@
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed 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.
==============================================================================*/
#ifndef TENSORFLOW_C_TF_FILE_STATISTICS_H_
#define TENSORFLOW_C_TF_FILE_STATISTICS_H_
#include <stdint.h>
typedef struct TF_FileStatistics {
// The length of the file in bytes.
int64_t length;
// The last modified time in nanoseconds.
int64_t mtime_nsec;
// Whether the name refers to a directory.
bool is_directory;
} TF_FileStatistics;
// TODO(mihaimaruseac): `tensorflow::FileStatistics` from
// `core/platform/file_statistics.h` is a duplicate of this so maybe try to
// remove duplication later?
#endif // TENSORFLOW_C_TF_FILE_STATISTICS_H_