This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple STL suffix array example | |
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
using namespace std; | |
int myints[] = {0,1,0,1,0,1,0,1}; | |
int lu[] = {0,1,2,3,4,5,6,7}; | |
int MY_STRING_LENGTH = 8; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple STL suffix array example | |
/* | |
crb002$ ./a.out | |
inv suffix array: 7 6 0 4 1 5 3 2 | |
suffix array: 2 4 7 6 3 5 1 0 | |
source: 0 0 1 1 0 1 0 0 | |
The sort took 29 comparison operations. | |
*/ | |
#include <iostream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define N 100 | |
int perm[N]; | |
void gcc_goto_issue(){ | |
int i,start, current; | |
for(i=0;i<N;i++){ | |
start = perm[i]; | |
current = perm[start]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
long TEST_SIZE = 10000000; | |
//PRNG code from http://bedaux.net/mtrand/ | |
class MTRand_int32 { // Mersenne Twister random number generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <stdint.h> | |
long TEST_SIZE = 500000; | |
long SAMPLES = 60000; | |
void my_copy(uint64_t* a, uint64_t* b, long n){ | |
memcpy(b, a, n*sizeof(uint64_t)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
timetest.cpp | |
A simple program to demonstrate the difference in timers on your platform. | |
Tue Dec 21 15:11:06 CST 2010 | |
Chad Brewbaker | |
[email protected] | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple radix histogram | |
// | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#define HIST_SIZE 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Simple radix histogram | |
// | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#define HIST_SIZE 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="button" onclick="detectCL()" value="Run Lesson 1"> | |
<script type="text/javascript"> | |
function detectCL() { | |
// First check if the WebCL extension is installed at all | |
if (window.WebCL == undefined) { | |
alert("Unfortunately your system does not support WebCL. " + | |
"Make sure that you have both the OpenCL driver " + | |
"and the WebCL browser extension installed."); | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<title>Learning WebCL, lesson 3</title> | |
<meta name="keywords" content="webcl, webgl, gpu, opencl, opengl" /> | |
<meta name="description" content="WebCL extension for Firefox, providing direct GPU access from JavaScript" /> | |
<link href="/default.css" rel="stylesheet" type="text/css" /> | |
</head> |
OlderNewer