mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-08 10:00:29 +08:00
[Hackthon_4th 244] Added Paddle Lite GPU Backend (#1907)
* [improved] enum; ConfigureGpu(); * [improved] init() * [improved] valid place; model dir; is valid; * [added] WITH_OPENCL in cmake * [improved] set model; valid place; cmake url; cmake option; * Update runtime_option.cc --------- Co-authored-by: DefTruth <31974251+DefTruth@users.noreply.github.com>
This commit is contained in:
@@ -46,9 +46,14 @@ void RuntimeOption::SetEncryptionKey(const std::string& encryption_key) {
|
||||
}
|
||||
|
||||
void RuntimeOption::UseGpu(int gpu_id) {
|
||||
#ifdef WITH_GPU
|
||||
#if defined(WITH_GPU) || defined(WITH_OPENCL)
|
||||
device = Device::GPU;
|
||||
device_id = gpu_id;
|
||||
|
||||
#if defined(WITH_OPENCL) && defined(ENABLE_LITE_BACKEND)
|
||||
paddle_lite_option.device = device;
|
||||
#endif
|
||||
|
||||
#else
|
||||
FDWARNING << "The FastDeploy didn't compile with GPU, will force to use CPU."
|
||||
<< std::endl;
|
||||
|
Reference in New Issue
Block a user