-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ryan Nett <[email protected]>
- Loading branch information
Showing
6 changed files
with
626 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFDefaultLogSink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
|
||
|
||
// This is the default log sink. This log sink is used if there are no other | ||
// log sinks registered. To disable the default log sink, set the | ||
// "no_default_logger" Bazel config setting to true or define a | ||
// NO_DEFAULT_LOGGER preprocessor symbol. This log sink will always log to | ||
// stderr. | ||
@Namespace("tensorflow") @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class TFDefaultLogSink extends TFLogSink { | ||
static { Loader.load(); } | ||
/** Default native constructor. */ | ||
public TFDefaultLogSink() { super((Pointer)null); allocate(); } | ||
/** Native array allocator. Access with {@link Pointer#position(long)}. */ | ||
public TFDefaultLogSink(long size) { super((Pointer)null); allocateArray(size); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public TFDefaultLogSink(Pointer p) { super(p); } | ||
private native void allocate(); | ||
private native void allocateArray(long size); | ||
@Override public TFDefaultLogSink position(long position) { | ||
return (TFDefaultLogSink)super.position(position); | ||
} | ||
@Override public TFDefaultLogSink getPointer(long i) { | ||
return new TFDefaultLogSink(this).position(position + i); | ||
} | ||
|
||
public native void Send(@Const @ByRef TFLogEntry entry); | ||
} |
43 changes: 43 additions & 0 deletions
43
...rflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFLogEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
// namespace internal | ||
|
||
// LogSink support adapted from //base/logging.h | ||
// | ||
// `LogSink` is an interface which can be extended to intercept and process | ||
// all log messages. LogSink implementations must be thread-safe. A single | ||
// instance will be called from whichever thread is performing a logging | ||
// operation. | ||
@Namespace("tensorflow") @NoOffset @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class TFLogEntry extends Pointer { | ||
static { Loader.load(); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public TFLogEntry(Pointer p) { super(p); } | ||
|
||
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, message); } | ||
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer message); | ||
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, message); } | ||
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String message); | ||
|
||
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line, | ||
@StdString @Cast({"char*", "std::string&&"}) BytePointer message) { super((Pointer)null); allocate(severity, fname, line, message); } | ||
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) BytePointer fname, int line, | ||
@StdString @Cast({"char*", "std::string&&"}) BytePointer message); | ||
public TFLogEntry(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line, | ||
@StdString @Cast({"char*", "std::string&&"}) String message) { super((Pointer)null); allocate(severity, fname, line, message); } | ||
private native void allocate(int severity, @StdString @Cast({"char*", "std::string&&"}) String fname, int line, | ||
@StdString @Cast({"char*", "std::string&&"}) String message); | ||
|
||
public native @Cast("absl::LogSeverity") int log_severity(); | ||
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer FName(); | ||
public native int Line(); | ||
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer ToString(); | ||
public native @StdString @Cast({"char*", "std::string&&"}) BytePointer text_message(); | ||
} |
38 changes: 38 additions & 0 deletions
38
...orflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/internal/c_api/TFLogSink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Targeted by JavaCPP version 1.5.4: DO NOT EDIT THIS FILE | ||
|
||
package org.tensorflow.internal.c_api; | ||
|
||
import java.nio.*; | ||
import org.bytedeco.javacpp.*; | ||
import org.bytedeco.javacpp.annotation.*; | ||
|
||
import static org.tensorflow.internal.c_api.global.tensorflow.*; | ||
|
||
|
||
@Namespace("tensorflow") @Properties(inherit = org.tensorflow.internal.c_api.presets.tensorflow.class) | ||
public class TFLogSink extends Pointer { | ||
static { Loader.load(); } | ||
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ | ||
public TFLogSink(Pointer p) { super(p); } | ||
|
||
|
||
// `Send` is called synchronously during the log statement. The logging | ||
// module guarantees not to call `Send` concurrently on the same log sink. | ||
// Implementations should be careful not to call`LOG` or `CHECK` or take | ||
// any locks that might be held by the `LOG` caller, to avoid deadlock. | ||
// | ||
// `e` is guaranteed to remain valid until the subsequent call to | ||
// `WaitTillSent` completes, so implementations may store a pointer to or | ||
// copy of `e` (e.g. in a thread local variable) for use in `WaitTillSent`. | ||
public native void Send(@Const @ByRef TFLogEntry entry); | ||
|
||
// `WaitTillSent` blocks the calling thread (the thread that generated a log | ||
// message) until the sink has finished processing the log message. | ||
// `WaitTillSent` is called once per log message, following the call to | ||
// `Send`. This may be useful when log messages are buffered or processed | ||
// asynchronously by an expensive log sink. | ||
// The default implementation returns immediately. Like `Send`, | ||
// implementations should be careful not to call `LOG` or `CHECK or take any | ||
// locks that might be held by the `LOG` caller, to avoid deadlock. | ||
public native void WaitTillSent(); | ||
} |
Oops, something went wrong.