Commit Graph

15 Commits

Author SHA1 Message Date
Derek Murray
06e20a2fe2 Remove unused tensor-reference-recording feature from the executor.
This change also removes the `Device::RequiresRecordingAccessedTensors()` and `Device::ConsumeListOfAccessedTensors()` methods.

Some device objects (historically, GPUs with experimental multi-stream support) required the ability to record which tensors were used during kernel execution. This support has bit-rotted since it was introduced, and causes runtime overhead for most devices that do not use the feature.

PiperOrigin-RevId: 300443774
Change-Id: Ia44ff65dee57f4d9f971f0079f79edd2fde2a1dc
2020-03-11 17:40:42 -07:00
Brian Atkinson
432ef2bee2 Another IWYU run over //tensorflow/c:kernels_test_gpu with cuda enabled.
#ifdef's were hiding code, and that hid the need for includes.

PiperOrigin-RevId: 294335591
Change-Id: I90ecadea8307ea1ed8934382cb70c120da20034e
2020-02-10 16:54:03 -08:00
Brian Atkinson
18295c5ad7 Make //tensorflow/c:kernels_test IWYU clean.
PiperOrigin-RevId: 292046262
Change-Id: I84717d56226875628c2e8172455cb9492117973e
2020-01-28 17:23:12 -08: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
Brian Zhao
f92a0e6a9b Removing use of DebugString free functions, as MessageLite now implements these methods: 6b3024f693/src/google/protobuf/message_lite.h (L239-L252).
PiperOrigin-RevId: 264735568
2019-08-21 18:59:13 -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
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
708090d489 Make TF_DeleteKernelBuilder not crash on nullptr.
After this change, TF_DeleteKernelBuilder will comply with the
conventions established in c_api.h, namely that *Delete* functions are
safe with nullptr parameters.

PiperOrigin-RevId: 230009727
2019-01-18 16:04:06 -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
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
A. Unique TensorFlower
37b4d2ef3f Introduce C kernel registration API.
PiperOrigin-RevId: 221385497
2018-11-13 21:19:30 -08:00