Fixed C++ example's syntax error
This commit is contained in:
parent
e578e596dc
commit
6b129d43cf
1 changed files with 3 additions and 3 deletions
|
|
@ -88,7 +88,7 @@ void kompute(const std::string& shader) {
|
|||
->eval(); // Evaluates only last recorded operation
|
||||
|
||||
// 5. Sync results from the GPU asynchronously
|
||||
sq = mgr.sequence()
|
||||
auto sq = mgr.sequence();
|
||||
sq->evalAsync<kp::OpTensorSyncLocal>(params);
|
||||
|
||||
// ... Do other work asynchronously whilst GPU finishes
|
||||
|
|
@ -96,9 +96,9 @@ void kompute(const std::string& shader) {
|
|||
sq->evalAwait();
|
||||
|
||||
// Prints the first output which is: { 4, 8, 12 }
|
||||
for (const float& elem : tensorOutA->data()) std::cout << elem << " ";
|
||||
for (const float& elem : tensorOutA->vector()) std::cout << elem << " ";
|
||||
// Prints the second output which is: { 10, 10, 10 }
|
||||
for (const float& elem : tensorOutB->data()) std::cout << elem << " ";
|
||||
for (const float& elem : tensorOutB->vector()) std::cout << elem << " ";
|
||||
|
||||
} // Manages / releases all CPU and GPU memory resources
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue