Spaces:
Runtime error
Runtime error
Download llama-cpp-python/vendor/llama.cpp/kompute/src/OpTensorSyncDevice.cpp from aelitta/BioMistral_gradio: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/spaces/aelitta/BioMistral_gradio/resolve/main/llama-cpp-python/vendor/llama.cpp/kompute/src/OpTensorSyncDevice.cpp
- Command line
-
hf download hf://spaces/aelitta/BioMistral_gradio/llama-cpp-python/vendor/llama.cpp/kompute/src/OpTensorSyncDevice.cpp
-
curl -L -o OpTensorSyncDevice.cpp https://huggingface.co/spaces/aelitta/BioMistral_gradio/resolve/main/llama-cpp-python/vendor/llama.cpp/kompute/src/OpTensorSyncDevice.cpp
1.26 kB
| // SPDX-License-Identifier: Apache-2.0 | |
| namespace kp { | |
| OpTensorSyncDevice::OpTensorSyncDevice( | |
| const std::vector<std::shared_ptr<Tensor>>& tensors) | |
| { | |
| KP_LOG_DEBUG("Kompute OpTensorSyncDevice constructor with params"); | |
| if (tensors.size() < 1) { | |
| throw std::runtime_error( | |
| "Kompute OpTensorSyncDevice called with less than 1 tensor"); | |
| } | |
| this->mTensors = tensors; | |
| } | |
| OpTensorSyncDevice::~OpTensorSyncDevice() | |
| { | |
| KP_LOG_DEBUG("Kompute OpTensorSyncDevice destructor started"); | |
| this->mTensors.clear(); | |
| } | |
| void | |
| OpTensorSyncDevice::record(const vk::CommandBuffer& commandBuffer) | |
| { | |
| KP_LOG_DEBUG("Kompute OpTensorSyncDevice record called"); | |
| for (size_t i = 0; i < this->mTensors.size(); i++) { | |
| if (this->mTensors[i]->tensorType() == Tensor::TensorTypes::eDevice) { | |
| this->mTensors[i]->recordCopyFromStagingToDevice(commandBuffer); | |
| } | |
| } | |
| } | |
| void | |
| OpTensorSyncDevice::preEval(const vk::CommandBuffer& /*commandBuffer*/) | |
| { | |
| KP_LOG_DEBUG("Kompute OpTensorSyncDevice preEval called"); | |
| } | |
| void | |
| OpTensorSyncDevice::postEval(const vk::CommandBuffer& /*commandBuffer*/) | |
| { | |
| KP_LOG_DEBUG("Kompute OpTensorSyncDevice postEval called"); | |
| } | |
| } | |