[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:
unseenme
2023-05-12 20:44:27 +09:00
committed by GitHub
parent 15c29f7e49
commit 3fd21c935e
10 changed files with 70 additions and 10 deletions

View File

@@ -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;