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
| -- test of FFI vs regular lua code | |
| -- EC march 21st 2014 | |
| torch.setdefaulttensortype('torch.FloatTensor') | |
| require 'sys' | |
| require 'image' | |
| require 'torchffi' | |
| local bit = require('bit') | |
| local ffi = require('ffi') |
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
| /* | |
| Test of C code speed with Apple Accelerate Framework and openmp | |
| https://developer.apple.com/library/mac/documentation/Accelerate/Reference/BLAS_Ref/Reference/reference.html#//apple_ref/c/func/cblas_sgemm | |
| compile with: | |
| gcc -Ofast -fopenmp -flax-vector-conversions -framework Accelerate acctest.c | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <fcntl.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
| /* | |
| Test of C code speed | |
| compile with: gcc -Ofast -fopenmp -mavx mactest.c | |
| or gfortran -O3 -fopenmp mactest.c | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <fcntl.h> | |
| #include <sys/time.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
| #!/usr/bin/env torch | |
| require 'nn' | |
| require 'image' | |
| require 'xlua' | |
| require 'pl' | |
| opt = lapp[[ | |
| -t,--threads (default 8) number of threads | |
| -p,--type (default float) float or cuda |
NewerOlder