2020年1月7日

OpenBLAS(1)----安装OpenBLAS

摘要: 项目主页 http://www.openblas.net/ https://github.com/xianyi/OpenBLAS 编译安装 下载OpenBLAS源码 cd OpenBLAS sudo apt-get install gfortran sudo make FC=gfortran sud 阅读全文

posted @ 2020-01-07 18:13 feihu_h 阅读(552) 评论(0) 推荐(0) 编辑

2020年1月6日

1、数组、链表、栈、队列、树

摘要: 1、数组 构建简单、索引简单O(1) 需要一段连续的空间、check某元素存在与否要O(n)时间复杂度 一些问题: https://leetcode-cn.com/problems/valid-anagram/ 2、链表 灵活分配空间、增删时间复杂度O(1)、适用于数据个数不定算法中进场添加删除等 阅读全文

posted @ 2020-01-06 00:00 feihu_h 阅读(251) 评论(0) 推荐(0) 编辑

2020年1月5日

opencl(十八)----矩阵转置、矩阵乘法

摘要: 矩阵转置 // kernel __kernel void transpose(__global float4 *g_mat, __local float4 *l_mat, uint size) { __global float4 *src, *dst; /* Determine row and co 阅读全文

posted @ 2020-01-05 22:34 feihu_h 阅读(1056) 评论(0) 推荐(0) 编辑

opencl(十七)----基数排序

摘要: 基数排序原理: 分桶,遍历每一个有效位,根据该位中是0还是1进行分组。 设备代码: __kernel void radix_sort8(__global ushort8 *global_data) { typedef union { ushort8 vec; ushort array[8]; } v 阅读全文

posted @ 2020-01-05 21:38 feihu_h 阅读(544) 评论(0) 推荐(0) 编辑

opencl(二十五)----双调排序

摘要: 参考:《opencl实战》 双调排序 一个序列:进行升序排列 6 1 4 5 7 2 3 8 a、左右两部分别 升序、降序 1 4 5 6 8 7 3 2 b 、左右度应位置比较,小的左移 1 4 3 2 8 7 5 6 c、左右都整成升序 1 2 3 4 5 6 7 8 注:四个元素如何排序 op 阅读全文

posted @ 2020-01-05 18:38 feihu_h 阅读(859) 评论(0) 推荐(0) 编辑

2020年1月4日

opencl(二十一)----直方图

摘要: 计算RGB图像的直方图 // kernel __kernel void histogram(__global uchar* imgdata, __global uint *histogram, __local uint *local_histogram, uint data_size_item, u 阅读全文

posted @ 2020-01-04 22:05 feihu_h 阅读(635) 评论(0) 推荐(0) 编辑

2019年12月31日

libjpeg(1)----读取图像

摘要: 安装libjpeg: sudo apt-get install libjpeg-dev demo #include <iostream> #include <jpeglib.h> #include <memory.h> #include <stdio.h> #include <stdlib.h> i 阅读全文

posted @ 2019-12-31 13:36 feihu_h 阅读(382) 评论(0) 推荐(0) 编辑

2019年12月30日

opencl(十六)----MapReduce

摘要: MapReduce 两个部分: 映射:产生键值对 归并:处理这些键值对 demo: 统计模式串在文本中的频次 // kernel __kernel void string_search(char16 pattern, __global char* text, int chars_per_item, 阅读全文

posted @ 2019-12-30 12:55 feihu_h 阅读(367) 评论(0) 推荐(0) 编辑

2019年12月27日

opencl(十三)---图像处理内建函数

摘要: 读取图像 read_imagef (2D) : https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/read_imagef2d.html read_imagef (3D) :https://www.khronos.org/re 阅读全文

posted @ 2019-12-27 11:29 feihu_h 阅读(928) 评论(0) 推荐(0) 编辑

2019年12月25日

opencl(十一)----混洗、选择

摘要: 混洗函数 可以参考: https://www.khronos.org/registry/OpenCL/sdk/1.1/docs/man/xhtml/shuffle.html // 创建一个包含x中元素的向量,包含哪些元素有 mask 控制 gentypen shuffle ( gentypem x, 阅读全文

posted @ 2019-12-25 17:55 feihu_h 阅读(773) 评论(0) 推荐(0) 编辑

2019年12月24日

opencl(十)----标量、向量类型的相关运算

摘要: OpenCL operators 参考:https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/ int4 vec = (int4)(1, 2, 3, 4); vec += 4;//每一个元素加上4 vec &= (int4)(- 阅读全文

posted @ 2019-12-24 18:08 feihu_h 阅读(2319) 评论(0) 推荐(0) 编辑

opencl(九)----标量、向量数据类型

摘要: 1、opencl 标量数据类型 bool char unsigned char/uchar short 16位有符号整数(补码) ushort int 32位有符号整数(补码) uint 32位无符号 long 64位有符号 ulong half 16位浮点数 float 32位浮点数 intptr 阅读全文

posted @ 2019-12-24 15:33 feihu_h 阅读(1573) 评论(0) 推荐(0) 编辑

2019年12月23日

opencl(八)----clEnqueueNDRangeKernel、clEnqueueTask、工作组和工作项

摘要: clEnqueueNDRangeKernel cl_int clEnqueueNDRangeKernel ( cl_command_queue command_queue, //命令队列 cl_kernel kernel, //核 cl_uint work_dim, //数据的维度 const si 阅读全文

posted @ 2019-12-23 17:05 feihu_h 阅读(2886) 评论(0) 推荐(0) 编辑

opencl(七)----读写传输命令、内存映射命令

摘要: Read读(从设备到主机) // 将缓存对象中的数据读到内存对象中 cl_int clEnqueueReadBuffer ( cl_command_queue command_queue, //命令队列 cl_mem buffer, // 缓存对象 cl_bool blocking_read, // 阅读全文

posted @ 2019-12-23 16:38 feihu_h 阅读(2145) 评论(0) 推荐(0) 编辑

2019年12月22日

opencl(六)----图像对象

摘要: 图像对象同样使用cl_mem数据结构 创建图像对象 // 创建2D的图像对象cl_mem clCreateImage2D ( cl_context context, //上下文 cl_mem_flags flags, // 对象性质标签 const cl_image_format *image_fo 阅读全文

posted @ 2019-12-22 23:18 feihu_h 阅读(938) 评论(0) 推荐(0) 编辑

opencl(五)----缓存对象

摘要: 创建缓存对象 参考:https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/clCreateBuffer.html // 创建缓存对象 cl_mem clCreateBuffer ( cl_context context, //上 阅读全文

posted @ 2019-12-22 23:01 feihu_h 阅读(495) 评论(0) 推荐(0) 编辑

opencl(四)----创建命令队列

摘要: 创建命令队列 参考:https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/clCreateCommandQueue.html //创建命令队列 cl_command_queue clCreateCommandQueue( cl_ 阅读全文

posted @ 2019-12-22 22:15 feihu_h 阅读(655) 评论(0) 推荐(0) 编辑

opencl(三)----创建、编译程序(cl_program)、创建内核

摘要: 1、创建程序 // 从文本中创建程序 cl_program clCreateProgramWithSource ( cl_context context, // 上下文 cl_uint count, //文本个数 const char **strings, // 程序文本 const size_t 阅读全文

posted @ 2019-12-22 22:00 feihu_h 阅读(1664) 评论(0) 推荐(0) 编辑

opencl(二)----平台、设备、上下文的获取

摘要: 1、获取平台 参考:https://www.khronos.org/registry/OpenCL/sdk/1.0/docs/man/xhtml/clGetPlatformInfo.html cl_int clGetPlatformIDs( cl_uint num_entries, //想要获取的平 阅读全文

posted @ 2019-12-22 20:50 feihu_h 阅读(1077) 评论(0) 推荐(0) 编辑

2019年11月17日

ROS--自定义消息类型

摘要: 一、msg 用于发布-订阅的通信方式中。 1、在包的src 中创建msg文件夹。 2、在msg文件夹中,创建.msg文件 3、编辑.msg文件 4、编辑package.xml , 添加依赖 <build_depend>message_generation</build_depend> <run_de 阅读全文

posted @ 2019-11-17 23:11 feihu_h 阅读(1427) 评论(0) 推荐(0) 编辑

导航