资源简介
GPGPU的入门程序,很简单很实用,主要是方便理解!!
代码片段和文件信息
//---------------------------------------------------------------------------
// www.GPGPU.org
// Sample Code
//---------------------------------------------------------------------------
// Copyright (c) 2004 Mark J. Harris and GPGPU.org
//---------------------------------------------------------------------------
// This software is provided ‘as-is‘ without any express or implied
// warranty. In no event will the authors be held liable for any
// damages arising from the use of this software.
//
// Permission is granted to anyone to use this software for any
// purpose including commercial applications and to alter it and
// redistribute it freely subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you
// must not claim that you wrote the original software. If you use
// this software in a product an acknowledgment in the product
// documentation would be appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such and
// must not be misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//
//---------------------------------------------------------------------------
// Author: Mark Harris (harrism@gpgpu.org)
//---------------------------------------------------------------------------
// GPGPU Lesson 0: “helloGPGPU“.
//---------------------------------------------------------------------------
//
// GPGPU CONCEPTS Introduced:
//
// 1.) Texture = Array
// 2.) Fragment Program = Computational Kernel.
// 3.) One-to-one Pixel to Texel Mapping:
// a) Data-Dimensioned Viewport and
// b) Orthographic Projection.
// 4.) Viewport-Sized Quad = Data Stream Generator.
// 5.) Copy To Texture = feedback.
//
// For details of each of these concepts see the explanations in the
// inline “GPGPU CONCEPT“ comments in the code below.
//
// APPLICATION Demonstrated: A simple post-process edge detection filter.
//
//---------------------------------------------------------------------------
#include
#include
#include
#define GLEW_STATIC 1
#include
#include
// forward declarations
class HelloGPGPU;
void reshape(int w int h);
// globals
CGcontext g_cgContext;
CGprofile g_cgProfile;
HelloGPGPU *g_pHello;
// This shader performs a 9-tap Laplacian edge detection filter.
static const char *edgeFragSource =
“half4 edges(half2 coords : TEX0 \n“
“ uniform sampler2D texture) : COLOR \n“
“{ \n“
“ static const half offset = 1.0 / 512.0; \n“
“ half4 c = tex2D(texture coords);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13265 2004-06-11 15:52 helloGPGPU-1.0.2\helloGPGPU.cpp
文件 3690 2004-06-11 15:50 helloGPGPU-1.0.2\helloGPGPU.dsp
文件 53248 2004-06-11 15:50 helloGPGPU-1.0.2\helloGPGPU.exe
文件 4359 2004-05-05 15:40 helloGPGPU-1.0.2\helloGPGPU.vcproj
目录 0 2004-06-11 16:04 helloGPGPU-1.0.2\
- 上一篇:软件工程课设
- 下一篇:MTK elian 一键配网 有详细操作流程
相关资源
- Nbody问题采用treecode算法在GPU上的并行
- CUDA、GPU实现图像的sobel、prewitt、均值
- cuda、GPU实现向量相加
- 基于GPU的并行遗传算法
- GPU Gems 3
- FastLineRendererforUnity-GPULineandParticleSys
- 北极星架构显卡编辑器1.7版本
- GPU Games 三部曲合集
- Gpu pro1-7
- GPU pro shaderX GPU gems 全系列
- 基于CUDA架构实现GPU加速FDK重建算法研
- NVIDIA vGPU for vSphere xenserver rhel windows
- libcudnn7-doc_7.6.5.32-1+cuda10.2_amd64.deb
- 使用opengl 4.3的compute shader实现通用计
- cudart64_101.dll
- yolov3使用教程(从tensorflow-gpu环境搭建
- nvidia-docker-1.0.1-1.x86_64.rpm
- 哼唱检索的并行化方法研究与实现
- 深度学习入门工具介绍PPT——实践篇
- GPU-SPH源代码
- 基于NVIDIA的GPU加速的各向异性二维三
- HLSL语言编程
评论
共有 条评论