MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / BM_InitOp

Function BM_InitOp

tensorflow/c/eager/c_api_test.cc:40–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace {
39
40void BM_InitOp(int iters) {
41 tensorflow::testing::StopTiming();
42 TF_Status* status = TF_NewStatus();
43 TFE_ContextOptions* opts = TFE_NewContextOptions();
44 TFE_Context* ctx = TFE_NewContext(opts, status);
45 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
46 TFE_DeleteContextOptions(opts);
47
48 TFE_TensorHandle* m = TestMatrixTensorHandle();
49 tensorflow::testing::StartTiming();
50 for (int i = 0; i < iters; ++i) {
51 TFE_Op* matmul = MatMulOp(ctx, m, m);
52 TFE_DeleteOp(matmul);
53 }
54 tensorflow::testing::StopTiming();
55 TFE_DeleteTensorHandle(m);
56 TFE_DeleteContext(ctx);
57 CHECK_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status);
58 TF_DeleteStatus(status);
59}
60BENCHMARK(BM_InitOp);
61
62void BM_Execute(int iters, int async) {

Callers

nothing calls this directly

Calls 14

StopTimingFunction · 0.85
TF_NewStatusFunction · 0.85
TFE_NewContextOptionsFunction · 0.85
TFE_NewContextFunction · 0.85
TF_GetCodeFunction · 0.85
TF_MessageFunction · 0.85
TFE_DeleteContextOptionsFunction · 0.85
TestMatrixTensorHandleFunction · 0.85
StartTimingFunction · 0.85
TFE_DeleteOpFunction · 0.85
TFE_DeleteTensorHandleFunction · 0.85
TFE_DeleteContextFunction · 0.85

Tested by

no test coverage detected