Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ endif(COMPILATION_ARCH MATCHES "OFF")

if(ENABLE_AVX2 MATCHES "OFF")
message("Disabling AVX2 instructions")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mno-avx2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-avx2")
# Only add -mno-avx2 for GCC or for Intel architectures where it's meaningful
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
(NOT APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64"))
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mno-avx2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-avx2")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
# For clang on x86_64, use -mno-avx2 but suppress the warning if it's unused
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument -mno-avx2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -mno-avx2")
endif()
endif(ENABLE_AVX2 MATCHES "OFF")

# Manages build types
Expand Down
4 changes: 2 additions & 2 deletions src/Bifrost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ bool check_ProgramOptions(CCDBG_Build_opt& opt) {
}
}

v_files = move(files_tmp);
v_files = std::move(files_tmp);

delete[] buffer;
};
Expand Down Expand Up @@ -672,7 +672,7 @@ int main(int argc, char **argv){
ColoredCDBG<>& ccdbg_a = (ccdbg1_len > ccdbg2_len) ? ccdbg1 : ccdbg2;
ColoredCDBG<>& ccdbg_b = (ccdbg1_len > ccdbg2_len) ? ccdbg2 : ccdbg1;

if (success) success = ccdbg_a.merge(move(ccdbg_b), lopt.nb_threads, lopt.verbose);
if (success) success = ccdbg_a.merge(std::move(ccdbg_b), lopt.nb_threads, lopt.verbose);

if (success) success = ccdbg_a.simplify(lopt.deleteIsolated, lopt.clipTips, lopt.verbose);
if (success) success = ccdbg_a.write(lopt.prefixFilenameOut, lopt.nb_threads, lopt.writeIndexFile, lopt.compressOutput, lopt.verbose);
Expand Down
10 changes: 6 additions & 4 deletions src/BitContainer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "BitContainer.hpp"

using namespace std;

BitContainer::BitContainer() : setBits(localBitVector) {}

BitContainer::BitContainer(const BitContainer& o) {
Expand Down Expand Up @@ -580,7 +582,7 @@ void BitContainer::remove(const size_t pair_id) {

setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;

*this = move(new_uc);
*this = std::move(new_uc);
}
else setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;
}
Expand Down Expand Up @@ -630,7 +632,7 @@ void BitContainer::remove(const size_t pair_id) {

for (; it != it_end; ++it) new_uc.add(*it);

*this = move(new_uc);
*this = std::move(new_uc);
}
else if ((setBits & flagMask) == ptrBitmap) bitmap->r.runOptimize();
}
Expand Down Expand Up @@ -704,7 +706,7 @@ void BitContainer::removeSortedVector(const vector<uint32_t>& v) {

setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;

*this = move(new_uc);
*this = std::move(new_uc);
}
else setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;
}
Expand Down Expand Up @@ -752,7 +754,7 @@ void BitContainer::removeSortedVector(const vector<uint32_t>& v) {

for (const_iterator it = begin(), it_end = end(); it != it_end; ++it) new_uc.add(*it);

*this = move(new_uc);
*this = std::move(new_uc);
}
else if ((setBits & flagMask) == ptrBitmap) bitmap->r.runOptimize();
}
Expand Down
8 changes: 4 additions & 4 deletions src/BitContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ class BitContainer {
size_t size() const;
inline size_t cardinality() const { return size(); }

bool write(ostream& stream_out) const;
bool read(istream& stream_in);
bool write(std::ostream& stream_out) const;
bool read(std::istream& stream_in);

size_t getSizeInBytes() const;

Expand All @@ -130,8 +130,8 @@ class BitContainer {

private:

void addSortedVector(const vector<uint32_t>& v);
void removeSortedVector(const vector<uint32_t>& v);
void addSortedVector(const std::vector<uint32_t>& v);
void removeSortedVector(const std::vector<uint32_t>& v);

inline void releaseMemory(){

Expand Down
18 changes: 9 additions & 9 deletions src/BlockedBloomFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BlockedBloomFilter::BlockedBloomFilter(const BlockedBloomFilter& o) : table_(n
}

BlockedBloomFilter::BlockedBloomFilter(BlockedBloomFilter&& o) : table_(o.table_), blocks_(o.blocks_), nb_bits_per_elem(o.nb_bits_per_elem),
k_(o.k_), M_u64(o.M_u64), seed1(o.seed1), seed2(o.seed2), ush(move(o.ush)) {
k_(o.k_), M_u64(o.M_u64), seed1(o.seed1), seed2(o.seed2), ush(std::move(o.ush)) {

o.table_ = nullptr;

Expand Down Expand Up @@ -80,7 +80,7 @@ BlockedBloomFilter& BlockedBloomFilter::operator=(BlockedBloomFilter&& o) {
seed1 = o.seed1;
seed2 = o.seed2;

ush = move(o.ush);
ush = std::move(o.ush);

o.table_ = nullptr;

Expand Down Expand Up @@ -160,7 +160,7 @@ DualBlockedBloomFilter BlockedBloomFilter::transferToDBBF(const uint64_t idx_bbf
dbbf.seed1 = seed1;
dbbf.seed2 = seed2;

dbbf.ush[idx_bbf_norm] = move(ush);
dbbf.ush[idx_bbf_norm] = std::move(ush);
dbbf.table_ = new DualBlockedBloomFilter::BBF_Block[blocks_ << 1];

for (size_t i = 0; i < blocks_; ++i) {
Expand Down Expand Up @@ -622,7 +622,7 @@ DualBlockedBloomFilter::DualBlockedBloomFilter(const DualBlockedBloomFilter& o)
}

DualBlockedBloomFilter::DualBlockedBloomFilter(DualBlockedBloomFilter&& o) : table_(o.table_), blocks_(o.blocks_), nb_bits_per_elem(o.nb_bits_per_elem),
k_(o.k_), M_u64(o.M_u64), seed1(o.seed1), seed2(o.seed2), ush{move(o.ush[0]), move(o.ush[1])} {
k_(o.k_), M_u64(o.M_u64), seed1(o.seed1), seed2(o.seed2), ush{std::move(o.ush[0]), std::move(o.ush[1])} {

o.table_ = nullptr;

Expand All @@ -645,8 +645,8 @@ DualBlockedBloomFilter& DualBlockedBloomFilter::operator=(const DualBlockedBloom
seed1 = o.seed1;
seed2 = o.seed2;

ush[0] = o.ush[0];
ush[1] = o.ush[1];
ush[0] = std::move(o.ush[0]);
ush[1] = std::move(o.ush[1]);

if (blocks_ != 0) {

Expand Down Expand Up @@ -677,8 +677,8 @@ DualBlockedBloomFilter& DualBlockedBloomFilter::operator=(DualBlockedBloomFilter
seed1 = o.seed1;
seed2 = o.seed2;

ush[0] = move(o.ush[0]);
ush[1] = move(o.ush[1]);
ush[0] = std::move(o.ush[0]);
ush[1] = std::move(o.ush[1]);

o.table_ = nullptr;

Expand Down Expand Up @@ -927,7 +927,7 @@ BlockedBloomFilter DualBlockedBloomFilter::transferToBBF(const uint64_t idx_bbf)
bbf.seed2 = seed2;
bbf.M_u64 = M_u64;

bbf.ush = move(ush[idx_bbf_norm]);
bbf.ush = std::move(ush[idx_bbf_norm]);
bbf.table_ = new BlockedBloomFilter::BBF_Block[blocks_];

for (size_t i = 0; i < blocks_; ++i) {
Expand Down
14 changes: 8 additions & 6 deletions src/ColorSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "ColorSet.hpp"

using namespace std;

UnitigColors::UnitigColors() : setBits(localBitVector) {}

UnitigColors::UnitigColors(const UnitigColors& o) {
Expand Down Expand Up @@ -721,7 +723,7 @@ void UnitigColors::remove(const UnitigMapBase& um, const size_t color_id) {

setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;

*this = move(new_uc);
*this = std::move(new_uc);
}
else setBits = (reinterpret_cast<uintptr_t>(t_bmp.detach()) & pointerMask) | localTinyBitmap;
}
Expand Down Expand Up @@ -771,7 +773,7 @@ void UnitigColors::remove(const UnitigMapBase& um, const size_t color_id) {

for (; it != it_end; ++it) new_uc.add(it.getColorID() * um_km_sz + it.getKmerPosition());

*this = move(new_uc);
*this = std::move(new_uc);
}
else if ((setBits & flagMask) == ptrBitmap) bitmap->r.runOptimize();
}
Expand Down Expand Up @@ -1097,8 +1099,8 @@ bool UnitigColors::optimizeFullColors(const UnitigMapBase& um){

UnitigColors* uc = new UnitigColors[2];

uc[0] = move(full_uc);
uc[1] = move(non_full_uc);
uc[0] = std::move(full_uc);
uc[1] = std::move(non_full_uc);

setBits = (reinterpret_cast<uintptr_t>(uc) & pointerMask) | ptrUnitigColors;

Expand All @@ -1121,8 +1123,8 @@ UnitigColors UnitigColors::makeFullColors(const UnitigMapBase& um) const {

UnitigColors* uc = new UnitigColors[2];

uc[0] = move(full_uc);
uc[1] = move(non_full_uc);
uc[0] = std::move(full_uc);
uc[1] = std::move(non_full_uc);

new_uc.setBits = (reinterpret_cast<uintptr_t>(uc) & pointerMask) | ptrUnitigColors;

Expand Down
12 changes: 6 additions & 6 deletions src/ColorSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class UnitigColors {

public:

typedef pair<UnitigColors, size_t> SharedUnitigColors;
typedef std::pair<UnitigColors, size_t> SharedUnitigColors;

/** @class UnitigColors_const_iterator
* @brief See UnitigColors::const_iterator
*/
class UnitigColors_const_iterator : public std::iterator<std::forward_iterator_tag, pair<size_t, size_t>> {
class UnitigColors_const_iterator : public std::iterator<std::forward_iterator_tag, std::pair<size_t, size_t>> {

friend class UnitigColors;

Expand Down Expand Up @@ -70,9 +70,9 @@ class UnitigColors {
* @return a pair p of integers representing the position of a k-mer in the unitig (p.first)
* and the ID of the color associated with the k-mer at the given position (p.second).
*/
inline pair<size_t, size_t> operator*() const {
inline std::pair<size_t, size_t> operator*() const {

return make_pair(ck_id % um_sz, ck_id / um_sz);
return std::make_pair(ck_id % um_sz, ck_id / um_sz);
}

/**
Expand Down Expand Up @@ -281,15 +281,15 @@ class UnitigColors {
* opened prior to the call of this function and it won't be closed by this function.
* @return a boolean indicating if the write was successful.
*/
bool write(ostream& stream_out, const bool copy_UnitigColors = true) const;
bool write(std::ostream& stream_out, const bool copy_UnitigColors = true) const;

/**
* Read a UnitigColors from a stream.
* @param stream_in is an in stream from which the UnitigColors must be read. It must be
* opened prior to the call of this function and it won't be closed by this function.
* @return a boolean indicating if the write was successful.
*/
bool read(istream& stream_in);
bool read(std::istream& stream_in);

/**
* Size of the UnitigColors in bytes.
Expand Down
Loading