- 博客(8)
- 收藏
- 关注
原创 关于矩阵相乘
#include#include#include//矩阵相乘核心算法const char *KernelSource="__kernel void SimpleMultiply(__global int *outputC,int widthA,int heightA,int widthB,int heightB,__global int *inputA,__global
2013-04-28 13:46:40 838
原创 关于矩阵变化的3种做法(2)
后来想到了一维的方式,除内核与上面那方式不同外,其他的都相同:内核如下;const char *KernelSource="__kernel void add(__global int *outputB,__global int *inputA)""{"" int i=get_global_id(0);"" if(i=8&&i=16&&i=24&&i"
2013-04-28 13:40:40 775
原创 关于矩阵变化的3种做法(1)
指导老师交给我们一个任务让有1的部分加1,2的部分加2,3的部分加3,4的部分加4.一开是我对OpenCL的映射不是很清楚,于是不知道该如何分配线程来解决这个问题,后来我想到了一个”简便“算法,这不就是相当于每个部分乘以2吗?于是我一开始内核代码是这样写的://矩阵变化const char *KernelSource="__kernel
2013-04-28 13:30:22 974
原创 两个矩阵相加
#include#include#includeconst char *KernelSource="__kernel void add(__global int *A,__global int *B,__global int *C)""{"" int i=get_global_id(0);"" C[i]=A[i]+B[i]; ""}";
2013-04-28 13:11:42 3855
原创 OpenCL 两个向量相加
// This program implements a vector addition using OpenCL// System includes#include #include // OpenCL includes#include // OpenCL kernel to perform an element-wise // add of two
2013-04-28 13:09:10 1726
原创 OpenCL中的“Hello,world”
一、Hello,World程序:cl文件:#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable__constant char hw[] = "Hello World\n";__kernel void hello(__global char * out){size_t tid = get_global_
2013-04-28 13:05:28 1450
原创 《OpenCL异构计算》学习笔记
第一章 并行编程入门1. 线程与共享内存:线程: 一个正在运行的程序可以由几个子程序组成,它们分别维护着自己独立的控制流,可以并发执行,这些子程序被定义为“线程(Thread)”。2.消息传递通讯:消息传递通信模型使我们能指定计算时可能会使用的一系列任务之间如何进行通信。任务通过发送和接收具体消息来实现数据交换。3.不同的并行粒度:并行粒度被定义为计算与通讯之比。并行粒度
2013-04-28 13:01:36 2496 1
原创 Activity 2.2.4: Network Representations
Activity 2.2.4: Network RepresentationsAddressing Table:This Lab does not include an Addressing Table.Learning Objectives:Explore the PT interfaceLocate the key components used to place de
2013-04-28 12:55:48 2174
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人