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 <stdio.h> | |
#include <cuda.h> | |
#include <curand_kernel.h> | |
__global__ void | |
func(void){ | |
int id = blockIdx.x * blockDim.x + threadIdx.x; | |
curandState s; | |
curand_init(0,id,0,&s); | |
for(int i=0;i<4;i++){ |
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; |
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 <random> | |
//---------------------------------------------------------------------- | |
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 <stdlib.h> | |
//---------------------------------------------------------------------- | |
const int N = 32768; | |
const double L = 10.0; | |
const int D = 3; | |
const int X = 0; | |
const int Y = 1; | |
const int Z = 2; | |
double q[N][D],p[N][D]; |
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 <stdlib.h> | |
#include <assert.h> | |
#include <cuda.h> | |
//---------------------------------------------------------------------- | |
const int N = 32768; | |
const double L = 10.0; | |
const int D = 3; | |
const int X = 0; | |
const int Y = 1; |
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 <stdlib.h> | |
#include <assert.h> | |
#include <cuda.h> | |
//---------------------------------------------------------------------- | |
const int N = 32768; | |
const double L = 10.0; | |
const int D = 3; | |
const int X = 0; | |
const int Y = 1; |
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
h = Hash.new | |
1000.times{ | |
`mkpasswd`.split(//).each{|s| | |
h[s] = true | |
} | |
} | |
h.sort.each{|key,value| | |
print key | |
} | |
puts |
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 <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int | |
main(void) { | |
const int n = 94; | |
const char p[8] = {0, 0, 0, 0, 0, 0, 0, 0}; | |
const char *ans = "~~~~!!!!"; |
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
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 | |
st=`git status 2> /dev/null` | |
if [[ -n `echo "$st" | grep "^nothing to"` ]]; then |