Updated tests and rebased

This commit is contained in:
Alejandro Saucedo 2021-03-07 10:39:30 +00:00
parent bb64b2b37c
commit a2ee928f4c
9 changed files with 151 additions and 100 deletions

View file

@ -98,6 +98,23 @@ class Manager
return this->tensorT<float>(data, tensorType);
}
std::shared_ptr<Tensor> tensor(
void* data,
uint32_t elementTotalCount,
uint32_t elementMemorySize,
const Tensor::TensorDataTypes& dataType,
Tensor::TensorTypes tensorType = Tensor::TensorTypes::eDevice)
{
std::shared_ptr<Tensor> tensor{ new kp::Tensor(
this->mPhysicalDevice, this->mDevice, data, elementTotalCount, elementMemorySize, dataType, tensorType) };
if (this->mManageResources) {
this->mManagedTensors.push_back(tensor);
}
return tensor;
}
/**
* Create a managed algorithm that will be destroyed by this manager
* if it hasn't been destroyed by its reference count going to zero.

View file

@ -190,7 +190,7 @@ class Tensor
// TODO: move to cpp
template <typename T>
T* data() {
return this->mRawData;
return (T*)this->mRawData;
}
template <typename T>