Browse Source

Merge pull request #2645 from martin-frbg/misc_fixes

Miscellaneous fixes
tags/v0.3.10^2
Martin Kroeker GitHub 6 years ago
parent
commit
89091e6b64
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1410 deletions
  1. +3
    -4
      common_x86_64.h
  2. +0
    -1403
      kernel/common_param.h
  3. +4
    -3
      test/compare_sgemm_shgemm.c

+ 3
- 4
common_x86_64.h View File

@@ -80,7 +80,7 @@ static void __inline blas_lock(volatile BLASULONG *address){
#endif

do {
while (*address) {YIELDING;};
while (*address) {YIELDING;}

#ifndef C_MSVC
__asm__ __volatile__(
@@ -199,9 +199,9 @@ static __inline BLASLONG blas_quickdivide(BLASLONG x, BLASLONG y){
#else
extern unsigned int blas_quick_divide_table[];

static __inline int blas_quickdivide(unsigned int x, unsigned int y){
static __inline unsigned int blas_quickdivide(unsigned int x, unsigned int y){

unsigned int result;
volatile unsigned int result;

if (y <= 1) return x;

@@ -215,7 +215,6 @@ static __inline int blas_quickdivide(unsigned int x, unsigned int y){
y = blas_quick_divide_table[y];

__asm__ __volatile__ ("mull %0" :"=d" (result), "+a"(x) : "0" (y));

return result;
}
#endif


+ 0
- 1403
kernel/common_param.h
File diff suppressed because it is too large
View File


+ 4
- 3
test/compare_sgemm_shgemm.c View File

@@ -72,12 +72,13 @@ main (int argc, char *argv[])
{
int m, n, k;
int i, j, l;
int x;
int ret = 0;
int loop = 100;
char transA = 'N', transB = 'N';
float alpha = 1.0, beta = 0.0;

for (int x = 0; x <= loop; x++)
for (x = 0; x <= loop; x++)
{
m = k = n = x;
float A[m * k];
@@ -86,9 +87,9 @@ main (int argc, char *argv[])
bfloat16_bits AA[m * k], BB[k * n];
float DD[m * n], CC[m * n];

for (int j = 0; j < m; j++)
for (j = 0; j < m; j++)
{
for (int i = 0; i < m; i++)
for (i = 0; i < m; i++)
{
A[j * k + i] = ((FLOAT) rand () / (FLOAT) RAND_MAX) + 0.5;
B[j * k + i] = ((FLOAT) rand () / (FLOAT) RAND_MAX) + 0.5;


Loading…
Cancel
Save