Updated tests and rebased
This commit is contained in:
parent
bb64b2b37c
commit
a2ee928f4c
9 changed files with 151 additions and 100 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue