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 <iostream> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <sys/time.h> | |
//---------------------------------------------------------------------- | |
const int N = 20000; | |
const double L = 10.0; | |
const int D = 3; | |
const int X = 0; |
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
# put "source .zshrc.git" on your .zshrc | |
autoload -U colors; colors | |
function rprompt-git { | |
local name st color | |
name=`git symbolic-ref HEAD 2> /dev/null | sed -e "s/refs\/heads\///g"` | |
if [[ -z $name ]]; then | |
return | |
fi |
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 <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
int | |
myrand(const int max) { | |
double r = static_cast<double>(rand()) / (static_cast<double>(RAND_MAX) + 1.0); | |
return static_cast<int>(r * max); | |
}; |
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 <iostream> | |
#include <algorithm> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
bool called_srand = false; | |
//---------------------------------------------------------------------- | |
int | |
myrand(const int max) { | |
if(called_srand){ | |
called_srand = 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
$ icpc --version | |
icpc (ICC) 12.1.4 20120410 | |
Copyright (C) 1985-2012 Intel Corporation. All rights reserved. | |
$ g++ --version | |
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11) |
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 <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65536; | |
//---------------------------------------------------------------------- | |
double | |
myrand(void){ |
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 <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65535; | |
//---------------------------------------------------------------------- | |
double | |
myrand(void){ |
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 <iostream> | |
#include <stdio.h> | |
#include <math.h> | |
#include <stdlib.h> | |
#include <curand.h> | |
//---------------------------------------------------------------------- | |
const int N = 10000; | |
const int SAMPLE = 65536; | |
//---------------------------------------------------------------------- | |
double |
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 <stdio.h> | |
#include <cuda.h> | |
__global__ void | |
func(void){ | |
printf("%d %d %d\n",blockIdx.x, blockDim.x, threadIdx.x); | |
} | |
int | |
main(void){ |
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 <iostream> | |
#include <cuda.h> | |
#include <algorithm> | |
#include <curand_kernel.h> | |
const int N = 10000; | |
__global__ void | |
func(double *out){ | |
int id = blockIdx.x * blockDim.x + threadIdx.x; |