Skip to content

Instantly share code, notes, and snippets.

View keisukefukuda's full-sized avatar

Keisuke Fukuda keisukefukuda

View GitHub Profile
#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
//
@keisukefukuda
keisukefukuda / custom-map-1.clj
Created August 4, 2015 01:04
Creating custom vector [ver.1]
(ns samples.core)
(deftype MyVec [contents]
clojure.lang.Associative
(entryAt [_ key]
(let [v (.entryAt contents key)]
(if (future? v)
@v
v)))
(assoc [_ key, val]
@keisukefukuda
keisukefukuda / test_overload.cpp
Created August 21, 2015 07:18
->* 演算子と .* 演算子の実験
#include <iostream>
struct Test {
int val;
// ->* 演算子は、任意の型についてオーバーロードできる
void operator->*(int i) {
std::cout << "operator->* is called with value " << i << std::endl;
}
#include <iostream>
#include <cassert>
#include <cstdlib>
int multiply(int x, int y) {
return x * y;
}
void type_safe_print() {
std::cout << std::endl;
#include <tuple>
#include <functional>
#include <iostream>
#include <cassert>
#include <cstdlib>
template<int ...>
struct seq { };
template<int N, int ...S>
// ==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
@keisukefukuda
keisukefukuda / simple_omp.cpp
Created April 25, 2012 08:40
Simple code to test StarPU's combined worker feature.
// 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;
@keisukefukuda
keisukefukuda / simple_partition.cpp
Created April 27, 2012 09:50
A simple program using StarPU's partitioning feature.
// 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;
@keisukefukuda
keisukefukuda / simple_multiformat.cu
Created April 29, 2012 09:12
An example of using StarPU's multiformat feature.
/*
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
@keisukefukuda
keisukefukuda / starpu_pheft.cu
Created July 4, 2012 11:10
StarPU's "pheft" behavior
#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]);