Skip to content

Commit

Permalink
Fixing Mojave Build (unitaryfund#129)
Browse files Browse the repository at this point in the history
* Fixing function overload warning

* Builds on Mojave (tested)

* Removing and gitignore-ing .DS_Store
  • Loading branch information
WrathfulSpatula authored Jan 19, 2019
1 parent f13483f commit 0191f86
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/doc/*
.DS_Store
*.o
*.a
qregistercl.hpp
Expand Down
4 changes: 4 additions & 0 deletions include/bitbuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ struct BitBuffer {
{
// Intentionally left blank.
}

virtual ~BitBuffer() {
// Intentionally left blank.
}

virtual void Apply(QInterfacePtr qReg, const bitLenInt& qubitIndex, std::vector<BitBufferPtr>* bitBuffers) = 0;

Expand Down
1 change: 1 addition & 0 deletions include/common/oclengine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <mutex>

#ifdef __APPLE__
#define CL_SILENCE_DEPRECATION
#include <OpenCL/cl.hpp>
#else
#include <CL/cl.hpp>
Expand Down
1 change: 1 addition & 0 deletions include/qengine_opencl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class QEngineOCL : public QEngine {
using QEngine::Swap;
virtual void Swap(bitLenInt start1, bitLenInt start2, bitLenInt length);

using QEngine::Compose;
virtual bitLenInt Compose(QEngineOCLPtr toCopy);
virtual bitLenInt Compose(QInterfacePtr toCopy) { return Compose(std::dynamic_pointer_cast<QEngineOCL>(toCopy)); }
virtual bitLenInt Compose(QEngineOCLPtr toCopy, bitLenInt start);
Expand Down
2 changes: 1 addition & 1 deletion include/qunitmulti.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct QEngineInfo {
// Intentionally left blank
}

bool operator<(const QEngineInfo& other)
bool operator<(const QEngineInfo& other) const
{
if (size == other.size) {
return deviceID < other.deviceID;
Expand Down
4 changes: 2 additions & 2 deletions src/qengine/opencl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void QEngineOCL::SetDevice(const int& dID, const bool& forceReInit)

if (!didInit) {
#ifdef __APPLE__
posix_memalign(&nrmArray, ALIGN_SIZE, nrmVecAlignSize);
posix_memalign((void**)&nrmArray, ALIGN_SIZE, nrmVecAlignSize);
#else
nrmArray = (real1*)aligned_alloc(ALIGN_SIZE, nrmVecAlignSize);
#endif
Expand All @@ -323,7 +323,7 @@ void QEngineOCL::SetDevice(const int& dID, const bool& forceReInit)
free(nrmArray);
nrmArray = NULL;
#ifdef __APPLE__
posix_memalign(&nrmArray, ALIGN_SIZE, nrmVecAlignSize);
posix_memalign((void**)&nrmArray, ALIGN_SIZE, nrmVecAlignSize);
#else
nrmArray = (real1*)aligned_alloc(ALIGN_SIZE, nrmVecAlignSize);
#endif
Expand Down
2 changes: 1 addition & 1 deletion test/tests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class ProbPattern : public Catch::MatcherBase<Qrack::QInterfacePtr> {
return true;
}

virtual std::string describe() const
virtual std::string describe() const override
{
std::ostringstream ss;
ss << "matches bit pattern [" << (int)start << "," << start + length << "]: " << (int)length << "/";
Expand Down

0 comments on commit 0191f86

Please sign in to comment.