This file contains hidden or 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 <cstdio> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#define _GNU_SOURCE | |
#include <pthread.h> | |
#include <unistd.h> | |
#include <sched.h> | |
#include <errno.h> |
This file contains hidden or 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
mkdir -p ~/LLVM && cd ~/LLVM | |
wget -O - http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz | tar Jxf - | |
wget -O - http://llvm.org/releases/3.7.1/cfe-3.7.1.src.tar.xz | \ | |
tar Jxf - -C llvm-3.7.1.src/tools | |
cd /home/morris1028/LLVM/hw1 | |
mkdir build && cd build | |
cmake /home/morris1028/LLVM/llvm-3.7.1.src |
This file contains hidden or 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
import os | |
student = open('students') | |
for line in student.readlines(): | |
line = line[:-1] | |
print line | |
cmd = "useradd -m -s /bin/bash -d /home/pp2016/%s %s" % (line, line) | |
psw = "echo %s:%s | chpasswd" % (line, line) | |
print cmd |
This file contains hidden or 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 <assert.h> | |
#include <inttypes.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <CL/cl.h> | |
#define MAXGPU 8 | |
#define MAXN 2048 |
This file contains hidden or 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 "matrix.h" | |
// #define DEBUG | |
#define UINT unsigned long | |
#define MAXN 2048 | |
void rand_gen(UINT c, int N, UINT A[][MAXN]) { | |
UINT x = 2, n = N*N; | |
for (int i = 0; i < N; i++) { | |
for (int j = 0; j < N; j++) { |
This file contains hidden or 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
import sys | |
import Image | |
import codecs | |
sys.stdout = codecs.getwriter('utf8')(sys.stdout) | |
for infile in sys.argv[1:]: | |
try: | |
im = Image.open(infile) | |
width = im.size[0] | |
height = im.size[1] |
This file contains hidden or 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
#!/bin/bash | |
TEXT_RED=`tput setaf 1` | |
TEXT_GREEN=`tput setaf 2` | |
TEXT_RESET=`tput sgr0` | |
CONFIG_FILE=nvvp.cfg | |
if [ ! -f $CONFIG_FILE ]; | |
then | |
echo "[ERROR] Profile config file ${TEXT_RED}nvvp.cfg${TEXT_RESET} does not exist." |
This file contains hidden or 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
#!/bin/bash | |
TEXT_RED=`tput setaf 1` | |
TEXT_GREEN=`tput setaf 2` | |
TEXT_RESET=`tput sgr0` | |
CONFIG_FILE=nvvp.cfg | |
if [ ! -f $CONFIG_FILE ]; | |
then | |
echo "[ERROR] Profile config file ${TEXT_RED}nvvp.cfg${TEXT_RESET} does not exist." |
This file contains hidden or 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> | |
int main(void) | |
{ | |
int a[101][101]={0},n,i,j,k,A=0,B=0,C=0,D=0; | |
scanf("%d",&n); | |
for(i=1;i<=n;i++) | |
{ | |
for(j=1;j<=n;j++) | |
{ |
This file contains hidden or 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
\begin{tikzpicture}[scale=0.4,font=\sffamily] | |
\begin{axis}[ | |
xlabel={Processor $p$}, | |
ylabel={Time (second)}, | |
xmin=1, xmax=16, | |
ymin=0, ymax=1.2, | |
scaled ticks = false, | |
tick label style={/pgf/number format/fixed}, | |
xtick={1, 2, 4, 8, 16}, | |
ytick={0, 0.2, 0.4, 0.6, 0.8, 1, 1.2}, |