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
FROM centos | |
ADD tapir.tgz /usr/ | |
ADD hello /tapir/hello | |
RUN yum update -y && yum install -y libcilkrts libedit gcc make | |
RUN ln -s /usr/lib64/libcilkrts.so.5 /usr/lib/libcilkrts.so | |
CMD [ "/bin/bash" ] |
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 Foreign.Ptr | |
import Foreign.Storable | |
import Foreign.Marshal.Array | |
{-@ type PtrLen a n = {v:Ptr a | plen v = n && 0 <= pbase v && 0 <= plen v} @-} | |
{-@ withArray :: Storable a => x:[a] -> (PtrLen a (len x) -> IO b) -> IO b @-} | |
{-@ withConstArray :: Storable a => a -> n:Nat -> (PtrLen a n -> IO b) -> IO b @-} | |
withConstArray x n = withArray (replicate n 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 <qthread/qthread.h> | |
#include <qthread/sinc.h> | |
typedef struct args { | |
int i; | |
qt_sinc_t* sinc; | |
} args; | |
aligned_t hello(void* arg){ | |
args a = *(args*)arg; |
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
bool detach(); | |
void reattach(atomic_int* arg); | |
int f(){ | |
atomic_int* a = alloca(sizeof(int)); | |
a[0] = 0; | |
if(detach()){ | |
a[0]++; | |
reattach(a); | |
} |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <assert.h> | |
#include <cilk/cilk.h> | |
int main(int argc, char** argv){ | |
int n = argc > 1 ? atoi(argv[1]) : 100000000; | |
int *a=malloc(n*sizeof(int)); | |
cilk_for(int i=0; i<n; i++){ | |
a[i] = 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
clang-5.0: /ram/mnt/local/ssd1/parallel-ir/lib/Analysis/ScalarEvolution.cpp:3671: const llvm::SCEV* llvm::ScalarEvolution::getSCEV(llvm::Value*): Assertion `isSCEVable(V->getType()) && "Value is not SCEVable!"' failed. | |
#0 0x0000000003aa7438 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /ram/mnt/local/ssd1/parallel-ir/lib/Support/Unix/Signals.inc:398:0 | |
#1 0x0000000003aa74cb PrintStackTraceSignalHandler(void*) /ram/mnt/local/ssd1/parallel-ir/lib/Support/Unix/Signals.inc:462:0 | |
#2 0x0000000003aa59ce llvm::sys::RunSignalHandlers() /ram/mnt/local/ssd1/parallel-ir/lib/Support/Signals.cpp:49:0 | |
#3 0x0000000003aa6dad SignalHandler(int) /ram/mnt/local/ssd1/parallel-ir/lib/Support/Unix/Signals.inc:252:0 | |
#4 0x000014e62abeb5e0 __restore_rt (/lib64/libpthread.so.0+0xf5e0) | |
#5 0x000014e6297681f7 __GI_raise (/lib64/libc.so.6+0x351f7) | |
#6 0x000014e6297698e8 __GI_abort (/lib64/libc.so.6+0x368e8) | |
#7 0x000014e629761266 __assert_fail_base (/lib64/libc.so.6+0x2e266) | |
#8 0x000014e629761312 (/lib64/libc.so.6+0x2e312) |
This file has been truncated, but you can view the full file.
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
; ModuleID = 'main.cpp' | |
source_filename = "main.cpp" | |
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" | |
target triple = "x86_64-unknown-linux-gnu" | |
%"class.std::ios_base::Init" = type { i8 } | |
%"class.std::basic_ostream" = type { i32 (...)**, %"class.std::basic_ios" } | |
%"class.std::basic_ios" = type { %"class.std::ios_base", %"class.std::basic_ostream"*, i8, i8, %"class.std::basic_streambuf"*, %"class.std::ctype"*, %"class.std::num_put"*, %"class.std::num_get"* } | |
%"class.std::ios_base" = type { i32 (...)**, i64, i64, i32, i32, i32, %"struct.std::ios_base::_Callback_list"*, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, %"struct.std::ios_base::_Words"*, %"class.std::locale" } | |
%"struct.std::ios_base::_Callback_list" = type { %"struct.std::ios_base::_Callback_list"*, void (i32, %"class.std::ios_base"*, i32)*, i32, i32 } |
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
../../build/bin/clang -ftapir=openmp -fopenmp -O3 -g -o nqueens_tapir nqueens.c | |
#0 0x0000000003e9dd59 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /dev/shm/parallel-ir/lib/Support/Unix/Signals.inc:398:0 | |
#1 0x0000000003e9ddea PrintStackTraceSignalHandler(void*) /dev/shm/parallel-ir/lib/Support/Unix/Signals.inc:462:0 | |
#2 0x0000000003e9c32e llvm::sys::RunSignalHandlers() /dev/shm/parallel-ir/lib/Support/Signals.cpp:49:0 | |
#3 0x0000000003e9d6f1 SignalHandler(int) /dev/shm/parallel-ir/lib/Support/Unix/Signals.inc:252:0 | |
#4 0x00002ace8572b370 __restore_rt (/lib64/libpthread.so.0+0xf370) | |
#5 0x0000000001f8d278 llvm::Value::getSubclassDataFromValue() const /dev/shm/parallel-ir/include/llvm/IR/Value.h:655:0 | |
#6 0x00000000020725ca llvm::Function::hasLazyArguments() const /dev/shm/parallel-ir/include/llvm/IR/Function.h:103:0 | |
#7 0x00000000020725f0 llvm::Function::CheckLazyArguments() const /dev/shm/parallel-ir/include/llvm/IR/Function.h:108:0 | |
#8 0x00000000023b5dd0 llvm::Function::arg_end() /dev/shm/parallel-ir/include/llvm/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 <qthread.h> | |
#include <qthread/sinc.h> | |
volatile int j = 0; | |
aligned_t task(void* arg){ | |
j ++; | |
} | |
int main(){ |
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
Sometimes it would be nice if a type system could automatically "do it's best" | |
to restrict what a value will be. For example, the type `Bool` is the compiler | |
saying the value will either be `True` or `False`, but it doesn't know which. | |
What we want is the compiler to be able to be precise when possible, so instead | |
of always saying `Bool` (or "I don't know"), it could say `True`, `False`, or | |
`Bool`. This gist shows how Hindley Milner already has this capability that can | |
be exercised by using Church or Scott encodings of simple data types. | |
> {-# LANGUAGE RankNTypes #-} | |
> import qualified Data.Maybe as M |
NewerOlder