android查看libopencl版本,Android OpenCL测试程序,使用dlopen动态加载libOpenCL.so库

1、环境配置:

Android NDK

Android studio

2、下载头文件:

大家可以通过这个链接下载头文件:

http://download.csdn.net/detail/wjskeepmaking/9811058

2ca702b8c989689cb62abd4823f3805f.png

3、声明native函数并生成头文件:

public class OpenclTest {

public String testOpencl(){

return testopencl();

}

public String getplatformName(){

return getPlatformName();

}

public String getdeviceName(){

return getDeviceName();

}

public native String testopencl();

public native String getPlatformName();

public native String getDeviceName();

}

进入package的同级目录,利用javah命令生成头文件:

243c0956bd7bd4272c1e53c871bb75b0.png

4、编写ocl.cpp文件:

//

// Created by wujs on 2017/4/11.

//

#include "CL/cl.h"

#include#include#include#include #include "topencl.h"

#include"com_pax_imagesobelfilter_OpenclTest.h"

#include #define LOG_TAG "test"

#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))

#define LEN(arr) sizeof(arr) / sizeof(arr[0])

#define N 1024

#define NUM_THREAD 128

cl_uint num_device;

cl_uint num_platform;

cl_platform_id *platform;

cl_device_id *devices;

cl_int err;

cl_context context;

cl_command_queue cmdQueue;

cl_mem buffer,sum_buffer;

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值