This commit is contained in:
Alejandro Saucedo 2021-02-08 19:43:50 +00:00
parent f62e353f4a
commit aa75fdae47
6 changed files with 39 additions and 34 deletions

View file

@ -1,7 +1,7 @@
#pragma once
#include <unordered_map>
#include <set>
#include <unordered_map>
#include "kompute/Core.hpp"
@ -125,9 +125,8 @@ class Manager
{
SPDLOG_DEBUG("Kompute Manager evalOp Default triggered");
this->mCurrentSequenceIndex++;
this->evalOp<T>(tensors,
KP_DEFAULT_SESSION,
std::forward<TArgs>(params)...);
this->evalOp<T>(
tensors, KP_DEFAULT_SESSION, std::forward<TArgs>(params)...);
}
/**
@ -177,9 +176,8 @@ class Manager
{
SPDLOG_DEBUG("Kompute Manager evalOpAsyncDefault triggered");
this->mCurrentSequenceIndex++;
this->evalOpAsync<T>(tensors,
KP_DEFAULT_SESSION,
std::forward<TArgs>(params)...);
this->evalOpAsync<T>(
tensors, KP_DEFAULT_SESSION, std::forward<TArgs>(params)...);
}
/**
@ -220,8 +218,7 @@ class Manager
void evalOpAwaitDefault(uint64_t waitFor = UINT64_MAX)
{
SPDLOG_DEBUG("Kompute Manager evalOpAwaitDefault triggered");
this->evalOpAwait(KP_DEFAULT_SESSION,
waitFor);
this->evalOpAwait(KP_DEFAULT_SESSION, waitFor);
}
/**
@ -254,7 +251,10 @@ class Manager
}
/**
* Function that simplifies the common workflow of tensor initialisation. It will take the constructor parameters for a Tensor and will will us it to create a new Tensor. The tensor memory will then be managed and owned by the manager.
* Function that simplifies the common workflow of tensor initialisation. It
* will take the constructor parameters for a Tensor and will will us it to
* create a new Tensor. The tensor memory will then be managed and owned by
* the manager.
*
* @param data The data to initialize the tensor with
* @param tensorType The type of tensor to initialize
@ -274,7 +274,8 @@ class Manager
tensor->mapDataIntoHostMemory();
}
std::set<std::shared_ptr<Tensor>>::iterator it = this->mManagedTensors.find(tensor);
std::set<std::shared_ptr<Tensor>>::iterator it =
this->mManagedTensors.find(tensor);
if (it == this->mManagedTensors.end()) {
this->mManagedTensors.insert(tensor);
}