Commit 10cdc3fc authored by Santiago Marco-Sola's avatar Santiago Marco-Sola
Browse files

Removed unused AVX code

parent b34bb43b
...@@ -37,7 +37,7 @@ BWAMEM2_PATH=./bwa-mem2 ...@@ -37,7 +37,7 @@ BWAMEM2_PATH=./bwa-mem2
CXXFLAGS=-std=c++11 -fopenmp CXXFLAGS=-std=c++11 -fopenmp
CPPFLAGS=-DENABLE_PREFETCH -DBWA_OTHER_ELE=0 CPPFLAGS=-DENABLE_PREFETCH -DBWA_OTHER_ELE=0
INCLUDES=-I$(BWAMEM2_PATH)/src -I$(BWAMEM2_PATH)/ext/safestringlib/include INCLUDES=-I$(BWAMEM2_PATH)/src -I$(BWAMEM2_PATH)/ext/safestringlib/include -I/usr/include/
LIBS=-L$(BWAMEM2_PATH) -L$(BWAMEM2_PATH)/ext/safestringlib -lsafestring -fopenmp -lz -lbwa -ldl LIBS=-L$(BWAMEM2_PATH) -L$(BWAMEM2_PATH)/ext/safestringlib -lsafestring -fopenmp -lz -lbwa -ldl
.PHONY:all clean depend .PHONY:all clean depend
......
...@@ -35,7 +35,7 @@ EXE=bwa-mem2 ...@@ -35,7 +35,7 @@ EXE=bwa-mem2
MEM_FLAGS=-DSAIS=1 MEM_FLAGS=-DSAIS=1
CPPFLAGS+=-DENABLE_PREFETCH -DV17=1 $(MEM_FLAGS) CPPFLAGS+=-DENABLE_PREFETCH -DV17=1 $(MEM_FLAGS)
INCLUDES=-Isrc -I./ext/safestringlib/include INCLUDES=-Isrc -I./ext/safestringlib/include -I/usr/include/
LIBS=-lpthread -lm -lz -L. -lbwa -L./ext/safestringlib -lsafestring LIBS=-lpthread -lm -lz -L. -lbwa -L./ext/safestringlib -lsafestring
OBJS=src/fastmap.o src/bwtindex.o src/utils.o src/memcpy_bwamem.o src/kthread.o \ OBJS=src/fastmap.o src/bwtindex.o src/utils.o src/memcpy_bwamem.o src/kthread.o \
src/kstring.o src/ksw.o src/bntseq.o src/bwamem.o src/profiling.o \ src/kstring.o src/ksw.o src/bntseq.o src/bwamem.o src/profiling.o \
......
...@@ -5,7 +5,7 @@ CXX=$(EPI_TOOLCHAIN)/bin/clang++ ...@@ -5,7 +5,7 @@ CXX=$(EPI_TOOLCHAIN)/bin/clang++
IDIR = include IDIR = include
MKDIR_P = mkdir -p MKDIR_P = mkdir -p
CFLAGS=-I$(IDIR) -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security CFLAGS=-I$(IDIR) -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
LDFLAGS=-z noexecstack -z relo -z now #LDFLAGS=-z noexecstack -z relo -z now
ODIR=obj ODIR=obj
OTDIR=objtest OTDIR=objtest
......
...@@ -41,6 +41,14 @@ extern "C" { ...@@ -41,6 +41,14 @@ extern "C" {
} }
#endif #endif
/*
* Compatibility MACROS
*/
#define _mm_malloc(size,align) malloc(size)
#define _mm_free(addr) free(addr)
#define __rdtsc() clock()
#define _mm_prefetch(addr,mode) __builtin_prefetch(addr)
FMI_search::FMI_search(const char *fname) FMI_search::FMI_search(const char *fname)
{ {
fprintf(stderr, "* Entering FMI_search\n"); fprintf(stderr, "* Entering FMI_search\n");
......
This diff is collapsed.
...@@ -32,6 +32,14 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i ...@@ -32,6 +32,14 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i
#include "FMI_search.h" #include "FMI_search.h"
#include "memcpy_bwamem.h" #include "memcpy_bwamem.h"
/*
* Compatibility MACROS
*/
#define _mm_malloc(size,align) malloc(size)
#define _mm_free(addr) free(addr)
#define __rdtsc() clock()
#define _mm_prefetch(addr,mode) __builtin_prefetch(addr)
//---------------- //----------------
extern uint64_t tprof[LIM_R][LIM_C]; extern uint64_t tprof[LIM_R][LIM_C];
//---------------- //----------------
...@@ -1946,15 +1954,7 @@ inline void sortPairsLen(SeqPair *pairArray, int32_t count, SeqPair *tempArray, ...@@ -1946,15 +1954,7 @@ inline void sortPairsLen(SeqPair *pairArray, int32_t count, SeqPair *tempArray,
{ {
int32_t i; int32_t i;
#if ((!__AVX512BW__) & (__AVX2__ | __SSE2__))
for(i = 0; i <= MAX_SEQ_LEN16; i++) hist[i] = 0; for(i = 0; i <= MAX_SEQ_LEN16; i++) hist[i] = 0;
#else
__m512i zero512 = _mm512_setzero_si512();
for(i = 0; i <= MAX_SEQ_LEN16; i+=16)
{
_mm512_store_si512((__m512i *)(hist + i), zero512);
}
#endif
for(i = 0; i < count; i++) for(i = 0; i < count; i++)
{ {
......
...@@ -41,11 +41,12 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i ...@@ -41,11 +41,12 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i
#include "bandedSWA.h" #include "bandedSWA.h"
#include "kswv.h" #include "kswv.h"
#define __rdtsc() clock()
#ifdef USE_MALLOC_WRAPPERS #ifdef USE_MALLOC_WRAPPERS
# include "malloc_wrap.h" # include "malloc_wrap.h"
#endif #endif
#define MIN_RATIO 0.8 #define MIN_RATIO 0.8
#define MIN_DIR_CNT 10 #define MIN_DIR_CNT 10
#define MIN_DIR_RATIO 0.05 #define MIN_DIR_RATIO 0.05
......
...@@ -32,9 +32,6 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i ...@@ -32,9 +32,6 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#if NUMA_ENABLED
#include <numa.h>
#endif
#include <sstream> #include <sstream>
#include "fastmap.h" #include "fastmap.h"
#include "FMI_search.h" #include "FMI_search.h"
...@@ -44,21 +41,18 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i ...@@ -44,21 +41,18 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i
int affy[256]; int affy[256];
#endif #endif
/*
* Compatibility MACROS
*/
#define _mm_malloc(size,align) malloc(size)
#define _mm_free(addr) free(addr)
#define __rdtsc() clock()
// -------------- // --------------
extern uint64_t tprof[LIM_R][LIM_C]; extern uint64_t tprof[LIM_R][LIM_C];
// --------------- // ---------------
void __cpuid(unsigned int i, unsigned int cpuid[4]) { void __cpuid(unsigned int i, unsigned int cpuid[4]) {}
#ifdef _WIN32
__cpuid((int *) cpuid, (int)i);
#else
asm volatile
("cpuid" : "=a" (cpuid[0]), "=b" (cpuid[1]), "=c" (cpuid[2]), "=d" (cpuid[3])
: "0" (i), "2" (0));
#endif
}
int HTStatus() int HTStatus()
{ {
......
...@@ -75,7 +75,7 @@ typedef struct { ...@@ -75,7 +75,7 @@ typedef struct {
int depth; int depth;
} ks_isort_stack_t; } ks_isort_stack_t;
#define KSORT_SWAP(type_t, a, b) { register type_t t=(a); (a)=(b); (b)=t; } #define KSORT_SWAP(type_t, a, b) { type_t t=(a); (a)=(b); (b)=t; }
#define KSORT_INIT(name, type_t, __sort_lt) \ #define KSORT_INIT(name, type_t, __sort_lt) \
void ks_mergesort_##name(size_t n, type_t array[], type_t temp[]) \ void ks_mergesort_##name(size_t n, type_t array[], type_t temp[]) \
......
...@@ -128,7 +128,7 @@ kswr_t ksw_align2(int qlen, uint8_t *query, int tlen, uint8_t *target, ...@@ -128,7 +128,7 @@ kswr_t ksw_align2(int qlen, uint8_t *query, int tlen, uint8_t *target,
// q = (qry && *qry)? *qry : ksw_qinit(2, qlen, query, m, mat); //test // q = (qry && *qry)? *qry : ksw_qinit(2, qlen, query, m, mat); //test
if (qry && *qry == 0) *qry = q; if (qry && *qry == 0) *qry = q;
func = q->size == 2? ksw_i16 : ksw_u8; //func = q->size == 2? ksw_i16 : ksw_u8;
size = q->size; size = q->size;
r = func(q, tlen, target, o_del, e_del, o_ins, e_ins, xtra); r = func(q, tlen, target, o_del, e_del, o_ins, e_ins, xtra);
...@@ -163,7 +163,7 @@ kswr_t ksw_align2_orig_bak(int qlen, uint8_t *query, int tlen, uint8_t *target, ...@@ -163,7 +163,7 @@ kswr_t ksw_align2_orig_bak(int qlen, uint8_t *query, int tlen, uint8_t *target,
q = (qry && *qry)? *qry : ksw_qinit((xtra & KSW_XBYTE)? 1 : 2, qlen, query, m, mat); q = (qry && *qry)? *qry : ksw_qinit((xtra & KSW_XBYTE)? 1 : 2, qlen, query, m, mat);
if (qry && *qry == 0) *qry = q; if (qry && *qry == 0) *qry = q;
func = q->size == 2? ksw_i16 : ksw_u8; //func = q->size == 2? ksw_i16 : ksw_u8;
size = q->size; size = q->size;
// uint64_t tim = __rdtsc(); // uint64_t tim = __rdtsc();
r = func(q, tlen, target, o_del, e_del, o_ins, e_ins, xtra); r = func(q, tlen, target, o_del, e_del, o_ins, e_ins, xtra);
......
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
#include <stdint.h> #include <stdint.h>
/*
* Compatibility
*/
#define __m128i uint64_t
#define __rdtsc() clock()
#define KSW_XBYTE 0x10000 #define KSW_XBYTE 0x10000
#define KSW_XSTOP 0x20000 #define KSW_XSTOP 0x20000
#define KSW_XSUBO 0x40000 #define KSW_XSUBO 0x40000
......
This diff is collapsed.
...@@ -48,24 +48,6 @@ ...@@ -48,24 +48,6 @@
#define xassert(cond, msg) if ((cond) == 0) _err_fatal_simple_core(__func__, msg) #define xassert(cond, msg) if ((cond) == 0) _err_fatal_simple_core(__func__, msg)
#if defined(__GNUC__) && !defined(__clang__)
#if defined(__i386__)
static inline unsigned long long __rdtsc(void)
{
unsigned long long int x;
__asm__ volatile (".byte 0x0f, 0x31" : "=A" (x));
return x;
}
#elif defined(__x86_64__)
static inline unsigned long long __rdtsc(void)
{
unsigned hi, lo;
__asm__ __volatile__ ("rdtsc" : "=a"(lo), "=d"(hi));
return ( (unsigned long long)lo)|( ((unsigned long long)hi)<<32 );
}
#endif
#endif
typedef struct { typedef struct {
uint64_t x, y; uint64_t x, y;
} pair64_t; } pair64_t;
......
...@@ -38,6 +38,13 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i ...@@ -38,6 +38,13 @@ Authors: Vasimuddin Md <vasimuddin.md@intel.com>; Sanchit Misra <sanchit.misra@i
#include "bwa.h" #include "bwa.h"
#include "FMI_search.h" #include "FMI_search.h"
/*
* Compatibility MACROS
*/
#define _mm_malloc(size,align) malloc(size)
#define _mm_free(addr) free(addr)
#define __rdtsc() clock()
#ifdef ENABLE_PARSEC_HOOKS #ifdef ENABLE_PARSEC_HOOKS
#include "hooks.h" #include "hooks.h"
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment