This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27f8241
commit 2ca56c9
Showing
6 changed files
with
87 additions
and
31 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
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
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
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,62 @@ | ||
// Copyright by Contributors | ||
#include <mxnet/dag_engine.h> | ||
|
||
namespace mxnet { | ||
namespace engine { | ||
|
||
// The Naive engine interface | ||
class NaiveEngine : public DAGEngine { | ||
public: | ||
Variable NewVar() override { | ||
return nullptr; | ||
} | ||
|
||
OprHandle NewOperator(AsyncFn fn, | ||
std::vector<Variable> const& use_vars, | ||
std::vector<Variable> const& mutate_vars) override { | ||
LOG(FATAL) << "Not implemented"; | ||
return nullptr; | ||
} | ||
|
||
void DeleteOperator(OprHandle op) override { | ||
LOG(FATAL) << "Not implemented"; | ||
} | ||
|
||
void Push(OprHandle op, Context exec_ctx) override { | ||
LOG(FATAL) << "Not implemented"; | ||
} | ||
|
||
void Push(Fn exec_fun, Context exec_ctx, | ||
std::vector<Variable> const& use_vars, | ||
std::vector<Variable> const& mutate_vars) override { | ||
RunContext ctx; | ||
ctx.stream = nullptr; | ||
exec_fun(ctx); | ||
} | ||
|
||
void PushAsync(AsyncFn exec_fun, Context exec_ctx, | ||
std::vector<Variable> const& use_vars, | ||
std::vector<Variable> const& mutate_vars) override { | ||
LOG(FATAL) << "Not implemented"; | ||
} | ||
|
||
void PushDelete(Fn delete_fun, Context exec_ctx, Variable var) override { | ||
RunContext ctx; | ||
ctx.stream = nullptr; | ||
delete_fun(ctx); | ||
} | ||
|
||
void WaitForVar(Variable var) override { | ||
} | ||
|
||
void WaitForAll() override { | ||
} | ||
}; | ||
|
||
} // namespace engine | ||
|
||
DAGEngine* DAGEngine::Get() { | ||
static mxnet::engine::NaiveEngine engine; | ||
return &engine; | ||
} | ||
} // namespace mxnet |
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
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