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 <unistd.h> | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#define USE_PAPI | |
// gcc -Wall -O2 colsum.c -I$HOME/local/include -L$HOME/local/lib -lpapi | |
// |
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
(ns samples.core) | |
(deftype MyVec [contents] | |
clojure.lang.Associative | |
(entryAt [_ key] | |
(let [v (.entryAt contents key)] | |
(if (future? v) | |
@v | |
v))) | |
(assoc [_ key, val] |
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> | |
struct Test { | |
int val; | |
// ->* 演算子は、任意の型についてオーバーロードできる | |
void operator->*(int i) { | |
std::cout << "operator->* is called with value " << i << std::endl; | |
} |
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 <cassert> | |
#include <cstdlib> | |
int multiply(int x, int y) { | |
return x * y; | |
} | |
void type_safe_print() { | |
std::cout << std::endl; |
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 <tuple> | |
#include <functional> | |
#include <iostream> | |
#include <cassert> | |
#include <cstdlib> | |
template<int ...> | |
struct seq { }; | |
template<int N, int ...S> |
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
// ==UserScript== | |
// @name Titech Portal Auto Login | |
// @namespace http://www.titech.ac.jp/ | |
// @id titech-portal-auto-login@www.titech.ac.jp | |
// @description 東工大ポータルに自動的にログインします | |
// @author NAKASHIMA, Makoto <makoto.nksm@gmail.com> | |
// @include https://portal1.nap.gsic.titech.ac.jp/* | |
// @include https://portal.nap.gsic.titech.ac.jp/* | |
// @include http://portal.titech.ac.jp/* | |
// @jsversion 1.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 program using combined worker. | |
#include <iostream> | |
#include <starpu.h> | |
#include <omp.h> | |
starpu_perfmodel perf_model, perf_model_omp; | |
starpu_data_handle_t handle; | |
starpu_task *task = NULL, *task_omp = NULL; | |
starpu_codelet cl, cl_omp; | |
starpu_conf conf; |
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 program using StarPU's partitionning feature. | |
#include <cmath> | |
#include <sys/time.h> | |
#include <iostream> | |
#include <starpu.h> | |
starpu_perfmodel perf_model; | |
starpu_data_handle_t handle; | |
starpu_codelet cl; | |
starpu_conf conf; |
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
/* | |
Copyright (c) 2012, Keisuke Fukuda. All rights reserved. | |
License : new BSD license | |
# The Makefile looks like this: | |
NVCC=nvcc | |
CUDA_SDK=${HOME}/NVIDIA_GPU_Computing_SDK | |
CUTIL_INC=${CUDA_SDK}/C/common/inc | |
simple_multiformat: simple_multiformat.cu |
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 <starpu.h> | |
struct starpu_codelet cl; | |
struct starpu_perfmodel perf; | |
starpu_data_handle_t handle; | |
void cpu_func(void *buffer[], void *arg) { | |
int N = STARPU_VECTOR_GET_NX(buffer[0]); | |
double *vec = (double*) STARPU_VECTOR_GET_PTR(buffer[0]); |