Spaces:
Runtime error
Runtime error
Download llama-cpp-python/vendor/llama.cpp/kompute/test/shaders/Utils.cpp from aelitta/BioMistral_gradio: direct link, hf CLI and curl.
- Browser
- Download file 868 Bytes
-
https://huggingface.co/spaces/aelitta/BioMistral_gradio/resolve/main/llama-cpp-python/vendor/llama.cpp/kompute/test/shaders/Utils.cpp
- Command line
-
hf download hf://spaces/aelitta/BioMistral_gradio/llama-cpp-python/vendor/llama.cpp/kompute/test/shaders/Utils.cpp
-
curl -L -o Utils.cpp https://huggingface.co/spaces/aelitta/BioMistral_gradio/resolve/main/llama-cpp-python/vendor/llama.cpp/kompute/test/shaders/Utils.cpp
868 Bytes
| // SPDX-License-Identifier: Apache-2.0 | |
| std::vector<uint32_t> | |
| compileSource(const std::string& source) | |
| { | |
| std::ofstream fileOut("tmp_kp_shader.comp"); | |
| fileOut << source; | |
| fileOut.close(); | |
| if (system( | |
| std::string( | |
| "glslangValidator -V tmp_kp_shader.comp -o tmp_kp_shader.comp.spv") | |
| .c_str())) { | |
| throw std::runtime_error("Error running glslangValidator command"); | |
| } | |
| std::ifstream fileStream("tmp_kp_shader.comp.spv", std::ios::binary); | |
| std::vector<char> buffer; | |
| buffer.insert( | |
| buffer.begin(), std::istreambuf_iterator<char>(fileStream), {}); | |
| return { reinterpret_cast<uint32_t*>(buffer.data()), | |
| reinterpret_cast<uint32_t*>(buffer.data() + buffer.size()) }; | |
| } | |