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
#!/bin/bash | |
# | |
# Copyright 2013 Ian Liu Rodrigues <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
#!/bin/bash | |
# | |
# Copyright 2013 Ian Liu Rodrigues <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
// compile with: gcc -std=gnu99 example.c profiler.c -lrt | |
#include "profiler.h" | |
#include <stdio.h> | |
FILE *devnull; | |
Profiler p_total; | |
Profiler p_foo8; | |
Profiler p_foo10; | |
// Run n! times |
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
# - Finds C99 standard support | |
# This internally calls the check_c_source_compiles macro to determine the | |
# appropriate flags for a C99 standard compilation. | |
#============================================================================= | |
# Copyright 2013 Ian Liu Rodrigues <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
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
PROGRAM interpol | |
Implicit none | |
double precision :: Y, X = 8.95 | |
double precision :: s1, s2, p | |
integer :: n = 6, i, j | |
double precision,allocatable,dimension(:) :: xx, ff, ww | |
allocate(xx(n)) | |
allocate(ff(n)) |
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
X = 8.95 | |
xx = [1.4, 2.3, 4.0, 5.9, 10.0, 10.1] | |
n = len(xx) | |
ff = [x*x for x in xx] | |
ww = [1.0 for i in range(n)] | |
for i in range(n): | |
for j in range(n): | |
if i != j: |
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
// compile with: gcc atomic-sum.c -lpthread | |
#define __STDC_FORMAT_MACROS | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <inttypes.h> | |
uint64_t sum = 0; | |
static int n_threads = 4; |
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
#!/bin/bash | |
# | |
# Copyright (C) 2013 Ian Liu Rodrigues <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
import sys | |
from struct import pack | |
def usage(): | |
sys.stderr.write("Usage: %s -w WIDTH -h HEIGHT [-s SIZE]\n" % \ | |
(sys.argv[0], )) | |
sys.stderr.write(" -w WIDTH Image width\n") | |
sys.stderr.write(" -h HEIGHT Image height\n") | |
sys.stderr.write(" -s SIZE Size of the checkers (default 100)\n") | |
sys.exit(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
all clean: build build-opt | |
@$(MAKE) -s -C build $@ | |
@$(MAKE) -s -C build-opt $@ | |
build: | |
mkdir -p $@ ; cd $@ && \ | |
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=Yes \ | |
-DCMAKE_BUILD_TYPE=Debug .. | |
build-opt: |
OlderNewer