Commit Graph

50 Commits

Author SHA1 Message Date
Zhoulong Jiang
c7f3d3f943 change void* -> char* for string attr 2020-12-03 11:01:57 +00:00
Zhoulong Jiang
21135f9a88 resolve conflicts 2020-11-26 09:06:31 +00:00
TensorFlower Gardener
aa22defe05 Merge pull request from Intel-tensorflow:stream_executor_C_API_extension
PiperOrigin-RevId: 344156372
Change-Id: I036a76c7ccf5f25e45767b3bf3270cbed9a56830
2020-11-24 17:04:44 -08:00
Zhoulong Jiang
7a334468d5 fix bool -> string in description 2020-11-20 14:23:23 +00:00
Zhoulong Jiang
a6e0bd59ad fix comments 2020-11-17 13:39:12 +00:00
Zhoulong Jiang
11adf204e8 Add stream executor c api extension 2020-11-11 08:51:08 +00:00
Zhoulong Jiang
227a11b0b0 fix comments 2020-11-04 21:15:57 +00:00
Zhoulong Jiang
80d52046c6 address comments 2020-11-04 21:09:27 +00:00
Zhoulong Jiang
ccd5bd81db address comment TF_MetaData->list_size + total_size 2020-11-02 15:05:25 +00:00
Zhoulong Jiang
520772f6fd [PluggableDevice] Kernel C API enhancement for retrieving attributes 2020-10-14 22:15:29 +00:00
TensorFlower Gardener
66603e9220 Merge pull request from dnguyen28061:forward_input_or_allocate_output
PiperOrigin-RevId: 327713174
Change-Id: I334d9a34790d839be1b9dd3bb422dcf0a780d1c4
2020-08-20 16:08:31 -07:00
Daniel Nguyen
19251497c8 merge with master 2020-08-19 21:46:04 +00:00
Daniel Nguyen
aa88605eae clean up only 2020-08-13 15:22:00 +00:00
TensorFlower Gardener
efa82dd9a7 Merge pull request from dnguyen28061:allocate_temp
PiperOrigin-RevId: 326305159
Change-Id: Ic95dcb86e7bc58ced1666c7adcbddb9cc99dd2f4
2020-08-12 14:08:54 -07:00
Daniel Nguyen
a7e4df9246 switched from unsigned char to TF_Bool. Added input checking for TF_AllocatorAttributes 2020-08-11 23:11:36 +00:00
Daniel Nguyen
0a79e71110 finished implementation and passes tests 2020-08-10 16:53:45 +00:00
Daniel Nguyen
1182974cc1 clean up 2020-08-05 23:26:25 +00:00
Daniel Nguyen
b6960d8bd1 Revert "switched from allocator attributes struct to opaque pointer"
This reverts commit 54b76dc588.
2020-08-05 19:13:52 +00:00
Daniel Nguyen
54b76dc588 switched from allocator attributes struct to opaque pointer 2020-08-04 22:24:28 +00:00
Daniel Nguyen
eed154ca65 changed TF_AllocatorAttributes usage to pass by pointer 2020-08-03 23:42:27 +00:00
Daniel Nguyen
c5ef52c5f0 added draft of function 2020-07-31 23:43:44 +00:00
Daniel Nguyen
f08f904415 merge with master 2020-07-30 23:21:42 +00:00
TensorFlower Gardener
f999bb1785 Merge pull request from dnguyen28061:TF_GetName
PiperOrigin-RevId: 324061940
Change-Id: I9519ccad6fd4958e16e3d8abbf2b011f89d574a1
2020-07-30 13:05:48 -07:00
Daniel Nguyen
aa3291d440 clean up 2020-07-24 20:56:17 +00:00
Daniel Nguyen
1007559c22 added allocator attributes to allocate_temp 2020-07-24 15:50:08 +00:00
Daniel Nguyen
c3704aaacb made comments for string view and get_name more clear 2020-07-23 18:07:44 +00:00
Daniel Nguyen
503defb219 moved typedef to c_api.h 2020-07-22 17:53:56 +00:00
Daniel Nguyen
540e9cf481 moved TF_StringView to c_api.h and manually declared TF_StringView members in GetName 2020-07-22 00:31:58 +00:00
Daniel Nguyen
7a113f40d9 Merge branch 'master' of https://github.com/tensorflow/tensorflow into TF_GetName 2020-07-21 19:59:12 +00:00
Daniel Nguyen
2623d9a809 added TF_GetName and tests for the funciton 2020-07-21 19:54:07 +00:00
TensorFlower Gardener
926d2f2484 Merge pull request from dnguyen28061:kernel_extension
PiperOrigin-RevId: 320706473
Change-Id: I3179e5feda8ced41be594366c138a6803780eaa1
2020-07-10 17:37:12 -07:00
Daniel Nguyen
f863e79fa8 added priority function 2020-07-08 19:57:33 +00:00
Daniel Nguyen
1a5a6c3f81 fixed indentation errors 2020-07-01 00:00:05 +00:00
Daniel Nguyen
b2c450ae75 completed priority 2020-06-26 22:32:02 +00:00
Daniel Nguyen
7fd7e0a377 added comments to allocate_temp 2020-06-26 22:00:05 +00:00
Daniel Nguyen
f040810ceb added allocated_temp function and tests 2020-06-26 20:12:39 +00:00
Daniel Nguyen
477470d094 finished test file 2020-06-24 18:35:02 +00:00
James Ring
9cd757ab16 Fix TF_AllocateOutput to actually call TF_SetOutput.
Before this change, TF_AllocateOutput would simply allocate a tensor but not
place that tensor in the specified output position. This change necessitates
the addition of a TF_Status* output parameter.

PiperOrigin-RevId: 269403835
2019-09-16 14:57:14 -07:00
Anna R
f958b16857 Add TF_AllocateOutput function to C API. This function can be used to allocate
output tensor using OpKernelContext allocator.

As a part of this change, I also moved allocate_tensor and deallocate_tensor to tensorflow namespace and added corresponding declarations to tf_tensor_internal.h. This is so that TF_AllocateOutput in kernels.cc can call access these allocate/deallocate functions.

PiperOrigin-RevId: 260973924
2019-07-31 12:30:22 -07:00
Anna R
b834fc2f3e Add AddTypeConstraint and RequireHostMemory to Kernel builder in C API. Also,
add a way to get int32 attribute.

PiperOrigin-RevId: 256201508
2019-07-02 14:01:16 -07:00
James Ring
652d3e7bc6 Split tf_tensor_internal into its own header
This is one of a series of changes that allows users of TF_Tensor and
other C types to avoid depending on everything in TensorFlow.

PiperOrigin-RevId: 253337240
2019-06-14 19:25:41 -07:00
James Ring
ae8eddd16f Fix generation of bad GetAttr calls
OpKernelContext does not have GetAttr(). Previously, the
DEFINE_TF_GETATTR_ macro would define a function called
TF_OpKernelContext_GetWhateverAttr, but its implementation was
erroneously casting to OpKernelConstruction. This was never going to
work.

PiperOrigin-RevId: 232901435
2019-02-07 10:40:27 -08:00
James Ring
dfce752a5a Add some helper functions to C API.
This change adds:
  * TF_OpKernel{Context,Construction}_Failure - used by C kernels to
    report failures in their compute or construction functions

  * TF_OpKernel{Context,Construction_GetAttrType - used by C kernels to
    read TF_DataType attributes from their compute or construction
    context. A macro is used for the implementation, as there will be a
    handful of these methods in subsequent CLs and their implementation is
    boilerplate.

PiperOrigin-RevId: 229311735
2019-01-14 21:51:11 -08:00
James Ring
1095ed8fe6 Add TF_StepId and TF_ExpectedOutputDataType
PiperOrigin-RevId: 228748943
2019-01-10 12:16:58 -08:00
James Ring
de84436a99 Fix problems in env.h and kernels.h when included from a C translation unit
PiperOrigin-RevId: 225930499
2018-12-17 19:46:52 -08:00
James Ring
264e6520c5 Add TF_SetOutput
PiperOrigin-RevId: 224148089
2018-12-05 07:10:51 -08:00
James Ring
a984ed13a0 Add TF_GetInput
PiperOrigin-RevId: 224026687
2018-12-04 12:36:38 -08:00
James Ring
5e48100140 add TF_NumInputs and TF_NumOutputs
PiperOrigin-RevId: 224003843
2018-12-04 10:46:33 -08:00
Benjamin Kramer
dfd22d1cea Remove unnecessary 'typedef' keywords.
These generate a compiler warning:
tensorflow/c/kernels.h:38:1: warning: typedef requires a name [-Wmissing-declarations]

Also change the dependency from :c_api_internal to :c_api, only the latter exports c_api.h

PiperOrigin-RevId: 221498747
2018-11-14 13:31:15 -08:00
A. Unique TensorFlower
37b4d2ef3f Introduce C kernel registration API.
PiperOrigin-RevId: 221385497
2018-11-13 21:19:30 -08:00