Skip to content

Commit

Permalink
KMC 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marekkokot committed Jan 29, 2017
1 parent 1bd9abd commit f5fbff6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 43 deletions.
30 changes: 5 additions & 25 deletions kmer_counter/kmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -1016,37 +1016,17 @@ template <typename KMER_T, unsigned SIZE, bool QUAKE_MODE> bool CKMC<KMER_T, SIZ
save_bins_stats(Queues, Params, sizeof(KMER_T), KMER_T::QUALITY_SIZE, n_reads, Params.signature_len, Queues.s_mapper->GetMapSize(), Queues.s_mapper->GetMap());
#endif

SortFunction<KMER_T> sort_func;
SortFunction<KMER_T> sort_func;
#ifdef __APPLE__
sort_func = RadixSort::RadixSortMSD<KMER_T, SIZE>;
CSmallSort<SIZE>::Adjust(384);
#else
int iset = instrset_detect();
auto proc_name = CCpuInfo::GetBrand();
bool is_intel = CCpuInfo::GetVendor() == "GenuineIntel";
bool at_least_avx = iset >= 7;
std::transform(proc_name.begin(), proc_name.end(), proc_name.begin(), ::tolower);
bool is_xeon = proc_name.find("xeon") != string::npos;
//#define PRINT_PROC_INFO
#ifdef PRINT_PROC_INFO
if (is_xeon || (is_intel && at_least_avx))
{
if (is_xeon)
cout << "Xeon detected\n";
else
cout << "Some intel with at least avx\n";

if (iset >= 8)
sort_func = RadulsSort::RadixSortMSD_AVX2<KMER_T>, cout << "using avx2 version of RADULS\n";
else if (iset >= 7)
sort_func = RadulsSort::RadixSortMSD_AVX<KMER_T>, cout << "using avx version of RADULS\n";
else if (iset >= 5)
sort_func = RadulsSort::RadixSortMSD_SSE41<KMER_T>, cout << "using sse4.1 version of RADULS\n";
else if (iset >= 2)
sort_func = RadulsSort::RadixSortMSD_SSE2<KMER_T>, cout << "using sse2 version of RADULS\n";
}
else
{
sort_func = RadixSort::RadixSortMSD<KMER_T, SIZE>, cout << "using KMC3 radix instead of RADULS\n";
CSmallSort<SIZE>::Adjust(384);
}
#else
if (is_xeon || (is_intel && at_least_avx))
{
if (iset >= 8)
Expand Down
22 changes: 4 additions & 18 deletions makefile_mac
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ $(KMC_MAIN_DIR)/kb_storer.o \
$(KMC_MAIN_DIR)/kmer.o \
$(KMC_MAIN_DIR)/prob_qual.o

RADULS_OBJS = \
$(KMC_MAIN_DIR)/raduls_sse2.o \
$(KMC_MAIN_DIR)/raduls_sse41.o \
$(KMC_MAIN_DIR)/raduls_avx2.o \
$(KMC_MAIN_DIR)/raduls_avx.o

KMC_LIBS = \
$(KMC_MAIN_DIR)/libs/libz.1.2.5.dylib \
$(KMC_MAIN_DIR)/libs/libbz2.1.0.5.dylib
Expand Down Expand Up @@ -81,18 +77,8 @@ $(KMC_OBJS) $(KMC_DUMP_OBJS) $(KMC_API_OBJS): %.o: %.cpp
$(KMC_TOOLS_OBJS): %.o: %.cpp
$(CC) $(KMC_TOOLS_CFLAGS) -c $< -o $@

$(KMC_MAIN_DIR)/raduls_sse2.o: $(KMC_MAIN_DIR)/raduls_sse2.cpp
$(CC) $(CFLAGS) -msse2 -c $< -o $@
$(KMC_MAIN_DIR)/raduls_sse41.o: $(KMC_MAIN_DIR)/raduls_sse41.cpp
$(CC) $(CFLAGS) -msse4.1 -c $< -o $@
$(KMC_MAIN_DIR)/raduls_avx.o: $(KMC_MAIN_DIR)/raduls_avx.cpp
$(CC) $(CFLAGS) -mavx -fabi-version=0 -c $< -o $@
$(KMC_MAIN_DIR)/raduls_avx2.o: $(KMC_MAIN_DIR)/raduls_avx2.cpp
$(CC) $(CFLAGS) -mavx2 -mfma -fabi-version=0 -c $< -o $@
$(KMC_MAIN_DIR)/instrset_detect.o: $(KMC_MAIN_DIR)/libs/vectorclass/instrset_detect.cpp
$(CC) $(CFLAGS) -c $< -o $@

kmc: $(KMC_OBJS) $(RADULS_OBJS) $(KMC_MAIN_DIR)/instrset_detect.o

kmc: $(KMC_OBJS)
-mkdir -p $(KMC_BIN_DIR)
$(CC) $(CLINK) -o $(KMC_BIN_DIR)/$@ $^ $(KMC_LIBS)
kmc_dump: $(KMC_DUMP_OBJS) $(KMC_API_OBJS)
Expand All @@ -109,4 +95,4 @@ clean:
-rm $(KMC_TOOLS_DIR)/*.o
-rm -rf bin

all: kmc kmc_dump kmc_tools
all: kmc kmc_dump kmc_tools

0 comments on commit f5fbff6

Please sign in to comment.