Giter Club home page Giter Club logo

openclipp's People

Contributors

antagna avatar jeffheifetz avatar moulay-akhloufi avatar szagoruyko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openclipp's Issues

Can't run demo on OS/X

I made the following changes in an attempt to get the demo running, but it seems to fail on kernel compilation.

Is this an issue on other platforms?

Using device : Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
Program build failed : <program source>:38:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:51:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:154:1: warning: implicit declaration of function 'convert___uchar3_sat' is invalid in C99
CONVERT_KERNEL(to_uchar,   CONCATENATE(uchar,  NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___uchar3_sat
^
<program source>:154:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_uchar,   CONCATENATE(uchar,  NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:155:1: warning: implicit declaration of function 'convert___char3_sat' is invalid in C99
CONVERT_KERNEL(to_char,    CONCATENATE(char,   NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___char3_sat
^
<program source>:155:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_char,    CONCATENATE(char,   NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:156:1: warning: implicit declaration of function 'convert___ushort3_sat' is invalid in C99
CONVERT_KERNEL(to_ushort,  CONCATENATE(ushort, NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___ushort3_sat
^
<program source>:156:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_ushort,  CONCATENATE(ushort, NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:157:1: warning: implicit declaration of function 'convert___short3_sat' is invalid in C99
CONVERT_KERNEL(to_short,   CONCATENATE(short,  NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___short3_sat
^
<program source>:157:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_short,   CONCATENATE(short,  NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:158:1: warning: implicit declaration of function 'convert___uint3_sat' is invalid in C99
CONVERT_KERNEL(to_uint,    CONCATENATE(uint,   NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___uint3_sat
^
<program source>:158:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_uint,    CONCATENATE(uint,   NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:159:1: warning: implicit declaration of function 'convert___int3_sat' is invalid in C99
CONVERT_KERNEL(to_int,     CONCATENATE(int,    NBCHAN))
^
<program source>:120:46: note: expanded from macro 'CONVERT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, CONCATENATE(dest_type, _sat)) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___int3_sat
^
<program source>:159:1: warning: unused variable 'pos'
CONVERT_KERNEL(to_int,     CONCATENATE(int,    NBCHAN))
^
<program source>:116:7: note: expanded from macro 'CONVERT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:160:1: warning: implicit declaration of function 'convert___float3' is invalid in C99
CONVERT_FLOAT_KERNEL(to_float,  CONCATENATE(float,  NBCHAN))
^
<program source>:130:46: note: expanded from macro 'CONVERT_FLOAT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, dest_type) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___float3
^
<program source>:160:1: warning: unused variable 'pos'
CONVERT_FLOAT_KERNEL(to_float,  CONCATENATE(float,  NBCHAN))
^
<program source>:126:7: note: expanded from macro 'CONVERT_FLOAT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:161:1: warning: implicit declaration of function 'convert___double3' is invalid in C99
CONVERT_FLOAT_KERNEL(to_double, CONCATENATE(double, NBCHAN))
^
<program source>:130:46: note: expanded from macro 'CONVERT_FLOAT_KERNEL'
      dest[gy * dst_step + gx] = CONCATENATE(convert_, dest_type) (src);\
                                             ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:46:40: note: expanded from macro 'CONCATENATE'
#define CONCATENATE(a, b) _CONCATENATE(a, b)
                                       ^
/Users/jeffheifetz/Coding/Bubl/BublEqui/extern/OpenCLIPP/Demo/../cl-files/Base.h:47:28: note: expanded from macro '_CONCATENATE'
#define _CONCATENATE(a, b) a ## b
                           ^
<scratch space>:13:1: note: expanded from macro 'convert_'
convert___double3
^
<program source>:161:1: warning: unused variable 'pos'
CONVERT_FLOAT_KERNEL(to_double, CONCATENATE(double, NBCHAN))
^
<program source>:126:7: note: expanded from macro 'CONVERT_FLOAT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:163:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_uchar,  CONCATENATE(uchar,  NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:164:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_char,   CONCATENATE(char,   NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:165:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_ushort, CONCATENATE(ushort, NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:166:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_short,  CONCATENATE(short,  NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:167:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_uint,   CONCATENATE(uint,   NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:168:1: warning: unused variable 'pos'
SCALE_KERNEL(scale_to_int,    CONCATENATE(int,    NBCHAN))
^
<program source>:136:7: note: expanded from macro 'SCALE_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:169:1: warning: unused variable 'pos'
SCALE_FLOAT_KERNEL(scale_to_float,  CONCATENATE(float,  NBCHAN))
^
<program source>:147:7: note: expanded from macro 'SCALE_FLOAT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:170:1: warning: unused variable 'pos'
SCALE_FLOAT_KERNEL(scale_to_double, CONCATENATE(double, NBCHAN))
^
<program source>:147:7: note: expanded from macro 'SCALE_FLOAT_KERNEL'
      BEGIN\
      ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:174:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:183:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:196:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:205:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:213:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
<program source>:232:4: warning: unused variable 'pos'
   BEGIN
   ^
<program source>:32:15: note: expanded from macro 'BEGIN'
   const int2 pos = { gx, gy };
              ^
kernel referenced external symbol 'convert___char3_sat' which could not be found.
kernel referenced external symbol 'convert___double3' which could not be found.
kernel referenced external symbol 'convert___float3' which could not be found.
kernel referenced external symbol 'convert___int3_sat' which could not be found.
kernel referenced external symbol 'convert___short3_sat' which could not be found.
kernel referenced external symbol 'convert___uchar3_sat' which could not be found.
kernel referenced external symbol 'convert___uint3_sat' which could not be found.
kernel referenced external symbol 'convert___ushort3_sat' which could not be found.
�
 - in file : ../cl-files/Convert.cl
libc++abi.dylib: terminating with uncaught exception of type cl::Error: clBuildProgram

linux build errors

os: 3.18.7-100.fc20.x86_64

Building file: programs/ImageProximityFFT.cpp
g++ -g -O3 -Wall -c -fmessage-length=0 -std=c++0x -fPIC -I../include -I../include/c++ -I/usr/include -MMD -MP -MF"build/programs/ImageProximityFFT.deps" -MT"build/programs/ImageProximityFFT.deps" -o "build/programs/ImageProximityFFT.o" "programs/ImageProximityFFT.cpp"
programs/ImageProximityFFT.cpp:277:6: error: prototype for ‘void OpenCLIPP::ImageProximityFFT::MatchSquareDiff(int, int, OpenCLIPP::Image&, float, OpenCLIPP::Image&)’ does not match any in class ‘OpenCLIPP::ImageProximityFFT’
 void ImageProximityFFT::MatchSquareDiff(int , int , Image& , float , Image& )
      ^
In file included from programs/ImageProximityFFT.cpp:29:0:
../include/c++/Programs/ImageProximityFFT.h:95:9: error: candidate is: void OpenCLIPP::ImageProximityFFT::MatchSquareDiff(int, int, OpenCLIPP::Image&, double*, OpenCLIPP::Image&)
    void MatchSquareDiff(int width, int hight, Image& Source, double * templ_sqsum, Image& Dest);
         ^
programs/ImageProximityFFT.cpp:280:6: error: prototype for ‘void OpenCLIPP::ImageProximityFFT::MatchSquareDiffNorm(int, int, OpenCLIPP::Image&, float, OpenCLIPP::Image&)’ does not match any in class ‘OpenCLIPP::ImageProximityFFT’
 void ImageProximityFFT::MatchSquareDiffNorm(int , int , Image& , float , Image& )
      ^
In file included from programs/ImageProximityFFT.cpp:29:0:
../include/c++/Programs/ImageProximityFFT.h:98:9: error: candidate is: void OpenCLIPP::ImageProximityFFT::MatchSquareDiffNorm(int, int, OpenCLIPP::Image&, double*, OpenCLIPP::Image&)
    void MatchSquareDiffNorm(int width, int hight, Image& Source, double * templ_sqsum, Image& Dest);
         ^
programs/ImageProximityFFT.cpp:283:6: error: prototype for ‘void OpenCLIPP::ImageProximityFFT::MatchCrossCorrNorm(int, int, OpenCLIPP::Image&, float, OpenCLIPP::Image&)’ does not match any in class ‘OpenCLIPP::ImageProximityFFT’
 void ImageProximityFFT::MatchCrossCorrNorm(int , int , Image& , float , Image& )
      ^
In file included from programs/ImageProximityFFT.cpp:29:0:
../include/c++/Programs/ImageProximityFFT.h:101:9: error: candidate is: void OpenCLIPP::ImageProximityFFT::MatchCrossCorrNorm(int, int, OpenCLIPP::Image&, double*, OpenCLIPP::Image&)
    void MatchCrossCorrNorm(int width, int hight, Image& Source, double * templ_sqsum, Image& Dest);
         ^
make[1]: *** [build/programs/ImageProximityFFT.o] Error 1
make[1]: Leaving directory `/opt/code/OpenCLIPP/C++'
make: *** [C++] Error 2

how to use method of blob

how to use mehtod of blob?
i can not get the correct result with it.
do u have a demo about it .

appreciate it

Test-OpenCLIPP produces unreadable image

Hi,

after some adjustment in make (include path to CL/cl.h for compiler) and source files (adjust absolute path to cl-files) I've successfully built the Test-OpenCLIPP sub-project.
I have also loaded the well-known lena.png image for test.
After running the code the code my GPU device is recognized and success is reported:
image
However the produced Result.png file includes an image which nowhere near resembles the input image.
I tried manipulating the filters and parameters with no success.
image

I also tried to just pass the SourceData to Return.png.
The result was no better.
Do you have an idea what could cause the problems?

Thanks!

Kind regards,
Yaroslav

Wrong result when step of the image is not a multiple of the vector width for vector programs

Vector programs like ArithmeticVector gain speed by doing multiple operations at the same time.

But the current implementation accesses the wrong pixel if the step of the image is not a multiple of the vector length.

Workaround : Use the Image version of the programs if you run into this problem.

Solution : It should be possible to fix this by changing the pointer arithmetic in Vector.h

Histogram Issue

When I run the four channel histogram program the first channel appears to be correct but the other three channels have values that are way too large. My code is below. Thank you for your time.
#include <OpenCLIPP.hpp>
#include "png/lodepng.h"

using namespace std;
using namespace OpenCLIPP;

uint CalculateStep(const SImage& Img);

int main(void)
{
// Load image from file
string FileName = "Skull.png";

	   SImage ImageInfo;
	   vector<unsigned char> SourceData;

	   unsigned Status = lodepng::decode(SourceData, ImageInfo.Width, ImageInfo.Height, FileName, LCT_RGBA);

	   if (Status == 0)
		{
			  // Load image from file succeded
			  ImageInfo.Channels = 4;
			  ImageInfo.Type = SImage::U8;
			  ImageInfo.Step = CalculateStep(ImageInfo);
		}
	//Initialize OpenCL
	COpenCL CL;
	CL.SetClFilesPath("/home/kathleen/Downloads/OpenCLIPP-master/cl-files/");
	

	string Name = CL.GetDeviceName();
	printf("Using device : %s\n", Name.c_str());
	
	//Create OpenCL image
	Image SourceImage(CL, ImageInfo, SourceData.data());

	SourceImage.Send(); 
	Histogram Histogram(CL);  
	//Histogram
	uint Histogramptr[1024];
	
	Histogram.Histogram1C(SourceImage,Histogramptr);
	FILE *file;
	const char* mode = "w";
	file = fopen("Results.txt",mode);
	for (int i = 0; i < 4; i++)
	{
		for(int j = 0; j < 256; j++)
		{
		 fprintf(file," %u ", Histogramptr[(i*256)+j]);
		}
		fprintf(file,"\n \n");
	}
	
	return 0;
}

Tresholding program not found

Tresholding program fails to compile because Tresholding.cl is not found

The file Treshold.cl should be named Tresholding.cl

Issue with Histogram

I am trying to use the histogram program.. The code I am using is:

#include <OpenCLIPP.hpp>
#include "png/lodepng.h"

using namespace std;
using namespace OpenCLIPP;

uint CalculateStep(const SImage& Img);

int main(int argc, char *argv[])
{
string Filename = "lena.png";
SImage ImageInfo;
std::vector SourceData;
unsigned Status = lodepng::decode(SourceData, ImageInfo.Width,ImageInfo.Height, Filename, LCT_RGB);
if (Status == 0)
{
ImageInfo.Channels = 3;
ImageInfo.Type = SImage::U8;
ImageInfo.Step = CalculateStep(ImageInfo);
}

	printf("Check 1 \n");

	//Initialize OpenCL
	COpenCL CL;
	CL.SetClFilesPath("/home/kathleen/Downloads/OpenCLIPP-master/cl-files/");
	Histogram Histogram(CL);

	string Name = CL.GetDeviceName();
	printf("Using device : %s\n", Name.c_str());
	printf("Check 2 \n");
	//Create OpenCL image
	ColorImage SourceImage(CL, ImageInfo, SourceData.data());
	printf("Check 3 \n");

	SourceImage.Send();   
	//Histogram
	uint Histogramptr[256];
	
	Histogram.Histogram1C(SourceImage,Histogramptr);
	printf("Check 4 \n");
	
	return 0;
}

uint CalculateStep(const SImage& Img)
{
uint Depth = 4;
if (Img.Type < SImage::U16)
Depth = 1;
else if (Img.Type < SImage::U32)
Depth = 2;

return Img.Width * Img.Channels * Depth;
}
The error I get is:
Program build failed : :36:51: error: invalid address space for argument to __kernel function
kernel void histogram_1C(INPUT_SPACE const SCALAR source, global uint * hist, uint src_step)
^
:36:51: error: parameter may not be qualified with an address space
:73:49: error: invalid address space for argument to __kernel function
kernel void histogram_4C(INPUT_SPACE const TYPE source, global uint * hist, uint src_step)
^
:73:49: error: parameter may not be qualified with an address space

Thank you for your time.

Bench fails to link in Visual Studio

The GPUBench program fails to link in Visual Studio unless the proper versions of the .lib files of OpenCV are present.

Error message :
1>LINK : fatal error LNK1181: cannot open input file 'opencv_core246.lib'

Compiling an executable Demo on Ubuntu

Hello dear developers,

I'm trying to run your code on my Ubuntu 16.04 system with CUDA SDK(which includes OpenCL) installed.
So far I have been able to build your code successfully.
However I'm struggling to get the code to actually run as executable.

Which compiler should I use (gcc/g++/nvcc) and what options should I specify to generate an executable file?
Are there any further adjustments, that I have to make in order to actually test your code?
E.g. in the Demo.cpp file references some "lena.png" file that is not included in the repository.

Many thanks

Best regards,
Yaroslav

Wrong results from Inverse FFT

FFT transforms have recently been added to the OpenCLIPP, using the clFFT library.
Forward FFT transform works as expected

But inverse FFT results differ significantly from those obtained from Intel IPP.

Inverse FFT was tested on NVIDIA and Intel hardware and the same result was observed.
The result obtained is also the same as the one given by OpenCL OCV which also uses clFFT.
So it looks like the problem is in clFFT.

More tests should be done to narrow the problem :

  • On AMD platform
  • Using more simple values
  • Verify 1D transform
  • Create a simple test program to reproduce problem & report bug

Wrong result when both a "flush" image and a "non-flush" image are used at the same time as argument for a vector operation

Vector programs like ArithmeticVector have two versions. The standard (slower) program that can handle any images and the faster "flush" version that works only on some specific image sizes.

The flush version works correctly only with images that have :

  • no padding at the end of the lines
  • a width that is a multiple of the vector size

VectorProgram::SelectProgram() is used to select the proper program version. But SelectProgram

If a vector operation is called with a flush image as first argument and a non-flush images as second argument, the flush version of the program will be used, resulting in

Workaround : If you run into this problem, you can force the slow version by changing VectorProgram::SelectProgram() to :
Program& VectorProgram::SelectProgram(const ImageBase& Source)
{
if (Source.DataType() < 0 || Source.DataType() >= SImage::NbDataTypes)
throw cl::Error(CL_IMAGE_FORMAT_NOT_SUPPORTED, "unsupported image format used with ImageBufferProgram");

// Never use the fast version to prevent padding issues.
//if (IsImageFlush(Source))
// return GetProgram(Source.DataType()); // Use fast version

// Use slower WITH_PADDING version
return GetProgram(Source.DataType() + SImage::NbDataTypes);
}

TransformBuffer.cpp won't compile without Windows.h

When compiling in non-windows environment, max(a,b) is undefined.
This macro is defined in windows.h; you should not use it.
May I suggest that you define your own min and max macros, for maximum portability.

C Demo does not work in Ubuntu

Hello, I have tried to run C++ and C demos in Ubuntu, C++ works fine but C Test-OpenCLIIPP gives black images on Intel and garbage on Nvidia. No filters work in C side in fact.
I wanted to run test but failed to compile them.

VS build error

When building on VS an error occurs:

1>------ Build started: Project: OpenCLIPP-C++, Configuration: Debug Win32 ------
1> Program.cpp
1>c:\i+d\opencl\openclipp-master\openclipp-master\c++\programs\program.cpp(75): error C3861: 'IsDebuggerPresent': identifier not found
========== Build: 0 succeeded, 1 failed, 4 up-to-date, 0 skipped ==========

In program.cpp there is the code (line 50):

ifndef _MSC_VER

define IsDebuggerPresent() false

endif // _MSC_VER

And building fails as IsDebuggerPresent is not defined for VS compilers.

I suggest something like:

ifndef INTEL_CL_DEBUGGER

define IsDebuggerPresent() false

else

define IsDebuggerPresent() true

endif // INTEL_CL_DEBUGGER

The user can define the macro if debugging is wanted ( /D "INTEL_CL_DEBUGGER" ). Options added by this code are only supported by Intel SDK, so identifying by compiler is not an option as you can have VS with NVIDIA or AMD SDK.

Library fails to build if recent official OpenCL headers are used

The library comes with its own set of OpenCL headers.
These headers are not the most recent OpenCL headers.

If the library is built using a recent version of the official OpenCL headers, the compilation fails.
The failure is due to an imcompatible change made in the cl.hpp file in recent versions of the official OpenCL headers.

Workaround :
Set your build environment to use the headers provided with the library

some build error with vs2013

1,When I build this library with vs2013 and intel opencl sdk (opencl 2.0),"CL_USE_DEPRECATED_OPENCL_2_0_APIS" macro is request , or else will get a build error.

2,RandomImage.cpp Line48 , get a build error,modified to "std::uniform_int_distribution Dist(0, 0xFF);" is ok

3,Visual Studio support #pragma message

ifndef _MSC_VER // Visual Studio does not support #warning

warning "OpenCLIPP is not being built with clFFT - FFT operations will not be available"

else

pragma message("OpenCLIPP is not being built with clFFT - FFT operations will not be available")

endif

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.