在 android 上运行 opencl 与在其他设备上并无不同,只是并非所有的 android 设备都支持。

1. 首先要在 android 设备中找到支持 opencl 的库。这个库通常位于 /vendor/lib/libOpenCL.so。

2. 把这个 pull 出来,作为我们编译程序时候的动态库。

3. 在 android 工程中正常编写 opencl 程序,引用 opencl 头文件。 编译的时候链接上面的库。在 Java 端要记得用 System.load() 来载入该 opencl 库。

4. 之后就与普通的 NDK 程序没有什么不同了。

相关文章:

  • 2021-05-23
  • 2021-07-20
  • 2021-07-14
  • 2021-05-06
  • 2022-01-22
  • 2021-10-28
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2021-11-21
  • 2021-11-22
  • 2021-12-10
相关资源
相似解决方案