Browse Source

change filter array initializaion for msvc compiler.

test-kernel
MMT 5 years ago
parent
commit
2d5baef77d
  1. 6
      KernelTester.pro
  2. 2
      main.cpp
  3. 4
      source/FileHelper.cpp
  4. 3
      source/model/processor/strategies/Enhance.cpp

6
KernelTester.pro

@ -23,6 +23,7 @@ LIBS+= -L"$$PWD/header/CL" -lOpenCL
INCLUDEPATH += "$$PWD/header"
HEADERS += $$files(header/*.h, true) \
MainWindow.h \
header/CL/cl.h \
@ -41,6 +42,11 @@ HEADERS += $$files(header/*.h, true) \
header/CL/cl2.hpp \
header/CL/opencl.h \
win32:INCLUDEPATH += D:\\OpenCL\\kernel_tester\\header\\
else:unix: INCLUDEPATH += /home/hasis/Downloads/Compressed/matio-1.5.17/src/
FORMS += \
MainWindow.ui

2
main.cpp

@ -2,7 +2,7 @@
#include <QApplication>
#include "matio.h"
//#include "matio.h"
int main(int argc, char *argv[])

4
source/FileHelper.cpp

@ -136,6 +136,8 @@ bool FileHelper::WriteOutputFile(char* arr, QString path, quint64 width, quint64
str += "\n";
file.write(str.toLocal8Bit());
}
return true;
}
bool FileHelper::WriteOutputFile(myflt* arr, QString path, quint64 width, quint64 height)
@ -156,4 +158,6 @@ bool FileHelper::WriteOutputFile(myflt* arr, QString path, quint64 width, quint6
str += "\n";
file.write(str.toLocal8Bit());
}
return true;
}

3
source/model/processor/strategies/Enhance.cpp

@ -100,7 +100,7 @@ void Enhance::cpuProcess(ScenGenOutput_t parameters)
if(_run)
{
auto filterSize = _kernelParameters.filterWidth * _kernelParameters.filterHeight;
float filter[filterSize];
auto filter = new float[filterSize];
for(int i = 0; i < filterSize ; i++)
{
filter[i] = backgroundRecovery[i] - hpf[i];
@ -116,6 +116,7 @@ void Enhance::cpuProcess(ScenGenOutput_t parameters)
BIP::getInstance()->CLQueue.enqueueWriteBuffer(*_filter, CL_TRUE,
0, filterSize * sizeof (float),
filter);
delete[] filter;
}
}
}

Loading…
Cancel
Save