Updated examples

This commit is contained in:
Alejandro Saucedo 2021-02-28 17:07:17 +00:00
parent 63e220a8a4
commit 4fddf74ca7
11 changed files with 408 additions and 405 deletions

View file

@ -37,11 +37,14 @@ int main()
}
)");
mgr.evalOpDefault<kp::OpAlgoCreate>(
{ tensorInA, tensorInB, tensorOut },
kp::Shader::compile_source(shader));
std::vector<std::shared_ptr<kp::Tensor>> params = { tensorInA, tensorInB, tensorOut };
mgr.evalOpDefault<kp::OpTensorSyncLocal>({tensorOut});
std::shared_ptr<kp::Algorithm> algo = mgr.algorithm(params, kp::Shader::compile_source(shader));
mgr.sequence()
->record<kp::OpTensorSyncDevice>(params)
->record<kp::OpAlgoDispatch>(algo)
->record<kp::OpTensorSyncLocal>(params);
// prints "Output { 0 4 12 }"
std::cout<< "Output: { ";