Skip to content
Permalink
Browse files

try to fix glas

  • Loading branch information...
9il committed Jun 9, 2018
1 parent 57677ab commit fd9adb0750c23db4c3948f79b63384b8082f3601
@@ -18,10 +18,10 @@ branches:
install:
- if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi
script:
- cd examples/ && dub --single --build=release gemm_example.d && cd ../
- cd examples/ && dub --single --build=release hemm_example.d && cd ../
- cd bench/ && dub --single --build=release gemm_report.d && cd ../
- bash -e test.sh
- dub --build=release --root examples/gemm
- dub --build=release --root examples/hemm
# - cd bench/ && dub --single --build=release gemm_report.d && cd ../
# - bash -e test.sh

notifications:
email:

This file was deleted.

Oops, something went wrong.
@@ -14,7 +14,10 @@
"dflags-ldc": ["-betterC", "-linkonce-templates", "-enable-cross-module-inlining"]
},
},
"dependencies": {"mir-algorithm" : ">=0.6.9 <0.9.0"},
"dependencies": {
"mir-algorithm" : ">=0.9.0 <2.0.0",
"mir-cpuid": ">=0.5.3"
},
"configurations": [
{
"name": "auto-native",
@@ -0,0 +1,14 @@
.dub
docs.json
__dummy.html
docs/
gemm.so
gemm.dylib
gemm.dll
gemm.a
gemm.lib
gemm-test-*
*.exe
*.o
*.obj
*.lst
@@ -0,0 +1,13 @@
{
"name": "gemm",
"targetType": "executable",
"lflags": [
"-L$MIR_GLAS_PACKAGE_DIR",
"-L$MIR_CPUID_PACKAGE_DIR"],
"dependencies": {
"mir-glas": {
"path": "../../"
},
"mir-algorithm": ">=1.0.1"
}
}
@@ -1,5 +1,5 @@
// gcc -std=c99 -I../include -c gemm_example.c -o gemm_example.o
// gcc gemm_example.o -L../ -lmir-glas -lmir-cpuid -o gemm_example
// gcc -std=c99 -I../../include -c gemm_example.c -o gemm_example.o
// gcc gemm_example.o -L../../ -lmir-glas -lmir-cpuid -o gemm_example
// ./gemm_example
#include <stdio.h>
#include <string.h>
@@ -1,16 +1,3 @@
#!/usr/bin/env dub
/+ dub.json:
{
"name": "gemm_example",
"targetType":"executable",
"lflags": ["-L$MIR_GLAS_PACKAGE_DIR", "-L$MIR_CPUID_PACKAGE_DIR", "-L.."],
"dependencies": {
"mir-glas":{ "path": "../" },
"mir-cpuid": "~>0.5.2",
"mir-algorithm": "~>0.6.21"
}
}
+/
import glas.ndslice;
import mir.ndslice;

@@ -0,0 +1,14 @@
.dub
docs.json
__dummy.html
docs/
hemm.so
hemm.dylib
hemm.dll
hemm.a
hemm.lib
hemm-test-*
*.exe
*.o
*.obj
*.lst
@@ -0,0 +1,13 @@
{
"name": "hemm",
"targetType": "executable",
"lflags": [
"-L$MIR_GLAS_PACKAGE_DIR",
"-L$MIR_CPUID_PACKAGE_DIR"],
"dependencies": {
"mir-glas": {
"path": "../../"
},
"mir-algorithm": ">=1.0.1"
}
}
@@ -1,5 +1,5 @@
// gcc -std=c99 -I../include -c hemm_example.c -o hemm_example.o
// gcc hemm_example.o -L../ -lmir-glas -lmir-cpuid -o hemm_example
// gcc -std=c99 -I../../include -c hemm_example.c -o hemm_example.o
// gcc hemm_example.o -L../../ -lmir-glas -lmir-cpuid -o hemm_example
// ./hemm_example
#include <complex.h>
#include <stdio.h>
@@ -1,18 +1,5 @@
#!/usr/bin/env dub
/+ dub.json:
{
"name": "hemm_example",
"targetType":"executable",
"lflags": ["-L$MIR_GLAS_PACKAGE_DIR", "-L$MIR_CPUID_PACKAGE_DIR", "-L.."],
"dependencies": {
"mir-glas":{ "path": "../" },
"mir-cpuid": "~>0.5.2",
"mir-algorithm": "~>0.6.21"
}
}
+/
import mir.ndslice;
import glas.ndslice;
import mir.ndslice;

alias T = cdouble;

@@ -130,20 +130,20 @@ mixin template SSE2()

alias FPU = M8;

version(LDC_LLVM_400)
version(LDC_LLVM_300)
{
enum six = 6;
}
else
{
pragma(msg, "PERFORMANCE NOTE:
=======================================================================
LLVM 4.0 has a bug in register renaming.
LLVM >=4.0 has a bug in register renaming.
Computation kernels are not optimal!
For more details see issue https://github.com/libmir/mir-glas/issues/18
=======================================================================");
enum six = 5;
}
else
{
enum six = 6;
}

mixin template AVX512_S()
{
@@ -60,15 +60,9 @@ q{
int } ~ prefix!Type ~ q{gemm_(
ref const char transa,
ref const char transb,
ref const

FortranInt m,
ref const

FortranInt n,
ref const

FortranInt k,
ref const FortranInt m,
ref const FortranInt n,
ref const FortranInt k,
ref const T alpha,
const(T)* a,
ref const FortranInt lda,
@@ -130,20 +124,16 @@ q{
glas.ndslice.gemm(alpha, asl, bsl, beta, csl, settings);
return 0;
}
enum name = prefix!T.upper ~ "GEMM ";
enum name = prefix!T[0].toUpper ~ "GEMM ";
xerbla_(name.ptr, info);
return 0;
}

int } ~ prefix!Type ~ q{symm_(
ref const char side,
ref const char uplo,
ref const

FortranInt m,
ref const

FortranInt n,
ref const FortranInt m,
ref const FortranInt n,
ref const T alpha,
const(T)* a,
ref const FortranInt lda,
@@ -161,12 +151,8 @@ q{
int } ~ prefix!Type ~ q{hemm_(
ref const char side,
ref const char uplo,
ref const

FortranInt m,
ref const

FortranInt n,
ref const FortranInt m,
ref const FortranInt n,
ref const T alpha,
const(T)* a,
ref const FortranInt lda,
@@ -193,9 +179,9 @@ auto _matrix(T)(size_t[2] lengths, sizediff_t[2] strides, T* ptr)
}

pragma(inline, true)
package(glas) auto toUpper()(dchar c)
package(glas) auto toUpper()(char c)
{
return dchar(c & 0b1101_1111);
return char(c & 0b1101_1111);
}

pragma(inline, true)
@@ -271,8 +257,8 @@ package(glas) int symm_impl_(T)(
glas.ndslice.symm(alpha, asl, bsl, beta, csl, settings);
return 0;
}
enum nameSYMM = prefix!T.upper ~ "SYMM ";
enum nameHEMM = prefix!T.upper ~ "HEMM ";
enum nameSYMM = prefix!T[0].toUpper ~ "SYMM ";
enum nameHEMM = prefix!T[0].toUpper ~ "HEMM ";
xerbla_(conj ? nameHEMM.ptr : nameSYMM.ptr, info);
return 0;
}
Oops, something went wrong.

0 comments on commit fd9adb0

Please sign in to comment.
You can’t perform that action at this time.