Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Kompute Tensor device is null" when rebuilding tensor #300

Open
MiroPalmu opened this issue Sep 3, 2022 · 0 comments
Open

"Kompute Tensor device is null" when rebuilding tensor #300

MiroPalmu opened this issue Sep 3, 2022 · 0 comments

Comments

@MiroPalmu
Copy link
Contributor

When creating a tensor from manager with

inline std::shared_ptr<kp::TensorT<float>> kp::Manager::tensorT<float>(const kp::Constants &data, kp::Tensor::TensorTypes tensorType = kp::Tensor::TensorTypes::eDevice)

and then calling rebuild on created tensor it will throw "Kompute Tensor device is null"

I'm not very familiar with kompute yet but it seems if in rebuild member function following branch gets executed

if (this->mPrimaryBuffer || this->mPrimaryMemory) {
        KP_LOG_DEBUG(
          "Kompute Tensor destroying existing resources before rebuild");
        this->destroy();
    }

then in allocateMemoryCreateGPUResources

if (!this->mDevice) {
        throw std::runtime_error("Kompute Tensor device is null");
    }

gets executed every time because after this->destroy() mDevice is nullptr every time. This can be seen at Tensor.cpp:548

if (this->mDevice) {
    this->mDevice = nullptr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant